← Workflows

阅读中文版本

Feature Flag Lifecycle Workflow

Create a flag with an owner and expiry, roll out by cohort, monitor the feature, and remove the flag once it is fully released or abandoned.

intermediate~90 minreleasefeature-flagsoperations

Objective

Manage a feature flag from introduction to removal so flags do not accumulate as permanent technical debt.

Environment

  • A feature flag platform
  • Monitoring for the flagged feature

Steps

1. Create the flag with an owner,

Create the flag with an owner, description, and expiry date.

Expected state: Every flag is accountable and temporary.

2. Roll out to increasing cohorts based

Roll out to increasing cohorts based on metrics.

Expected state: Exposure is controlled and observed.

3. Decide to fully release or kill

Decide to fully release or kill based on data.

Expected state: The flag serves a decision, not stagnation.

4. Remove the flag and its dead

Remove the flag and its dead branches after rollout.

Expected state: Flag debt does not accumulate.

Decision points

Test flags in production?

  • Yes with monitoring
  • No

Prefer a dedicated environment; production flags need careful monitoring and a short life.

Remove the losing branch or keep it?

  • Remove
  • Keep for later

Remove; keeping the losing branch is dead code that rots.

Expected outcome

The feature is released or abandoned, the flag is removed, and no dead code paths remain.

Verification

Confirm telemetry supported the release decision and that the flag and both branches are deleted from the codebase after full rollout.

Cleanup

Archive the flag record with the decision and remove it from the platform.

Overview

Manage a feature flag from introduction to removal so flags do not accumulate as permanent technical debt. Confirm telemetry supported the release decision and that the flag and both branches are deleted from the codebase after full rollout.

Steps

  1. Create the flag with an owner, description, and expiry date. Expected state: Every flag is accountable and temporary.
  2. Roll out to increasing cohorts based on metrics. Expected state: Exposure is controlled and observed.
  3. Decide to fully release or kill based on data. Expected state: The flag serves a decision, not stagnation.
  4. Remove the flag and its dead branches after rollout. Expected state: Flag debt does not accumulate.
if (flags.isEnabled('new-checkout', { userId })) {
  return renderNewCheckout();
}
return renderLegacyCheckout();
// remove this branch after full rollout

Verification

  • The feature is released or abandoned, the flag is removed, and no dead code paths remain.

Decision points

  • Test flags in production? Options: Yes with monitoring; No. Recommended: Prefer a dedicated environment; production flags need careful monitoring and a short life.
  • Remove the losing branch or keep it? Options: Remove; Keep for later. Recommended: Remove; keeping the losing branch is dead code that rots.