Skip to content
Agile & Delivery

Feature Flag

Definition

A Feature Flag is a toggle that allows developers to turn specific features on or off in production without requiring a full deployment. This enables testing, A/B testing, or gradual rollout of new features.

Diagram

How a feature flag routes usersThe new checkout is deployed for everyone but switched by a flag. Staff and a 10% beta group get the new checkout; everyone else still gets the current one. Turning the flag off sends everyone back without a redeploy.StaffBeta group (10%)Everyone elseFlag:new-checkoutonoffNew checkoutCurrent checkoutone deploy · the flag decides who sees what · off again in seconds
Flags separate releasing code from releasing a feature, which makes gradual rollouts, A/B tests and a quick kill switch possible. Each flag is also a branch in the code: remove it once the rollout is finished, or they pile up into debt.

Case study

Worked example