Skip to content

Every 5 minutes

Answer support emails from your FAQ and escalate the rest to Telegram

Routine support questions get a reply from your FAQ within minutes, and anything the AI is unsure about is sent to you on Telegram instead.

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, reply to new support emails with an answer from my FAQ; if you're not confident, don't reply and send the email to me on Telegram.

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 two-person online shop gets the same support questions every day: where is my order, how do I return this, do you ship to Canada. The owner answers them between packing orders, and customers wait half a day for a two-line reply.

Answering the routine questions straight from your own FAQ, while passing anything unusual to a person, gets customers a quick reply and keeps the tricky cases in human hands.

What you get out of it

  • Customers hear back in minutes

    Common questions are answered quickly, even in the evening or at the weekend.

  • Answers come from your own FAQ

    Replies use the policies and wording you wrote, not guesses, so customers get consistent information.

  • Unsure cases go to a person

    When the question is not covered or the customer is upset, no reply is sent and you get the email on Telegram to handle yourself.

  • Your time goes to the hard ones

    With routine questions handled, the emails you see are the ones that need judgement.

How it works

What happens, step by step

  1. Every 5 minutes ClickRuntime checks your support inbox for new emails.

  2. It skips emails it has already handled.

  3. AI compares each question with your FAQ and drafts an answer, noting whether the FAQ really covers it.

  4. Confident answers are sent as a reply in the same email thread. Everything else is sent to you on Telegram to answer yourself.

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
Answer support emails from your FAQ and escalate the rest to Telegramtoday, 9:00Succeeded
Telegram · SupportNeeds you: sam@acme.example. Damaged parcel, wants a refund and a replacement before Friday.

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_customer_support_replies_with_telegram_escalation.pyexample
import base64
from email.message import EmailMessage
from clickruntime import on_trigger, credentials, http, state, ai, report_fetched
G = "https://gmail.googleapis.com/gmail/v1/users/me"
FAQ = "Orders ship within 2 working days. Returns are free within 30 days. We ship to the UK, EU, US and Canada."
SCHEMA = {"type": "object", "properties": {"confident": {"type": "boolean"}, "reply": {"type": "string"}}, "required": ["confident", "reply"]}
@on_trigger
def run(event):
    h = {"Authorization": f"Bearer {credentials.connection('google', 'work')}"}
    seen = set(state.get("seen") or [])
    msgs = [m for m in http.get(f"{G}/messages", headers=h, params={"q": "to:support@ newer_than:1d -from:me"}).json().get("messages", []) if m["id"] not in seen]
    report_fetched(len(msgs))
    if not msgs:
        return {"new": 0}
    for m in msgs:
        msg = http.get(f"{G}/messages/{m['id']}", headers=h, params={"format": "metadata", "metadataHeaders": ["From", "Subject", "Message-ID"]}).json()
        hdr = {x["name"]: x["value"] for x in msg["payload"]["headers"]}
        r = ai.generate([f"FAQ:\n{FAQ}", f"Customer email:\n{msg['snippet']}", "Answer only from the FAQ. confident=false if it is not covered or the customer is upset."],
                        json_schema=SCHEMA, max_output_tokens=300).json
        if r["confident"]:
            e = EmailMessage(); e["To"] = hdr["From"]; e["Subject"] = "Re: " + hdr.get("Subject", ""); e["In-Reply-To"] = hdr.get("Message-ID", ""); e.set_content(r["reply"])
            http.post(f"{G}/messages/send", headers=h, json={"raw": base64.urlsafe_b64encode(e.as_bytes()).decode(), "threadId": msg["threadId"]})
        else:
            bot = credentials.secret("TELEGRAM_BOT_TOKEN")
            http.post(f"https://api.telegram.org/bot{bot}/sendMessage", json={"chat_id": credentials.secret("TELEGRAM_CHAT_ID"),
                      "text": f"Needs you: {hdr['From']}\n{hdr.get('Subject')}\n{msg['snippet']}"})
        seen.add(m["id"])
    state.set("seen", list(seen)[-1000:])
    return {"handled": len(msgs)}

FAQ

Common questions

How does it decide whether it is confident?
The AI only answers when the FAQ clearly covers the question. Complaints, refunds outside your policy and anything ambiguous are escalated.
Which mailbox does it watch?
The Gmail account you connect, limited to a label or address such as support@ if you want.
Can I see what was sent?
Yes. Replies are sent from your Gmail, so they appear in Sent and in the customer's thread like any other email.
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 “Answer support emails from your FAQ and escalate the rest to Telegram” from your assistant

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