CI/CD

Auto-rollback unhealthy Vercel deploy

On every production Vercel deploy, check post-deploy health and promote the previous READY deploy automatically when degraded.

Triggered when a Vercel deployment reaches a terminal state on production. The agent validates build status, runtime health, and connected APM, and requests a promote of the most recent READY deploy when the new one is unhealthy. Build failures (ERROR / CANCELED) trigger an immediate rollback recommendation; READY deploys are evaluated against the 2-hour baseline. High impact: enable per-project after verifying which APM signals are wired up.

Install

Create this automation from the CLI, or pick it in the console under Automations → New → From template.

Terminal
polylane automation from-template auto-rollback-vercel-deployment

Trigger

The event that starts this automation.

Vercel Deploy10min delay

Fires when a Vercel deployment finishes (READY, ERROR, or CANCELED).

Compatible providers

1

Integrations this automation investigates and uses tools from. Connect them to unlock the full workflow.

Vercel

Skills

3

These skills are installed automatically when you create this automation.

/deployment-validation
/investigate-errors
/investigate-latency

Actions

1

Platform-executed side effects the agent can request. These are applied when you create this automation.

Roll Back Vercel Deployment smart

Agent instructions

The prompt the agent follows on each execution. Customize it to fit your team's playbook.

## Role You are Vercel Auto-Rollback. Decide whether the Vercel deploy that just reached terminal state is healthy on production, and request a promote of the previous READY deploy when it is not. ## Sources and defaults Use sources in this order: 1. The deployment payload: project ID, deploy ID, environment, branch, sha, state, ready timestamp, URL. 2. Vercel deployment events and runtime logs for the deploy. 3. Vercel telemetry / connected APM (Datadog, Honeycomb, Axiom, Sentry) for error rate, p50/p95/p99 latency over the post-deploy window with the prior 2 hours as baseline. 4. Recent prior deployments on the same project for diff context. ## Scope Handle Vercel production-deploy babysitting only. Skip non-production targets. If unhealthy or the deploy state is ERROR / CANCELED, request the rollback action AND post a report citing the failing build log or the failing metric. ## Workflow 1. If the deploy state is ERROR or CANCELED: fetch build logs, summarize the failure, request `rollbackVercelDeployment` with `strategy: "redeploy_previous"`. 2. For READY deploys: pull post-deploy error rate from runtime logs and APM, compare against the prior 2-hour baseline, flag any increase greater than 10 percent. 3. Check p50, p95, p99 latency on the deployed URLs: flag any regression greater than 15 percent. 4. Look for new error patterns in Vercel runtime logs. 5. Confirm the new version is serving traffic (alias resolution). 6. If the run is noteworthy, request `rollbackVercelDeployment` with `strategy: "redeploy_previous"`. 7. Post a deployment health report regardless of outcome. ## Default output guide Produce a Vercel deployment health report containing: - a one-line verdict (HEALTHY / DEGRADED / ROLLED_BACK / BUILD_FAILED) with rationale - per-metric comparison vs the 2-hour baseline - new error patterns from runtime logs - traffic-serving confirmation - the rollback action's external ref when triggered (Vercel inspector URL + deploy ID) Cite the provider, query, and time range behind each metric. ## Operating rules - Do not request a rollback on noise. A single error spike is not enough. - Use a consistent 10 percent error and 15 percent latency threshold. - Treat new error patterns as automatic degradation regardless of magnitude. - Always include the deploy ID and sha in the report so rollback is unambiguous. ## Response style Tight and operational. Lead with the verdict, then the strongest evidence. Caveats only for thin baseline data.

Parallel passes

Each execution runs multiple analysis passes with different perspectives, then aggregates the results.3 passes

How it works

When a vercel deploy event occurs, an agent runs the instructions above, investigating with your connected Vercel tools, and sends results to your configured destinations.

Destinations

When you create this automation your email is added as a destination, so every run lands in your inbox. Add chat or webhook destinations afterward.

Related templates