Skip to content

Every 5 minutes

Sort your inbox with AI and get urgent emails on Telegram

New emails are labelled and newsletters archived for you, and only the urgent ones reach your phone as a Telegram message.

Runs
Every 5 minutes
Apps
Gmail, Telegram
AI
Yes, uses the built-in AI allowance
Access
Gmail gmail.modify; Telegram bot token

Send this to your assistant

Create a ClickRuntime automation: every 5 minutes, classify my new emails, apply labels, archive newsletters and promotions, and send me a Telegram message with a one-line summary of anything urgent.

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 restaurant owner gets supplier orders, booking questions, staff messages and a steady stream of promotions in one Gmail inbox. During service he cannot scroll through it, so the email from the fish supplier saying tomorrow's delivery is cancelled waits until midnight.

Letting the inbox sort itself and sending only the important messages to a phone app you already check means urgent email gets seen in minutes, without living in your inbox.

What you get out of it

  • Urgent email reaches you anywhere

    A short Telegram message with who it is from and what they need is easier to notice on a busy day than an inbox badge.

  • Promotions stop crowding the inbox

    Newsletters and offers are labelled and archived, so the inbox holds only messages that need a person.

  • Labels make the backlog quicker

    When you do sit down with email, it is already grouped by type, such as orders, customers and admin.

  • Fewer alerts, each one meaningful

    Only messages judged urgent trigger a notification, so you do not learn to ignore them.

How it works

What happens, step by step

  1. Every 5 minutes ClickRuntime checks your Gmail for new emails.

  2. It skips emails it has already sorted.

  3. AI reads the sender, subject and opening of each email and picks a category and how urgent it is.

  4. Each email gets a label, newsletters and promotions are archived, and urgent ones are sent to you on Telegram with a one-line summary.

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 Telegram

What you get

RunsEvery 5 minutes
Sort your inbox with AI and get urgent emails on Telegramtoday, 9:00Succeeded
Telegram · Inbox alertsNorthwind Seafood: tomorrow's 7am delivery is cancelled, they can deliver Thursday instead.

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 Telegram 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.
ai_inbox_triage_with_telegram_alerts.pyexample
import time
from clickruntime import on_trigger, credentials, http, state, ai, report_fetched

G = "https://gmail.googleapis.com/gmail/v1/users/me"
LABELS = {"customer": "Label_1", "supplier": "Label_2", "admin": "Label_3", "newsletter": "Label_4", "promo": "Label_5"}
SCHEMA = {"type": "object", "properties": {"category": {"type": "string", "enum": list(LABELS)},
          "urgent": {"type": "boolean"}, "summary": {"type": "string"}}, "required": ["category", "urgent", "summary"]}

@on_trigger
def run(event):
    h = {"Authorization": f"Bearer {credentials.connection('google', 'work')}"}
    since = state.get("since") or 0
    msgs = http.get(f"{G}/messages", headers=h, params={"q": f"in:inbox after:{since}"}).json().get("messages", [])
    report_fetched(len(msgs))
    if not msgs:
        return {"new": 0}
    bot, chat = credentials.secret("TELEGRAM_BOT_TOKEN"), credentials.secret("TELEGRAM_CHAT_ID")
    for m in msgs:
        msg = http.get(f"{G}/messages/{m['id']}", headers=h, params={"format": "metadata", "metadataHeaders": ["From", "Subject"]}).json()
        hdr = {x["name"]: x["value"] for x in msg["payload"]["headers"]}
        r = ai.generate(f"From: {hdr.get('From')}\nSubject: {hdr.get('Subject')}\n{msg['snippet']}\nUrgent means a cancelled delivery, complaint or deadline today.",
                        json_schema=SCHEMA, max_output_tokens=80).json
        remove = ["INBOX"] if r["category"] in ("newsletter", "promo") else []
        http.post(f"{G}/messages/{m['id']}/modify", headers=h, json={"addLabelIds": [LABELS[r["category"]]], "removeLabelIds": remove})
        if r["urgent"]:
            http.post(f"https://api.telegram.org/bot{bot}/sendMessage", json={"chat_id": chat, "text": f"{hdr.get('From')}: {r['summary']}"})
    state.set("since", int(time.time()))
    return {"sorted": len(msgs)}

FAQ

Common questions

What counts as urgent?
You describe it in plain words, for example cancelled deliveries, complaints, or anything from your accountant. The AI uses that description for every email.
Will it delete anything?
No. Archived newsletters and promotions stay in Gmail under their label and in All Mail.
Can I see why an email was marked urgent?
Each Telegram message includes the one-line reason, so you can adjust your description if it flags the wrong things.
What permissions does it need?
Gmail gmail.modify; Telegram bot token. 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 your inbox with AI and get urgent emails on Telegram” from your assistant

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