Skip to content

Every 15 minutes

Text you and alert Slack when a metric crosses a threshold

When a number you watch crosses your limit, you get a text and the team gets a Slack message, once per breach.

Runs
Every 15 minutes
Apps
Slack, Twilio
AI
Not needed
Access
Twilio send; chat:write

Send this to your assistant

Create a ClickRuntime automation: every 15 minutes, check our error rate at my metrics URL; if it goes over 5%, text me and post to #ops, and don't alert again until it recovers.

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

Small teams watch a handful of numbers that really matter: error rates, queue lengths, ad spend, stock. A Slack message alone is easy to miss after hours, and texting everyone for every blip burns people out.

Texting the person responsible and posting in Slack the moment a threshold is crossed, and only once per breach, gets attention when it matters without crying wolf.

What you get out of it

  • Noticed after hours

    A text reaches you when Slack is muted.

  • The team stays informed

    The Slack post lets everyone see what's happening.

  • One alert per problem

    You're alerted again only after the value recovers.

  • Any metric

    Works with any number you can fetch from a web address.

How it works

What happens, step by step

  1. Every 15 minutes it fetches the metric from your source.

  2. The value is compared with your threshold.

  3. If it has just crossed, you get a text and a message is posted to Slack.

  4. When it comes back within limits, a recovery note is posted and the alert resets.

Before it runs live

  • Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
  • Connect Twilio

What you get

RunsEvery 15 minutes
Text you and alert Slack when a metric crosses a thresholdtoday, 9:00Succeeded
Slack · #ops:rotating_light: Error rate is 7.2% (limit 5%)

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 Google Sheets
  • Combine it with other Slack and Twilio 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.
critical_alert_by_sms_and_slack.pyexample
from twilio.rest import Client
from clickruntime import on_trigger, credentials, http, notify, state

METRIC_URL = "https://metrics.example.com/api/error-rate"
LIMIT = 5.0
ON_CALL = "+447700900123"
FROM = "+15005550006"

def sms(to, body):
    return Client(credentials.secret("TWILIO_ACCOUNT_SID"), credentials.secret("TWILIO_AUTH_TOKEN")).messages.create(to=to, from_=FROM, body=body)

@on_trigger
def run(event):
    value = float(http.get(METRIC_URL, headers={"Authorization": f"Bearer {credentials.secret('METRICS_TOKEN')}"}).json()["value"])
    breached, was = value > LIMIT, bool(state.get("breached"))
    if breached and not was:
        sms(ON_CALL, f"⚠️ Error rate {value:.1f}% (limit {LIMIT:.0f}%)")
        notify.slack(f":rotating_light: Error rate is {value:.1f}% (limit {LIMIT:.0f}%)", channel="#ops")
    elif was and not breached:
        notify.slack(f":white_check_mark: Error rate back to {value:.1f}%", channel="#ops")
    state.set("breached", breached)
    return {"value": value}

FAQ

Common questions

Can I watch more than one metric?
Yes. List several, each with its own threshold.
Will it tell me when it recovers?
Yes. A recovery message can be posted to Slack.
Can different people get the text?
Yes. Set the on-call number, or several numbers.
What permissions does it need?
Twilio send; chat:write. 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 (every 15 minutes). 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 “Text you and alert Slack when a metric crosses a threshold” from your assistant

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