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.
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
Every 5 minutes it fetches the current value from your source.
The value is compared with your threshold.
If it has just crossed the threshold, you get a text and an email from your Gmail.
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
Build your own
Need it to work differently?
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
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?
When will it alert again?
Can several people be alerted?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Send polite payment reminders by email and text
Customers or tenants with overdue payments get polite reminders by email and text, stepping up gently over time.
See how it worksConfirm appointments, remind clients and rebook no-shows
Clients get an email and text confirming their appointment, a reminder the day before, and a rebooking message if they don't turn up.
See how it worksWin back abandoned carts by email, then text
Shoppers who leave checkout get a reminder email after an hour and a text the next day if they still haven't bought.
See how it worksKeep exploring
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.