Ignitify.dev
Run on a schedule
Guides

Run on a schedule

A recurring schedule starts a run of a task at each slot of a cron expression, for example every night at 03:00 or every 10 minutes. Each slot runs the newest READY deployment of the task, so a new deploy changes what the next slot runs and keeps the schedule.

To start one run at a set time, use Run later. For a worked example, see the uptime check tutorial.

CommandWhat it does
schedule:previewShows the next fire times of an expression. It creates nothing.
schedule:createCreates a recurring schedule for a task.
schedule:listLists your schedules, one-time and recurring.
schedule:showShows one recurring schedule: its state, run settings and next fire times.
schedule:updateChanges a schedule in place. The id and the runs stay.
schedule:pauseStops a schedule from firing.
schedule:resumeLets a paused schedule fire again.
schedule:cancelDeletes a schedule. The runs it started stay.

1 · Check the expression

schedule:preview prints the next five fire times in UTC. --tz sets the IANA time zone that the expression reads in. The default is UTC.

terminal
$ ignitify schedule:preview "0 9 * * 1-5" --tz America/New_Yorkcron      0 9 * * 1-5timezone  America/New_YorkNext fire times (UTC; the expression reads in America/New_York)  • 2027-01-15T14:00:00.000Z  • 2027-01-18T14:00:00.000Z  • 2027-01-19T14:00:00.000Z  • 2027-01-20T14:00:00.000Z  • 2027-01-21T14:00:00.000Z

An expression has five fields. Put it in quotes.

FieldValues
minute0 to 59
hour0 to 23
day of month1 to 31
month1 to 12, or jan to dec
day of week0 to 6 (0 is Sunday), or sun to sat
  • Each field takes a number, *, a list (1,15), a range (1-5) and a step (*/10).
  • The nicknames @hourly, @daily, @weekly, @monthly and @yearly also work.
  • A seconds or a year field (six or seven fields) is refused. The extensions L, W, # and ? are refused too.
ExpressionFires
*/10 * * * *Every 10 minutes.
0 3 * * *Every day at 03:00.
0 9 * * 1-5At 09:00, Monday to Friday.
0 0 1 * *At midnight on the first day of each month.

2 · Create the schedule

schedule:create takes the task and the expression. Deploy the task first: a slot with no READY deployment does not run.

terminal
$ ignitify schedule:create image-resize --cron "0 3 * * *" --tz Europe/Berlin --timeout-sec 120✓ Schedule Createdschedule_id         sch_Vb7LmQ2sXe9Ktask_name           image-resizecron                0 3 * * *timezone            Europe/Berlinoverlap             skipstatus              ACTIVEnext_fire_at        2027-01-15T02:00:00.000Z…Next fire times (UTC; the expression reads in Europe/Berlin)  • 2027-01-15T02:00:00.000Z  • 2027-01-16T02:00:00.000Z  …

These flags set what every run of the schedule gets:

FlagMeaning
--tzThe IANA time zone of the expression, for example Europe/Berlin. The default is UTC.
--payloadThe JSON input of every run. The default is an empty object.
--presetThe instance class of every run. The default comes from the task.yaml of the deployment.
--timeout-secThe time limit of every run. The default comes from the task.yaml of the deployment.
--deadline-secA hard wall-clock limit of every run. It must be at least the time limit.
--overlapskip (the default): a slot starts nothing while the last run of the schedule is still active. allow: the slot starts a run anyway.

3 · See what it does

schedule:list shows all your schedules with their task names. schedule:show shows one schedule with its state, its last slot and its next fire times. run:list --schedule shows the runs it started.

terminal
$ ignitify schedule:list
ignitify schedule:show sch_Vb7LmQ2sXe9K
ignitify run:list --schedule sch_Vb7LmQ2sXe9K

Read these fields first:

FieldMeaning
statusactive fires. paused: you paused it. auto_paused: the platform paused it (see step 8).
state_textWhy the schedule does not run, in plain words. Empty while it is active.
last_outcomeWhat the last slot did: fired, or the reason it did not run (see step 7).
last_outcome_textThe same, in plain words.
consecutive_missesSlots in a row that did not run for a cause you can fix. A run that starts sets it to 0.
run_settingsThe preset and limits that you gave the schedule. It is in --json output only.
payload_sha256The digest of the payload. It is in --json output only.

