DEVOPS

Stale Feature-Flag Sunset Scanner with Auto Removal PR

Runs nightly to find feature flags whose sunset date has passed, then opens a GitHub PR that deletes the flag's code branches and config entry so dead flags don't pile up.

CategoryDevOps
Enginesim
Difficultyintermediate
Triggerschedule
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerNightly schedule fires
  • ActionRead flag registry from PostgresPostgreSQLPostgres
  • LogicKeep flags past sunset date
  • ActionOpen removal PR per stale flagGitHubGitHub
  • OutputPost new PR list to SlackSlack

What it does

Scans your feature-flag registry every night, finds any flag whose sunset date is in the past, and opens a focused GitHub pull request that strips the flag from both code and config. Each stale flag becomes one reviewable PR instead of a backlog item nobody touches.

When to use it

Use it when your team adds flags faster than it removes them and 'temporary' flags have started living for months. Best for orgs that already record a sunset or expiry date alongside each flag.

How it works

  1. 1A nightly schedule fires the run.
  2. 2The flag registry table in Postgres is read and each flag's sunset date is compared to today.
  3. 3A logic step keeps only flags whose sunset date has already passed.
  4. 4For each stale flag, GitHub is searched for every reference, the conditional branches are collapsed to the shipped path, and the config entry is removed.
  5. 5A pull request is opened per flag with the diff, the original sunset date, and a removal checklist.
  6. 6A Slack message posts the list of new removal PRs to the platform channel.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect PostgresAny Postgres URL — query, write, migrate.
  2. 2
    Connect GitHubRepos, issues, pull requests, actions.
  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.