Skip to main content
The cron trigger type fires a registered function on a schedule. The handler receives {trigger, job_id, scheduled_time, actual_time} as its payload. Work is typically fanned out by calling iii::durable::publish to downstream queue handlers.

Minimal cron function

Downstream queue handler

The function that consumes the cron’s emitted event:

State sweep cron

A common pattern: read all records in a state scope, filter them by a business rule, and emit events for those that need action.

Cron expression format

iii supports six- or seven-field cron expressions: second minute hour day month weekday [year] (year is optional).

Key concepts

  • Cron handlers receive {trigger, job_id, scheduled_time, actual_time} as their payload.
  • Keep cron handlers lightweight. Use iii::durable::publish to fan out work to queue handlers that can run in parallel.
  • Combine state::list with cron for periodic sweeps over accumulated data — the state sweep pattern above is the idiomatic approach.