Skip to content

Every 5 minutes

Get a text and an email when a value crosses your limit

When a value you watch, like a price, temperature or reading, crosses your threshold, you get a text and an email once, not every check.

Runs
Every 5 minutes
Apps
Gmail, Twilio
AI
Not needed
Access
Twilio; gmail.send

Send this to your assistant

Create a ClickRuntime automation: every 5 minutes, check the value at my monitoring URL; if it goes over my threshold, text me and email me from Gmail once, and again only after it has recovered.

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

Some numbers need watching all the time: a freezer temperature in a restaurant, a stock price you plan to act on, a lab reading. Nobody can stare at a dashboard all day, and a single email alert can sit unseen.

Checking every 5 minutes and sending both a text and an email the moment the value crosses your limit makes sure you see it, while alerting only once per breach keeps your phone quiet until something changes.

What you get out of it

  • Seen straight away

    A text gets noticed even when email is closed.

  • A record by email

    The email keeps the time and value for your records.

  • One alert per breach

    You're not texted every 5 minutes while the problem continues.

  • Any number you can fetch

    Works with any source that returns a value at a web address.

How it works

What happens, step by step

  1. Every 5 minutes it fetches the current value from your source.

  2. The value is compared with your threshold.

  3. If it has just crossed the threshold, you get a text and an email from your Gmail.

  4. It remembers the alert, so you're not alerted again until the value recovers and crosses again.

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 Twilio

What you get

RunsEvery 5 minutes
Get a text and an email when a value crosses your limittoday, 9:00Succeeded
SMS · Me⚠️ Freezer 1 at Northwind Kitchen is at -9.5°C (limit -15°C)

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 Gmail 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_alerts_by_sms_and_email.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from twilio.rest import Client
import base64
from clickruntime import on_trigger, credentials, http, state

SOURCE = "https://sensors.example.com/freezer-1"
MAX = -15.0
ME_PHONE, ME_EMAIL = "+447700900123", "me@example.com"
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)
gmail = lambda: build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).users()

def send_email(to, subject, text):
    raw = base64.urlsafe_b64encode(f"To: {to}\r\nSubject: {subject}\r\n\r\n{text}".encode()).decode()
    gmail().messages().send(userId="me", body={"raw": raw}).execute()

@on_trigger
def run(event):
    value = float(http.get(SOURCE).json()["value"])
    over, was_over = value > MAX, bool(state.get("over"))
    if over and not was_over:
        msg = f"⚠️ Freezer 1 is at {value:.1f}°C (limit {MAX:.0f}°C)"
        sms(ME_PHONE, msg)
        send_email(ME_EMAIL, "Threshold crossed", msg)
    state.set("over", over)
    return {"value": value, "over": over}

FAQ

Common questions

Can it alert when a value drops too low?
Yes. Set a minimum, a maximum, or both.
When will it alert again?
After the value has gone back within limits and then crosses again.
Can several people be alerted?
Yes. List several phone numbers and email addresses.
What permissions does it need?
Twilio; gmail.send. 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 5 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 “Get a text and an email when a value crosses your limit” from your assistant

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