Flag Dependencies

Flag dependencies define relationships between flags to ensure evaluation order. The result of each flag's evaluation is then passed to all subsequent evaluations to decide if dependent flags should evaluate based on the result of the dependency.

Flag dependencies are used to implement:

Flag prerequisites

Flag prerequisites

Available for flags and experiments

Flag prerequisites is a generic implementation of flag dependencies to allow any flags or experiments to depend on any other flags or experiments. Evaluation of the prerequisites can check specific variants or target users who weren't included in the prerequisite flag or experiment.

Use flag prerequisites to:

  • Actively develop large feature releases with many developers and teams.
  • Build provisioning for users to primary SKUs with add-ons.
  • Simplifying complex feature flag logic in code.
  • Build complex hierarchies of mutually exclusive experiments which start at different times

For more information, see Flag Prerequisites

Mutual exclusion groups

Mutual exclusion group

Available for experiments only

A mutual exclusion group ensures that, on evaluation, at most one of the experiments within the group is assigned. In Amplitude Experiment, a mutual exclusion group defines multiple slots, each with a percentage of traffic allocated to that slot. The mutual exclusion group is actually just a flag with a variant for each slot. Experiments in the group add a dependency on one or more slots (variants) of the mutual exclusion group flag.

The variant result of a mutual exclusion group's evaluation isn't returned and not assigned as a user property.

For more information, see Set up and run mutually exclusive experiments

Holdout groups

Available for experiments only

A holdout group withholds a percentage of traffic from a group of experiments, allowing measurement of the long-term and combined impact of multiple experiments. Amplitude Experiment implements a holdout group using a flag with two variants: holdout and on, where the holdout variant is allocated the holdout percentage defined on creation. Experiments in the group depend on the holdout group's variant on.

The variant result of a holdout group's evaluation isn't returned but is assigned as a user property to enable holdout analysis.

For more information, see Holdout Groups

Local evaluation support

Flag dependencies (mutual exclusion and holdout groups) is only supported after certain version of SDKs.

Older local evaluation SDK versions

Prior local evaluation SDK versions don't consider mutual exclusion or holdout groups at all. In other words, two experiments in a mutual exclusion group evaluated with an old local evaluation SDK version aren't mutually exclusive.

SDK Local Evaluation Flag Dependencies Support
Node.js 1.4.0+
Ruby 1.1.0+
JVM 1.1.0+
Go 1.1.0+
Python 1.1.0+
Was this page helpful?

Thanks for your feedback!

June 18th, 2024

Need help? Contact Support

Visit Amplitude.com

Have a look at the Amplitude Blog

Learn more at Amplitude Academy

© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.