Skip to content

Every 15 minutes

Sort new emails, draft replies and create tasks

New emails are labelled, simple questions get a draft reply, and anything you need to do becomes a Google Task.

Runs
Every 15 minutes
Apps
Gmail, Google Tasks
AI
Yes, uses the built-in AI allowance
Access
gmail.modify, gmail.compose; tasks

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, label my new emails as action, reply or FYI, save a draft reply for the ones I should answer, and create a Google Task for anything I need to do.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A full inbox mixes three kinds of email: ones to answer, ones that need work, and ones to read later. Sorting them by eye takes the first hour of many working days, and the replies that only need two lines wait the longest.

Consultants, founders and anyone who handles customer or client email alone use it to start the day with replies already drafted and real work already on a list.

What you get out of it

  • Short replies are already written

    A draft sits in Gmail for each email that only needs an answer. You read, adjust and send.

  • Work goes on a list

    Emails that need more than a reply become Google Tasks, so they are tracked instead of re-read.

  • Nothing is sent without you

    Drafts stay drafts. You decide what goes out and when.

  • Labels show what was handled

    Each email gets a label for its category, so you can see at a glance what has been sorted.

How it works

What happens, step by step

  1. Every 15 minutes, ClickRuntime looks for new emails in your Gmail inbox that it has not sorted yet.

  2. AI decides whether each one needs a reply, needs work, or is just for your information.

  3. Emails that need a reply get a draft saved in Gmail; emails that need work become a Google Task.

  4. Each email gets a label for its category, so it is never sorted twice.

Before it runs live

  • Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
  • Connect Google Tasks

What you get

RunsEvery 15 minutes
Sort new emails, draft replies and create taskstoday, 9:00Succeeded
Gmail · DraftsRe: Delivery date for order 4471 Hi Sam, the order ships on Thursday and should reach Acme by Monday.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other Gmail and Google Tasks steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
inbox_triage_into_tasks.pyexample
import base64
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, report_fetched, credentials, ai

LABELS = {"reply": "Label_reply", "action": "Label_action", "fyi": "Label_fyi"}
SCHEMA = {"type": "object", "properties": {"category": {"enum": list(LABELS)}, "task": {"type": "string"}, "reply": {"type": "string"}}}

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    gmail = build("gmail", "v1", credentials=creds, cache_discovery=False).users()
    new = gmail.messages().list(userId="me", q="in:inbox has:nouserlabels newer_than:2d").execute().get("messages", [])
    report_fetched(len(new))
    if not new:
        return {"new": 0}
    for m in new:
        msg = gmail.messages().get(userId="me", id=m["id"], format="metadata", metadataHeaders=["From", "Subject"]).execute()
        h = {x["name"]: x["value"] for x in msg["payload"]["headers"]}
        out = ai.generate(f"Classify this email as reply, action or fyi. For reply, write a short polite answer. For action, "
                          f"write a task title.\nFrom: {h.get('From')}\nSubject: {h.get('Subject')}\n{msg['snippet']}",
                          json_schema=SCHEMA, max_output_tokens=300).json
        if out["category"] == "reply":
            raw = f"To: {h.get('From')}\r\nSubject: Re: {h.get('Subject', '')}\r\n\r\n{out['reply']}"
            gmail.drafts().create(userId="me", body={"message": {"threadId": msg["threadId"],
                                  "raw": base64.urlsafe_b64encode(raw.encode()).decode()}}).execute()
        if out["category"] == "action":
            build("tasks", "v1", credentials=creds, cache_discovery=False).tasks().insert(tasklist="@default", body={"title": out["task"]}).execute()
        gmail.messages().modify(userId="me", id=m["id"], body={"addLabelIds": [LABELS[out["category"]]]}).execute()
    return {"sorted": len(new)}

FAQ

Common questions

Will it send replies on its own?
No. It only saves drafts in Gmail. You open the draft, edit if needed and press send yourself.
Can drafts sound like me?
Yes. Give your AI assistant a few lines about your tone and sign-off, and the drafts follow them. Short, factual replies come out best.
What does it skip?
Newsletters, notifications and emails you sent yourself are labelled FYI and get no draft or task.
What permissions does it need?
gmail.modify, gmail.compose; tasks. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Sort new emails, draft replies and create tasks” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.