4 · Change it

schedule:update changes a schedule in place. Its id, its runs and its miss count stay. Only the flags that you give change. It takes the same flags as schedule:create, except the task.

terminal
$ ignitify schedule:update sch_Vb7LmQ2sXe9K --cron "30 4 * * *"✓ Schedule Updated…✓ Schedule updated: sch_Vb7LmQ2sXe9K. The change applies from the next slot; a slot already queued and a run already started keep the old run settings.
  • A new expression or time zone counts the next slot from now.
  • --payload replaces the whole payload. To check that it changed, compare payload_sha256 in schedule:show --json.
  • The status does not change. A paused schedule stays paused until you resume it.
  • To move a schedule to another task, create a new schedule and delete the old one.

5 · Pause, resume and delete

schedule:pause stops a schedule from firing. A run that already started goes on. schedule:resume starts it again from its next slot. The slots that it missed while it was paused do not run.

terminal
$ ignitify schedule:pause sch_Vb7LmQ2sXe9K
ignitify schedule:resume sch_Vb7LmQ2sXe9K

schedule:cancel deletes the schedule. The runs that it started stay. It asks first; --yes skips the question, and a script needs it.

terminal
$ ignitify schedule:cancel sch_Vb7LmQ2sXe9K --yesWill cancel schedule sch_Vb7LmQ2sXe9K — it will never fire.✓ Schedule cancelled: sch_Vb7LmQ2sXe9K

6 · Read the slot in your task

Each run tells your task which run it is and, when a schedule started it, which slot it serves. ctx.run.id is the run_… id of the run. ctx.run.schedule_id is the sch_… id of the schedule, and ctx.run.scheduled_for is the slot time in UTC (ISO-8601, with milliseconds).

index.ts
export async function run(_payload, ctx) {
  const { id, schedule_id, scheduled_for } = ctx.run;
  // a slot, e.g. sch_Vb7LmQ2sXe9K + 2027-01-15T02:00:00.000Z
  const key = schedule_id ? `${schedule_id}:${scheduled_for}` : id;
  // write to your database with this key, so one slot writes once
  return { key };
}
RuntimeFields; for a run that no schedule started
Nodectx.run.id, ctx.run.schedule_id, ctx.run.scheduled_for; the two schedule fields are null.
Pythonctx.run.id, ctx.run.schedule_id, ctx.run.scheduled_for; the two schedule fields are None.
Goctx.Run.ID, ctx.Run.ScheduleID, ctx.Run.ScheduledFor; the two schedule fields are "".
Rustctx.run.id, ctx.run.schedule_id, ctx.run.scheduled_for; the two schedule fields are Option<String> and None.
  • Use (schedule_id, scheduled_for) or ctx.run.id as your idempotency key when the task writes to another system. A platform retry of a run keeps its id.
  • Go and Rust tasks get ctx.Run and ctx.run from the client in their ignitify/ folder. Take it from CLI 3.5.0 or later: create the task again with task:create, or copy ignitify/ from a new one, then deploy.

7 · When a slot does not run

When a plan limit stops a slot (runs at the same time, compute units or a rate limit), the slot waits and tries again. It gives up at its next slot or at its start deadline, whichever comes first. A slot that does not run sets last_outcome to one of these reasons:

last_outcomeWhy the slot did not run
overlap-skippedThe last run was still active and overlap is skip. You get no notification.
no-ready-deploymentThe task has no READY deployment. Deploy it.
run-settingsThe preset, time limit, deadline or execution conflict with each other, or no plan can run them. Fix them with schedule:update or in task.yaml.
supersededA plan limit held the slot until its next slot.
entitlement-lostA monthly limit of your plan is reached.
tenant-disabledYour account is disabled.
deadline-passedThe platform was late and skipped the slot. After a long delay, only the newest due slot starts.

Each of these, except overlap-skipped, sends a schedule.missed notification. The skipped slot does not run later by itself. If you need it, run it by hand (step 9).

terminal
$ ignitify notification:list --kind schedule.missed

8 · When the platform pauses a schedule

