On a schedule
Hear when texts start failing
Failed or undelivered messages are posted with their error codes, so you can spot a problem with a number or carrier early.
- Runs
- On a schedule
- Apps
- Twilio
- AI
- Not needed
- Access
- read
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, check for Twilio messages that failed or weren't delivered and post the recipients and error codes to #ops in Slack.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Customers say they never got the code or the delivery update, and the business has no idea why. Twilio messages fail for specific reasons, such as an invalid number, a carrier block or an unregistered sender, and the failures cluster. A one-hour spike of undelivered texts to one carrier could mean hundreds of customers did not receive their verification code, and nobody is told until the support tickets pile up.
On a regular check, this lists the messages sent since the last check that ended up failed or undelivered, and posts to Slack if there are any. You find out when delivery starts breaking, with the count and an example, instead of when customers complain.
It is useful for any team that sends login codes, order updates or appointment reminders by text.
What you get out of it
Delivery problems are found by you
You hear about failed messages before customers write in. That lets you switch providers, fix a number format or contact Twilio support while the problem is still small. Fixing it early means fewer unhappy customers to apologize to.
Protects logins and checkout
Text codes block users when they fail. Detecting a spike in failures quickly means fewer abandoned sign-ups and fewer customers locked out at the moment they are trying to pay.
Clusters point to the cause
Seeing that failures share a country, carrier or error code narrows the investigation. You skip hours of guessing and can send precise details when contacting support. Support then gets a precise report instead of a vague complaint.
Only alerts when there is a problem
No failed messages means no post. The channel stays quiet on healthy days, so a message there is treated as important instead of being scrolled past as noise. That keeps the alert meaningful and the channel trusted.
Saves money on wasted sends
Failed texts can still cost money. Stopping a bad send early, for example to a list with invalid numbers, avoids paying again and again for messages that were never delivered.
How it works
What happens, step by step
Every 15 minutes, ClickRuntime checks your Twilio account for text messages that failed or were not delivered since the last check.
Each failure is reported only once.
If there are any, it posts them to your #alerts Slack channel with the number, the status and the error code, so you can spot a problem with a number or carrier early.
Before it runs live
- 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
- 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 Twilio steps into one automation
Under the hood
The code that runs this automation
from email.utils import parsedate_to_datetime
from clickruntime import on_trigger, credentials, http, state, notify, report_fetched
@on_trigger
def run(event):
sid = credentials.secret("TWILIO_ACCOUNT_SID")
msgs = http.get(f"https://api.twilio.com/2010-04-01/Accounts/{sid}/Messages.json",
auth=(sid, credentials.secret("TWILIO_AUTH_TOKEN")), params={"PageSize": 200}).json()["messages"]
since = state.get("since") or ""
bad = [m for m in msgs if m["status"] in ("failed", "undelivered") and m["date_updated"]
and parsedate_to_datetime(m["date_updated"]).isoformat() > since]
report_fetched(len(bad))
if not bad:
return {"summary": "Nothing new"}
notify.slack("Failed SMS:\n" + "\n".join(f"{m['to']}: {m['status']} (error {m['error_code']})" for m in bad), channel="#alerts")
state.set("since", max(parsedate_to_datetime(m["date_updated"]).isoformat() for m in bad))
return {"failed": len(bad)}FAQ
Common questions
What counts as failed?
How often is it checked?
Will one failed number set off an alert?
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
Sort voicemails into urgent and not urgent
Each voicemail gets a one-line summary, urgent ones go to Slack and the rest arrive by email.
See how it worksGet a text when your form or app reports something
A new form entry, order or failed job sends a short SMS to your phone with the details that matter.
See how it worksGet a text when your site goes down
You get one SMS when a check fails and another when it recovers, without repeats in between.
See how it worksKeep exploring
Set up “Hear when texts start failing” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.