Skip to content

The moment it happens

Send error alerts to WhatsApp and Telegram

When a job fails, you get an alert on both WhatsApp and Telegram, with repeats held back.

Runs
The moment it happens
Apps
Telegram, WhatsApp Business
AI
Not needed
Access
bot token; whatsapp_business_messaging

Send this to your assistant

Create a ClickRuntime automation: when my jobs send an error to my trigger link, alert me on Telegram and with my WhatsApp alert template, but skip the same error if it was sent in the last 30 minutes.

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 solo developer or small agency runs scheduled jobs for clients: imports, backups, syncs. When one fails overnight, the error goes to a log nobody reads, and the client notices before you do.

Sending each failure to both WhatsApp and Telegram makes sure it's seen on whichever app you check first, and holding back repeats keeps a broken job from flooding your phone.

What you get out of it

  • Seen on the app you check first

    Two apps means the alert isn't missed if one is muted.

  • No floods

    The same error is sent at most once every 30 minutes.

  • Details at a glance

    Each alert names the job and the error message.

  • Works with anything

    Any job or tool that can send a webhook can report failures.

How it works

What happens, step by step

  1. A job sends its error to ClickRuntime.

  2. If the same job and error were sent in the last 30 minutes, it's skipped.

  3. You get a Telegram message with the job name and error.

  4. You also get a WhatsApp alert using your approved template.

Before it runs live

  • Connect Telegram
  • Connect WhatsApp Business
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Send error alerts to WhatsApp and Telegramjust nowSucceeded
Telegram · Alerts❌ acme-nightly-import failed: timeout connecting to the warehouse API

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
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Telegram and WhatsApp Business 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.
error_alerts_to_whatsapp_and_telegram.pyexample
import time
from clickruntime import on_event, credentials, http, state

MY_CHAT = 123456789
MY_PHONE = "447700900123"
WA = "https://graph.facebook.com/v20.0/your-phone-number-id/messages"

def wa_template(to, name, params):
    body = {"messaging_product": "whatsapp", "to": to, "type": "template", "template": {"name": name, "language": {"code": "en"},
            "components": [{"type": "body", "parameters": [{"type": "text", "text": str(p)} for p in params]}]}}
    return http.post(WA, headers={"Authorization": f"Bearer {credentials.secret('WHATSAPP_TOKEN')}"}, json=body).json()
TG = "https://api.telegram.org"

def tg(chat_id, text):
    http.post(f"{TG}/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/sendMessage", json={"chat_id": chat_id, "text": text})

@on_event
def handle(event):
    e = event.json or {}
    job, error = str(e.get("job", "job"))[:80], str(e.get("error", "failed"))[:300]
    key = f"last:{job}:{error[:60]}"
    if time.time() - (state.get(key) or 0) < 1800:
        return {"skipped": "repeat"}
    tg(MY_CHAT, f"❌ {job} failed: {error}")
    wa_template(MY_PHONE, "job_failed", [job])
    state.set(key, time.time())
    return {"alerted": job}

FAQ

Common questions

Why a template for WhatsApp?
Alerts usually start a new conversation, and WhatsApp only allows approved templates for that.
How are repeats spotted?
By the job name and error. Different errors from the same job are still sent.
Can the alert go to a group?
Yes, on Telegram. Add the bot to a group and use the group's chat ID.
What permissions does it need?
bot token; whatsapp_business_messaging. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
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 “Send error alerts to WhatsApp and Telegram” from your assistant

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