Request icon
If icon
SlackIncomingWebhook icon
Pause icon
Log icon

Vercel production failure check with human-in-the-loop rollback approval

Detect Vercel build failures, alert Slack, pause for operator sign-off, and rollback to a healthy deployment with declarative Kestra orchestration.

Categories
CloudInfrastructure

Continuous deployment enables fast shipping, but broken production builds can cause immediate customer downtime. While automated rollbacks are fast, blindly redirecting production traffic without verification can cause schema mismatches or disrupt data consistency.

This blueprint provides an autonomous production guard that bridges automated detection with interactive human authorization. Using native Kestra plugins, it eliminates custom scripts and offers a transparent, auditable remediation pipeline.

How it works

  1. check_latest_production_deployment (io.kestra.plugin.core.http.Request) invokes Vercel's REST API (GET /v6/deployments) to inspect the active production deployment state.
  2. evaluate_deployment_health (io.kestra.plugin.core.flow.If) inspects the response to verify whether readyState is ERROR.
  3. notify_operator_of_failure (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) dispatches a Slack alert with incident metadata and a direct URL to the execution.
  4. pause_for_rollback_approval (io.kestra.plugin.core.flow.Pause) holds execution until an on-call engineer reviews the failure and confirms the rollback decision.
  5. execute_rollback_if_approved (io.kestra.plugin.core.flow.If) checks the approval status.
  6. trigger_vercel_rollback (io.kestra.plugin.core.http.Request) invokes Vercel's Rollback API (POST /v1/projects/{id}/rollback/{targetId}) to redirect production traffic to the designated healthy deployment.
  7. log_rollback_success or log_rollback_cancelled (io.kestra.plugin.core.log.Log) records the full audit trail.

What you get

  • Zero-glue-code automated production deployment surveillance using native HTTP and flow plugins.
  • Human-in-the-loop approval gate preventing accidental or unintended production rollbacks.
  • Instant incident notification in Slack with direct navigation to the execution approval modal.
  • Full audit logging of who authorized the rollback and the rationale recorded in execution state.

Who it's for

  • Platform Engineers and DevOps teams managing mission-critical Vercel applications.
  • Site Reliability Engineers (SREs) establishing automated rollback guardrails with human sign-off.
  • Engineering Leads needing an auditable approval trail for production traffic diversions.

Why orchestrate this with Kestra

Building custom rollback scripts inside CI jobs or serverless functions often creates hidden failure modes, lacks native human-in-the-loop approval modals, and provides poor execution visibility. Kestra provides declarative flow control, built-in secret management, durable state pausing (io.kestra.plugin.core.flow.Pause), and unified execution tracking without managing custom webhook infrastructure.

Prerequisites

  • A Vercel account with project admin privileges.
  • A configured Slack Incoming Webhook URL.

Secrets

  • VERCEL_API_TOKEN: Vercel Personal Access Token or Team Token with deployment read and project write permissions.

Quick start

  1. Add VERCEL_API_TOKEN to your Kestra namespace secrets.
  2. Configure project_id to match your Vercel project name or ID.
  3. Specify target_deployment_id with the ID of your last verified production deployment (dpl_xxxx).
  4. Set slack_webhook_uri to your team's Slack incoming webhook URL.
  5. Trigger the flow manually or attach a schedule trigger (io.kestra.plugin.core.trigger.Schedule) for recurring surveillance.

How to extend

  • Automated target discovery: Prepend an API call to dynamically query and select the most recent deployment in READY state.
  • PagerDuty escalation: Pair Slack alerting with io.kestra.plugin.pagerduty.Incident to page on-call responders during high-severity outages.
  • Multi-environment guard: Parameterize the target environment to safeguard staging and preview deployments across diverse teams.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.