Skip to content

Rollback Procedures

Each service in the Foundry stack has its own rollback mechanism. In an incident, identify which service is affected and roll back that service independently.

Vercel maintains a full deployment history. Rollback takes effect immediately with zero downtime.

  1. Go to Vercel Dashboard -> your project -> Deployments
  2. Find the last working deployment (green checkmark)
  3. Click the ”…” menu -> “Promote to Production”

The previous deployment is promoted instantly. No rebuild required. All traffic shifts to the rolled-back version.

Cloudflare Workers (Agent Worker / Sandbox Worker)

Section titled “Cloudflare Workers (Agent Worker / Sandbox Worker)”
  1. List recent deployments:

    Terminal window
    cd agent-worker
    wrangler deployments list
  2. Roll back to a specific deployment:

    Terminal window
    wrangler rollback <deployment-id>

Repeat for sandbox-worker/ if the sandbox worker needs rollback.

  1. Go to Cloudflare Dashboard -> Workers & Pages -> your worker
  2. Click the “Deployments” tab
  3. Select the deployment to roll back to
  4. Click “Rollback”

Convex does not have a one-click rollback button. The safest approach is to redeploy from a known-good commit.

  1. Identify the last known-good commit:

    Terminal window
    git log --oneline -20
  2. Check out that commit and redeploy:

    Terminal window
    git checkout <good-commit-hash>
    bunx convex deploy
  3. Return to your working branch:

    Terminal window
    git checkout main

For risky schema or function changes, use Convex preview deployments to test before deploying to production:

Terminal window
bunx convex deploy --preview <preview-name>

Preview deployments create an isolated Convex instance with its own database. Test against it before promoting to production.

If a broken deploy was caused by incorrect environment variables rather than code:

  1. Go to Vercel project -> Settings -> Environment Variables
  2. Edit the incorrect variable
  3. Redeploy (Vercel does not auto-redeploy on env var changes)

When multiple services are affected, restore in dependency order:

  1. Cloudflare Workers — restore the agent worker and sandbox worker first. Other services depend on their availability.

  2. Convex — restore backend functions. The frontend cannot operate without a working backend.

  3. Vercel — restore the frontend last. It is the least critical to restore first since the backend and workers must be healthy for it to function.

  4. Webhooks — verify webhook endpoints are receiving and processing events. Check the retry queue tables for accumulated failures during the outage.

After rolling back any service:

  1. Check Convex function logs for errors. The Convex dashboard shows real-time function invocations with success/failure status.
  2. Check Cloudflare Worker logs via wrangler tail for real-time log streaming.
  3. Verify webhook processing by checking buffer tables (sourceControlEvents, atlassianWebhookEvents) for events stuck in "pending" status.
  4. Run the verification checklist from the Production Setup page to confirm all services are healthy.