INTEGRITY Cloudflare Docs

Targeting rules

Targeting rules let you serve different flag values to different users based on their attributes. Each flag can have zero or more rules.

Rules are evaluated in sequential order, from top to bottom. The first rule whose conditions match is used, and its configured variant is returned. If no rule matches, Flagship returns the flag's default variant.

When a flag is disabled, the default variant is always returned regardless of rules.

Place more specific rules before broader rules. A broad catch-all rule can prevent later rules from running.

How rules work

A rule consists of:

Condition structure

Each condition compares an attribute from the evaluation context against a value using an operator:

If the evaluation context does not include the attribute referenced by a condition, that condition does not match.

Logical grouping

Conditions within a rule can be grouped with AND/OR operators and nested up to five levels deep.

For example, to target enterprise users in the US or Canada:

Use the smallest set of context attributes necessary to express the rule. This keeps rule behavior easier to reason about and avoids sending unnecessary user data in evaluation context.

Learn more