The platform pauses a schedule and sets status to auto_paused for one of three reasons. You get a schedule.paused notification. Read pause_reason in schedule:show, fix the cause, then run schedule:resume.

pause_reasonCause and fix
consecutive-misses10 slots in a row did not run for a cause you can fix (no-ready-deployment, run-settings, or a wait on your own plan limit). last_outcome shows the last cause. Fix it, then resume.
plan-limitYour plan no longer allows what the schedule runs. pause_detail names the plan field. Change the run settings with schedule:update, or change plan, then resume.
invalid-scheduleThe expression or the time zone gives no next run time. Fix it with schedule:update, then resume.

A slot that the platform skipped (deadline-passed), a spent monthly limit, an overlap skip and a disabled account do not count toward the 10.

9 · Run a past slot by hand

To test a schedule, or to run a missed slot again, start one run with task:run and put the slot time in the payload. A run that you start has no schedule, so ctx.run.scheduled_for is null. Let the task read the slot from the payload first.

index.ts
export async function run(payload, ctx) {
  const slot = payload.slot ?? ctx.run.scheduled_for;
  // …do the work for this slot
  return { slot };
}

Find the payload of an earlier run of the schedule. run:get --full shows it under payload. If the schedule has no earlier run, use your own copy.

terminal
$ ignitify run:list --schedule sch_Vb7LmQ2sXe9K --limit 1
ignitify run:get run_H8kQ2mNxT4pL --full

The schedule runs the newest READY deployment of the task. hook:list names it on its last line. Pass it with --deployment, and give the run an idempotency key, so a retry after a network error starts no second run.

terminal
$ ignitify hook:list hello
ignitify task:run hello --deployment 019f3c24-1b05-7c9a-8e21-4d6f0b93a7e2 \
  --payload '{"slot":"2027-01-15T02:00:00.000Z"}' \
  --idempotency-key sch_Vb7LmQ2sXe9K-2027-01-15T02-00Z --wait
  • The run uses the preset, the time limit and execution that the deployment stored from its task.yaml. A slot also uses the run settings of the schedule (run_settings in schedule:show --json). If the schedule sets a time limit, pass the same --timeout-sec.
  • Without --deployment, task:run uses the deployment in the local state of the folder. That can be another deployment than the one the schedule runs.
  • For 24 hours, a key returns the first answer and starts nothing new. If the run failed, use a new key to run it again.

10 · Resume after a platform incident

A long platform incident can pause your schedules with pause_reason consecutive-misses. After the incident, resume only the schedules that it paused. Put the start of the incident, in UTC, in the filter, so that a schedule paused before it for another cause stays paused.

terminal
$ ignitify schedule:list --json | jq -r '.[]
  | select(.kind=="cron" and .status=="auto_paused" and .pause_reason=="consecutive-misses"
           and .updated_at >= "2027-01-15T01:00:00Z")
  | .schedule_id' | xargs -n1 ignitify schedule:resume

A pause and a resume ask no question, so the loop runs in a script. A resume checks your plan again, and it does not catch up the missed slots. Run the slots you need by hand (step 9).

11 · Tell schedules apart

A notification names the sch_… id. schedule:show gives its task, expression, time zone and state. Two schedules of one task with the same expression differ only in the payload: compare payload_sha256 in schedule:show --json.

terminal
$ ignitify schedule:show sch_Vb7LmQ2sXe9K --json

12 · End a schedule on a date

A schedule has no end date. Delete it on the day: from a reminder, a CI job or a Terraform destroy. A month range in the expression stops it inside one year: 0 3 * 1-3 * runs only from January to March.

terminal
$ ignitify schedule:cancel sch_Vb7LmQ2sXe9K --yes

13 · Plans and permissions

  • Recurring schedules come with a paid plan. On the Free plan, a create and a resume are refused with capability-denied. See Pricing.
  • If you move to the Free plan, your schedules stay, but none of them runs: at its next slot each one is paused (plan-limit). After you move to a paid plan again, resume them.
  • Your plan limits how many schedules you keep, and a paused schedule counts too. whoami shows max_schedules.
  • The runs of a schedule count against your run limits like any run.
  • A key needs schedules.read to list and show schedules, and schedules.write to create, change, pause, resume and delete them. See Users, groups and permissions.