Feature Flag Rollout Safe Workflow
Roll out a new feature using a feature flag with percentage-based gradual rollout and instant rollback capability.
Objective
Deploy a new feature safely using gradual rollout with the ability to instantly roll back.
Environment
- A feature flag system
- A new feature behind a flag
- Monitoring and alerting for the feature
Steps
1. Create the flag
Create a feature flag in the flag system with a description and owner.
Expected state: A feature flag is created and configured.
2. Roll out to 5 percent
Enable the flag for 5 percent of users and monitor for errors.
Expected state: The feature is live for a small percentage with no errors.
3. Gradually increase
Increase the rollout percentage in stages: 25, 50, 75, 100 percent.
Expected state: The feature is progressively enabled for more users.
4. Monitor each stage
Check error rates, performance, and user feedback at each stage before proceeding.
Expected state: Each stage is verified before the next increase.
5. Full rollout or rollback
Complete the rollout at 100 percent or roll back instantly if issues are detected.
Expected state: The feature is fully deployed or safely rolled back.
Decision points
How fast to ramp up?
- Slow, with overnight observation
- Fast, if early stages are clean
Ramp slowly through the first 25 percent; accelerate if no issues are observed.
Expected outcome
The new feature is safely rolled out to all users, or rolled back, with minimal risk at each stage.
Verification
Monitor error rates and performance metrics at each rollout stage; confirm the flag can be turned off instantly.
Cleanup
Disable the feature flag if issues are detected; clean up the flag after full successful rollout.
Flags make deployment safe
Feature flags decouple deployment from release, allowing you to deploy code safely and control who sees it.
Implementation Notes
This workflow provides a structured approach to ensure consistent results across team members and environments.
Common Pitfalls
Skipping verification steps or rushing through the process can lead to incomplete results. Always follow each step in order and verify before proceeding.
Quick Reference
# Execute the workflow steps as documented above
echo "Workflow completed successfully"