Skip to content

Every 5 minutes

Get a Slack alert when a production deploy fails

When a production deployment errors, you hear about it within minutes with the project, branch and commit.

Runs
Every 5 minutes
Apps
Vercel
AI
Not needed
Access
read (token scoped to team)

Send this to your assistant

Create a ClickRuntime automation: every 5 minutes, check my Vercel projects for production deployments that failed and post each one to #deploys in Slack with the project name, branch and commit message.

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

A developer merges to main at 4:50 on a Friday, Vercel starts the production build, and it fails on a type error that only shows up in the cloud environment. The Vercel dashboard marks the deployment red, but nobody is looking at it. The previous production deployment keeps serving, so the site seems fine, while the fix everyone thinks is live is not. The mistake is found Monday when a customer reports the old behavior.

Every five minutes the automation asks Vercel for deployments that reached the ERROR state since the last check, keeps only production ones, and posts each in Slack with the project and a link to the failed deployment. It stores the IDs it has already reported, so one failure produces exactly one message.

Small teams without a dedicated release engineer get the most out of it, since a failed build then has no obvious owner watching for it.

What you get out of it

  • Failed releases reach Slack within minutes

    The five-minute check means a broken production build is announced shortly after it fails, while the person who pushed it is still at their desk and the diff is fresh in their mind, so the repair is quick.

  • Stop assuming the fix is live

    Vercel keeps serving the last good deployment after a failure, which hides the problem. A Slack message corrects the false belief that a merged fix reached users, before anyone tells a customer it shipped.

  • Preview noise stays out of the channel

    Only production failures are posted. Developers fail preview builds all day while iterating, and flooding the channel with those would train everyone to mute it and miss the alerts that actually matter.

  • One alert per failure, not a flood

    Reported deployment IDs are remembered between runs, so a failure that sits in the list for hours does not repeat every five minutes and the channel stays readable for the conversation that follows it.

  • A trail of when things broke

    Slack history shows the time each production build failed. During a postmortem you can answer how long a bad state lasted and who noticed first without digging through deployment logs across several projects.

How it works

What happens, step by step

  1. Every five minutes ClickRuntime checks Vercel for deployments that errored since its last check.

  2. It keeps only production deployments and skips any it has already reported.

  3. Your Slack channel gets the project, branch and commit message of each failed deploy.

Before it runs live

  • Connect Vercel

What you get

RunsEvery 5 minutes
Get a Slack alert when a production deploy failstoday, 9:00Succeeded
Slack · #deploysProduction deploy failed: storefront (main) Upgrade Next.js to 15.2

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

  • 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 Vercel 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.
get_alerted_when_a_deployment_fails.pyexample
import time
from clickruntime import on_trigger, credentials, http, notify, state, report_fetched

TEAM_ID = "team_your-team-id"

def deployments(**params):
    resp = http.get("https://api.vercel.com/v6/deployments", params={"teamId": TEAM_ID, "limit": 100, **params},
                    headers={"Authorization": f"Bearer {credentials.secret('VERCEL_TOKEN')}"})
    resp.raise_for_status()
    return resp.json()["deployments"]

@on_trigger
def run(event):
    since = state.get("since") or int(time.time() * 1000) - 5 * 60 * 1000
    failed = deployments(state="ERROR", target="production", since=since)
    report_fetched(len(failed))
    if not failed:
        return {"failed": 0}
    for d in failed:
        meta = d.get("meta", {})
        notify.slack(f"Production deploy failed: {d['name']} ({meta.get('githubCommitRef', '?')})\n"
                     f"{meta.get('githubCommitMessage', '')}\nhttps://{d['url']}", channel="#deploys")
    state.set("since", max(d["created"] for d in failed) + 1)
    return {"failed": len(failed)}

FAQ

Common questions

How quickly will I hear about a failed production deploy?
The check runs every five minutes, so the message typically arrives within five minutes of the build ending in error. It is a polling check rather than an instant webhook, which keeps setup down to a single Vercel token and nothing to configure in Vercel.
Does a canceled deployment trigger the alert?
No. Only deployments in the ERROR state count. A deployment canceled by a newer push or by a person is a normal event, and including those would only add noise to the channel and teach people to ignore it.
Can the alert go to a different Slack channel per project?
Yes. Because the message includes the project name, the routing can send each project's failures to its own channel, such as the web team's channel for the marketing site and the platform channel for the API.
What permissions does it need?
read (token scoped to team). 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 checks. Checks that find nothing new 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 Slack alert when a production deploy fails” from your assistant

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