Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(experiments): teach experiment skills the feature_flag config shape (#69841)

Andersc900966b9a07
diff --git a/products/experiments/skills/configuring-experiment-rollout/SKILL.md b/products/experiments/skills/configuring-experiment-rollout/SKILL.md
index a1ca5b9d9eb3..e87530da1e99 100644
--- a/products/experiments/skills/configuring-experiment-rollout/SKILL.md
+++ b/products/experiments/skills/configuring-experiment-rollout/SKILL.md
@@ -40,24 +40,50 @@ The right mitigation depends on experiment state:
## The two rollout controls
-There are two separate controls that determine who sees what. Both are set via `parameters`.
+There are two separate controls that determine who sees what.
+Both live on the linked feature flag, sent through the `feature_flag` object in the flag's own shape (not the deprecated `parameters` keys).
-### 1. Variant split (`parameters.feature_flag_variants`)
+### 1. Variant split (`feature_flag.filters.multivariate.variants`)
How users **inside** the experiment are distributed across variants.
-- Array of `{key, name, split_percent}` — percentages must sum to 100
-- First variant must have key `"control"` — this is the baseline
+- Array of `{key, name, rollout_percentage}`, where the `rollout_percentage` values must sum to 100
+- Exactly one variant key must be the literal string `"control"` (the baseline)
- Minimum 2 variants, maximum 20
- Default: control 50% / test 50%
If the user says "A/B/C test", map the baseline to `"control"` and create additional variants for the others.
-### 2. Overall rollout (`parameters.rollout_percentage`)
+### 2. Overall rollout (`feature_flag.filters.groups[0].rollout_percentage`)
-What percentage of **all** users enter the experiment at all. Default: 100%.
+What percentage of **all** users enter the experiment at all, sent as a single rollout group: `groups: [{ "properties": [], "rollout_percentage": N }]`.
+Default: 100%.
-Users not included are excluded entirely — they don't see any variant and are **not part of the analysis**.
+Users not included are excluded entirely: they don't see any variant and are **not part of the analysis**.
+
+### Where these are sent
+
+Both controls live inside `feature_flag.filters`:
+
+```json
+{
+ "feature_flag": {
+ "filters": {
+ "multivariate": {
+ "variants": [
+ { "key": "control", "name": "Control", "rollout_percentage": 50 },
+ { "key": "test", "name": "Test", "rollout_percentage": 50 }
+ ]
+ },
+ "groups": [{ "properties": [], "rollout_percentage": 100 }]
+ },
+ "ensure_experience_continuity": false
+ }
+}
+```
+
+`filters` may also carry `aggregation_group_type_index` (to run the experiment on a group type rather than individual users) and `payloads` (JSON-encoded strings keyed by variant key).
+On a **running** experiment, any flag-config change must also send `update_feature_flag_params: true`, otherwise the API rejects the update before it reaches the flag (see "Changing rollout on a running experiment").
### How they interact
diff --git a/products/experiments/skills/creating-experiments/SKILL.md b/products/experiments/skills/creating-experiments/SKILL.md
index 4fa21e3693c9..d5f18157dcdc 100644
--- a/products/experiments/skills/creating-experiments/SKILL.md
+++ b/products/experiments/skills/creating-experiments/SKILL.md
@@ -63,25 +63,32 @@ Call `experiment-create` with:
"name": "Descriptive experiment name",
"feature_flag_key": "kebab-case-key",
"description": "Hypothesis: [what you expect to happen]",
- "parameters": {
- "feature_flag_variants": [
- { "key": "control", "name": "Control", "split_percent": 50 },
- { "key": "test", "name": "Test", "split_percent": 50 }
- ],
- "rollout_percentage": 100
+ "feature_flag": {
+ "filters": {
+ "multivariate": {
+ "variants": [
+ { "key": "control", "name": "Control", "rollout_percentage": 50 },
+ { "key": "test", "name": "Test", "rollout_percentage": 50 }
+ ]
+ },
+ "groups": [{ "properties": [], "rollout_percentage": 100 }]
+ },
+ "ensure_experience_continuity": false
}
}
```
-Two different percentages — do NOT mix them up:
+Flag config goes in the `feature_flag` object, in the flag's own filters shape (not the deprecated `parameters` keys).
+Two different percentages live in there, do NOT mix them up:
-- `feature_flag_variants[].split_percent` — how users **inside** the experiment are split across variants (must sum to 100, recommended to have an even split).
-- `parameters.rollout_percentage` — what fraction of **all** users enter the experiment at all (0-100, defaults to 100).
+- `filters.multivariate.variants[].rollout_percentage` is how users **inside** the experiment are split across variants (must sum to 100, recommended to have an even split).
+- `filters.groups[0].rollout_percentage` is the overall gate: what fraction of **all** users enter the experiment at all (0-100, defaults to 100).
Key details:
-- First variant must have key `"control"`. Minimum 2, maximum 20 variants.
-- `rollout_percentage` defaults to 100 if omitted.
+- Exactly one variant key must be the literal string `"control"` (the baseline). Minimum 2, maximum 20 variants.
+- `filters.groups[0].rollout_percentage` defaults to 100 if omitted.
+- `ensure_experience_continuity` persists a user's variant across authentication steps; leave it `false` unless the flag is shown to both logged-out and logged-in users (see `configuring-experiment-rollout`).
- Stats default to Bayesian. Only set `stats_config` if the user requests Frequentist.
## After creation