Flags guides
14 · Scheduled changes and ramps

Launch at nine. Roll out over a week.

Schedule a change for a set time, or ramp a flag from a few users to everyone on the days you choose, without anyone awake to press the switch.


1

Schedule a change

A scheduled change runs at its time, to within about 30 seconds. A patch (turn on, or off for everyone) applies to whatever the flag is at that moment. A replace sets the whole targeting, but only if nobody changed the flag in the meantime; otherwise it is not applied and shows why. Find them in Flags › Schedules, where you can cancel them too.

schedule.ts
import { Flags } from "@productcraft/flags";
const flags = new Flags();

declare const settingId: string;
declare const productionId: string;

await flags.settings.values.scheduledChanges.create(settingId, productionId, {
  run_at: "2026-11-20T08:00:00.000Z",
  operation: "patch",
  value: true,
  note: "Launch at 09:00 CET",
});

2

Ramp a flag up

A ramp serves the new value to a growing share of users at the times you set, for example 5%, 25%, 50% and then 100%. Buckets are sticky: a user who got the feature at 5% keeps it at 25%. The last step at 100% makes the new value the default and removes the split. Targeting rules still decide first. Pause it if something looks wrong, and resume or stop it later; stopping leaves the split where it got to.

ramp.ts
import { Flags } from "@productcraft/flags";
const flags = new Flags();

declare const settingId: string;
declare const productionId: string;

const ramp = await flags.settings.values.ramps.create(settingId, productionId, {
  value: true,
  steps: [
    { percentage: 5, at: "2026-11-20T08:00:00.000Z" },
    { percentage: 25, at: "2026-11-21T08:00:00.000Z" },
    { percentage: 50, at: "2026-11-22T08:00:00.000Z" },
    { percentage: 100, at: "2026-11-23T08:00:00.000Z" },
  ],
  note: "New checkout",
});

// Something looks wrong: hold it where it is.
await flags.ramps.pause(ramp.id);

3

Where changes need approval

In an environment where you must propose changes, schedule an approved change request instead, or propose the ramp itself as a change request with operation: "ramp". Each step that runs is in the history, recorded as Flags acting for the person who set it up.