flag-schedule
flag-schedule
Add a timed activation window to a GrowthBook feature flag rule. A scheduled rule activates automatically at a start time and/or deactivates automatically at an end time, without requiring a manual publish each time.
Scheduling applies to force and rollout rule types. It does not apply to experiment-ref or safe-rollout rules.
All API calls go through the bundled helper: ${CLAUDE_PLUGIN_ROOT}/scripts/gb-call. It needs GB_API_KEY set in env or written to ~/.config/growthbook/.env by /growthbook:gb-setup.
How scheduling works
GrowthBook supports two scheduling mechanisms on rules:
Simple schedule (schedule field on rule creation) — the preferred approach. Specify startDate and/or endDate as ISO 8601 timestamps. The server sets up the underlying scheduleRules automatically.
Legacy scheduleRules — a 2-element array [start, end] where each element is { timestamp: "<ISO 8601 or null>", enabled: <bool> }. Still accepted by the API; the simple schedule field is cleaner for new rules.
How the OFF state works
A scheduled rule is a rule-level mechanism, not a flag-level toggle. When the rule is inactive (outside its window), it is skipped in evaluation — the flag falls through to whatever comes next in rule order, ultimately landing on defaultValue.