How-to guide

How to roll out a feature behind a flag

How do I roll out a feature flag and know when to turn it off?

Deploy the change with the flag disabled, verify the existing path and enable the new path for a defined group. Choose a user outcome to watch and agree when to pause or switch back. Remove the flag after the rollout and its recovery period are complete.

Write the rollout decision before enabling the flag

Choose a group you can identify in the results. A count of successful page loads can miss a broken action further along the journey.

  1. Run the same representative journey with the flag off and on. Record the outcome that must hold in both states.
  2. Decide who can widen or stop the rollout, which outcome they will watch and how much evidence they need.
  3. Switch the flag back in a test environment after someone uses the new path. Verify that the old path can still read any data the new path wrote.

Plan for changes that survive the switch

Turning a flag off affects subsequent decisions in the application. Data already written, messages already sent and jobs already queued may need their own recovery step. Give the flag an owner and record when the old branch can be removed.

Worked example

Try a new delivery date picker

A retailer enables a new picker for a small group and watches whether shoppers can save and reopen their chosen dates. In staging, the team saves a date using the new picker, turns the flag off and reopens the order through the old screen. A blank delivery date would expose a compatibility problem before widening the rollout.

Adapted by Cue April from The Engineering Handbook v1.0.0 by Tenhaw (© 2026 Tenhaw LTD). The examples and pull request checks are Cue April adaptations. Tenhaw on deployment strategies and feature flags · CC BY 4.0

Try it on your pull request

On your own PR, choose one action that writes data with the flag on and check whether the old path can read the result.

Try Cue April on your repository

Create an account, connect your repository and review the test plan.