DEVOPS

Auto-retire preview deployments when their PR is merged or closed

Listens for GitHub pull request merged or closed events and deletes the associated Vercel preview deployments and their aliases.

CategoryDevOps
Enginesim
Difficultyintermediate
Triggerevent
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitHub pull_request closed or merged eventGitHubGitHub
  • LogicConfirm real close/merge and parse branch
  • ActionList preview deployments for the branchVercelVercel
  • ActionDelete deployments and remove aliasesVercelVercel
  • OutputConfirm retired previews in SlackSlack

What it does

Keeps preview deployments from piling up after they stop mattering. When a pull request is merged or closed, it finds the preview deployments tied to that PR's branch and deletes them along with their aliases.

When to use it

Use it when closed PRs leave behind dozens of live preview URLs that still serve traffic, hold storage, and count against bandwidth. Retiring them at PR close keeps the deployment list clean and the bill honest.

How it works

  1. 1A GitHub webhook fires when a pull request is closed or merged.
  2. 2A logic step confirms the event is a real close or merge, not just an edit, and extracts the branch name.
  3. 3The flow queries the Vercel API for preview deployments matching that branch.
  4. 4It deletes each matching deployment and removes its preview aliases.
  5. 5It posts a brief confirmation to Slack listing how many previews were retired and the storage reclaimed.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitHubRepos, issues, pull requests, actions.
  2. 2
    Connect VercelDeploys, runtime logs, analytics.
  3. 3
    Connect SlackChannels, DMs, threads, mentions.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.