How it works
A routine carries a standard five-field cron expression and a timezone.*/5 * * * * is every five minutes; 0 9 * * 1 is 09:00 every Monday. A background scheduler checks due routines roughly once a minute and, when a routine’s time arrives, starts a run of its pinned version in its mode — the same kind of run a webhook or a manual trigger would start. A scheduled run is recorded as a system run, with no human user attached, and trigger type cron.
Create a routine in the app, or from the CLI:
--when takes hourly, daily, weekdays, weekly, monthly or custom (with --cron). The server compiles the schedule, so the CLI and the app’s form always agree on when it fires. jstm agent schedule show, set and clear manage an agent’s routine by the agent’s handle; see jstm agent schedule.
Mode: Simulation or Run
Every routine has a mode, chosen when it is created:simulation— the agent runs, but steps that call outside services get made-up responses. Use this to confirm the schedule and the agent behave as expected.run— the agent runs for real, with side effects.
run when you create the routine, or switch it later with jstm trigger update <trigger-id> --mode run. Changing a routine’s schedule never changes its mode.
Pinned to a version
A routine runs the version it was pinned to when it was created — the latest one, unless you pass--version. Building a new version does not move it. When you are ready, re-pin it:
Timezones
Every routine has its own timezone (--timezone, an IANA zone such as Asia/Kolkata; UTC by default), and its cron expression is evaluated in that zone. A routine created by jstm agent schedule set uses UTC. To change a routine’s schedule and zone together:
jstm trigger next-runs <trigger-id> previews the next fire times in the routine’s own zone, using the same evaluation the scheduler uses — including daylight-saving shifts.
Good to know
Missed runs during downtime aren’t replayed one by one. If the scheduler is down across several scheduled times, it fires the most recent missed one once when it comes back, then resumes normally. It does not fire a burst for every time it missed. Changing the schedule resets its clock. When you set or change a schedule, the next run is its next future time. It will not immediately fire for a time in the past. Nobody is present when a routine fires. Every required input needs a value on the routine (--input KEY=VALUE); a routine without one is refused when you create it.
Clearing stops future runs without deleting anything. jstm agent schedule clear disables the routine; set turns it back on. The agent can still be run manually or by other triggers.
See also
- Schedule an agent — walkthrough.
jstm agent schedule— full reference.- Triggers — webhooks and other ways to start runs.