Feature flags accumulate over time as experiments conclude, features ship, and rollouts complete. Stale flags create technical debt, increase cognitive load during deployments, complicate testing matrices, and introduce risk when old conditional logic remains in production code. Product ops teams lack systematic processes to identify, audit, and remove flags, leaving cleanup to ad-hoc effort or post-mortems.
This workflow automates the discovery and removal of feature flags that have reached end-of-life. It runs on a cadence (monthly or quarterly), queries your flag management system for candidates, notifies flag owners with context, collects sign-off on safety and dependencies, and generates a cleanup backlog. The workflow reduces manual audit burden and ensures flags don't linger indefinitely in production.
Trigger: Scheduled (monthly or quarterly) or manual initiation by product ops lead
Connect to your flag management platform (LaunchDarkly API, Unleash, or custom endpoint) and retrieve all flags matching cleanup criteria: age > threshold, status = shipped/rolled out, no recent changes, not in exclusion list. Export results with flag name, owner, creation date, last modified date, current rollout %, and linked experiment/ticket.
Cross-reference flag candidates against code repositories and deployment logs to identify where each flag is referenced. Detect conditional logic, feature branches, and downstream dependencies. Flag any that appear in critical paths or multiple services. Attach this context to each candidate record for owner review.
Send templated Slack, email, or in-app notifications to flag owners listing their assigned flags for review. Include: flag name, age, rollout status, usage context, and a link to a shared document or form. Set a response deadline (e.g., 5 business days). Provide a checklist: confirm flag is safe to remove, document any dependencies, confirm no active experiments, sign off on removal.
Use a shared form (Google Form, Airtable, Jira, or custom tool) to collect owner responses. Fields: flag name, owner name, removal readiness (yes/no/needs investigation), blockers or dependencies, linked ticket for removal, and sign-off timestamp. Automate reminders for non-responders at day 3 and day 5.
Review responses and flag any entries marked 'needs investigation' or with documented blockers. Create tickets or Slack threads to resolve dependencies (e.g., code still referencing the flag, active A/B test, customer-specific rollout). Assign to engineering or product lead. Do not proceed with removal until blocker is cleared.
Compile all flags approved for removal into a prioritized backlog. Sort by: flags with zero dependencies (lowest risk), flags in single service (medium risk), flags in multiple services (highest risk). Create Jira/GitHub tickets for each removal with: flag name, owner, removal steps, code locations, and rollback plan. Link to original owner sign-off.
Assign cleanup tickets to engineering sprints over the next 1–2 quarters. Batch removals by service or codebase to reduce review overhead. Ensure each removal includes: code cleanup, test updates, documentation, and flag deletion from management system. Pair with low-risk releases or maintenance windows.
Monitor Jira/GitHub for merged removal PRs. Update a shared dashboard with: flags removed this cycle, total flags remaining, average flag age, and removal velocity. Report monthly to product leadership. Use metrics to forecast next cleanup cycle and adjust cadence if needed.
1. Audit your feature flag system: document all flags, owners, and creation dates. Identify flags > 90 days old with 100% rollout or concluded experiments. 2. Choose flag age and status thresholds based on your risk tolerance and release cadence. 3. Set up API access to your flag management system and test read permissions. 4. Create a notification template in Slack or email with flag details, owner checklist, and deadline. 5. Build or configure an approval form (Jira, Airtable, Google Form) to collect owner sign-off. 6. Write a script or use an automation platform (Zapier, Make, n8n) to orchestrate steps 1–3 on a monthly or quarterly schedule. 7. Run a pilot with 10–20 flags to validate the workflow, refine templates, and measure response rates. 8. Expand to full flag inventory and establish a recurring cadence. 9. Create a shared dashboard to track metrics and report progress to leadership. 10. Document the workflow in your runbook and train product ops and engineering teams.