Every 5 minutes
Get emailed when a production deploy fails
A broken production build reaches you with Netlify's error message, while branch previews stay quiet.
- Runs
- Every 5 minutes
- Apps
- Netlify
- AI
- Not needed
- Access
- read (the PAT has full access)
Send this to your assistant
Create a ClickRuntime automation: every 5 minutes, check my Netlify site marketing-site for failed production deploys and email me the error message for any new failure.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A broken build on a feature branch is a normal part of development, and Netlify emails the author about it. A failed production deploy is different: the site is still serving the old version, so everything looks fine, while a hotfix or pricing change sits undeployed. If nobody reads the build email, the team may believe a fix is live for hours, and customers keep hitting the bug.
Every five minutes ClickRuntime lists the site's deploys and keeps those in the error state whose context is production, ignoring branch previews and deploy previews. It sends an email with the commit, branch and error summary, then remembers the deploy IDs so each failure produces a single message.
Teams that deploy automatically on merge, where nobody watches the build, benefit most. It also helps agencies that watch many client sites.
What you get out of it
Hotfixes that did not ship are noticed
If the fix you merged at 11:00 failed to deploy, you hear by 11:10. You do not tell a customer that it is fixed while the old code is still live.
Only production failures interrupt people
Branch preview errors are everyday work and filtered out. The email means something important failed, so people act on it instead of filtering it away. Preview errors are normal work, so only real incidents interrupt anyone.
Context is included for a quick diagnosis
The message names the commit and the error. Often the cause, such as a missing environment variable, is visible without opening the build log. Often the cause, such as a missing variable, is visible without opening the full build log.
No silent drift between repository and site
A failed production build means main and the live site no longer match. Catching it quickly keeps that gap small and avoids confusion about what is deployed. Catching a failed build quickly keeps that gap small and avoids confusion.
Each failure is reported once
Stored deploy IDs prevent repeat emails for the same failure. When the next deploy fails differently, you get a new message, so the inbox stays honest. When the next deploy fails differently you still get a fresh message.
How it works
What happens, step by step
Every five minutes ClickRuntime checks your Netlify site's recent deploys.
It keeps only failed production deploys, so branch previews stay quiet, and skips any it has already reported.
You get an email with the branch and Netlify's error message.
Before it runs live
- Connect Netlify
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 Netlify steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, credentials, http, notify, state, report_fetched
SITE_ID = "your-netlify-site-id"
def netlify(path, **params):
resp = http.get(f"https://api.netlify.com/api/v1/sites/{SITE_ID}/{path}", params=params,
headers={"Authorization": f"Bearer {credentials.secret('NETLIFY_TOKEN')}"})
resp.raise_for_status()
return resp.json()
@on_trigger
def run(event):
deploys = netlify("deploys", per_page=20)
seen = set(state.get("seen") or [])
new = [d for d in deploys if d["state"] == "error" and d["context"] == "production" and d["id"] not in seen]
report_fetched(len(new))
if not new:
return {"failed": 0}
for d in new:
notify.email_me(f"Netlify production deploy failed ({d.get('branch')})", d.get("error_message") or "No error message")
state.set("seen", list(seen | {d["id"] for d in new})[-200:])
return {"failed": len(new)}FAQ
Common questions
How does it tell production from previews?
Does a canceled build count as a failure?
Can I cover several Netlify sites?
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
Receive each Netlify form entry by email
Every new submission to your site's form arrives in your inbox with all its fields.
See how it worksHear when a production deploy is live
Slack tells you as soon as a new production deploy is ready, with its URL.
See how it worksSort form entries and send only leads to Slack
Each form entry is marked as lead, support or spam, and only the leads reach Slack with a short summary.
See how it worksKeep exploring
Set up “Get emailed when a production deploy fails” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.