Skip to main content
This guide gives an agent a recurring routine, verifies it in Simulation, switches it to real runs, moves it to a new version, and later turns it off.
1

Pick the version

A routine runs one pinned version. Pick one that has completed a Simulation. Without --version below, the routine is pinned to the latest version.
2

Create the routine, starting in Simulation

Start in Simulation, so nothing outside JoyStream changes while you confirm the cadence:
--when takes hourly, daily, weekdays, weekly (with --weekday), monthly (with --day-of-month), or custom (with --cron). If the agent has required inputs, give each one with --input KEY=VALUE: nobody is present when a routine fires, so a routine missing one is refused.The command prints the routine’s trigger id.
3

Verify

next-runs shows when it fires next, in the routine’s own timezone. After it fires, its Simulations appear in jstm agent run list failed-payment-digest --fired-by 8c41f2b9-77de-4a30-b0c5-2e1f6a9d4b77.
4

Switch to real runs

When you’re happy with the Simulations, switch the routine’s mode:
From now on each scheduled run has real side effects. A real run is refused at fire time if a service the version uses is not connected.
5

Move to a new version

Building a new version does not change what the routine runs. After the new version passes its own Simulation, re-pin the routine:
The command prints the old version and the new one. To go back, re-pin to the earlier version.
6

Turn it off

To stop scheduled runs without deleting anything:
To turn it back on, run jstm trigger update 8c41f2b9-77de-4a30-b0c5-2e1f6a9d4b77 --enabled.

Common cron expressions

For --when custom --cron, jstm agent schedule set --cron and jstm trigger update --cron: Expressions are evaluated in the routine’s own timezone (UTC unless it was created with --timezone or changed with jstm trigger update --timezone).

Notes

  • If the platform is down across several scheduled times, it fires the most recent missed one once on recovery, not a burst.
  • Changing the schedule resets the clock to the next future time. It won’t back-fire.

See also