Skip to content

Hourly

Get a Telegram alert when your ad balance runs low

Telegram warns you once when your Meta ad account's remaining balance or spend cap drops below your limit.

Runs
Hourly
Apps
Facebook Pages, Telegram
AI
Not needed
Access
ads_read; bot token

Send this to your assistant

Create a ClickRuntime automation: every hour, check my Meta ad account's balance and spend cap. If what's left falls below 100, alert me on Telegram once, and again only after it's been topped up and drops again.

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

An agency runs prepaid ad accounts for clients. When a balance runs out, ads stop silently, and nobody notices until a client asks why sales dropped over the weekend.

Now Telegram sends one alert as soon as an account gets close to empty, with time to top it up before the ads stop.

What you get out of it

  • Ads don't stop by surprise

    You hear before the money runs out, not after.

  • One alert, not a flood

    You're told once per low balance, then again only after a top-up.

  • Works for spend caps too

    Approaching an account spend cap triggers the same warning.

  • On your phone

    Telegram reaches you even outside office hours.

How it works

What happens, step by step

  1. Every hour, ClickRuntime reads your ad account's balance, spend cap and amount spent.

  2. It works out how much is left before ads would stop.

  3. If that's below your limit, you get a Telegram alert.

  4. It remembers the alert, so you hear again only after a top-up and a new drop.

Before it runs live

  • Connect Facebook Pages
  • Connect Telegram

What you get

RunsHourly
Get a Telegram alert when your ad balance runs lowtoday, 9:00Succeeded
Telegram · Ad alertsAd account Northwind Shop has 62.40 EUR left. Top up soon.

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

  • Run it at a different time, more or less often, or only on weekdays
  • 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 Facebook Pages 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.
low_ad_balance_alert_on_telegram.pyexample
from clickruntime import on_trigger, credentials, http, state

AD_ACCOUNT, CHAT, LIMIT = "act_1234567890", "123456789", 100.0

@on_trigger
def run(event):
    acct = http.get(f"https://graph.facebook.com/v21.0/{AD_ACCOUNT}",
                    params={"fields": "balance,spend_cap,amount_spent,currency",
                            "access_token": credentials.connection("facebook", "work")}).json()
    cap, spent = float(acct.get("spend_cap") or 0) / 100, float(acct["amount_spent"]) / 100
    left = cap - spent if cap else float(acct["balance"]) / 100
    low = left < LIMIT
    if low and not state.get("alerted"):
        token = credentials.secret("TELEGRAM_BOT_TOKEN")
        http.post(f"https://api.telegram.org/bot{token}/sendMessage",
                  json={"chat_id": CHAT, "text": f"Ad account {AD_ACCOUNT} has {left:.2f} {acct['currency']} left. Top up soon."})
    state.set("alerted", low)
    return {"left": round(left, 2), "low": low}

FAQ

Common questions

What counts as low?
The amount left, either prepaid balance or room under the spend cap, falling below the limit you set.
Can it watch several ad accounts?
Yes. List them in the prompt and each has its own alert.
Can it top up the balance?
No. It only reads the balance and sends alerts. Adding funds stays with you.
What permissions does it need?
ads_read; bot token. 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 each time it runs (hourly). Checks that find nothing to do 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 “Get a Telegram alert when your ad balance runs low” from your assistant

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