| name | iii-cron-scheduling |
| description | Registers cron triggers with 7-field expressions to run functions on recurring schedules. Use when scheduling periodic jobs, timed automation, crontab replacements, cleanup routines, report generation, batch processing, or calendar-based work that is genuinely time-driven. |
Cron Scheduling
Comparable to: node-cron, APScheduler, crontab
Key Concepts
Use the concepts below when they fit the task. Not every scheduled job needs all of them.
- Cron expressions use a 7-field format:
second minute hour day month weekday year
- The cron parser also accepts 5-field (no seconds) and 6-field (no year) expressions, but 7-field is the standard.
- iii-cron evaluates expressions and fires triggers on schedule
- Install or enable it with
iii worker add iii-cron
- Handlers should be fast — enqueue heavy work to a queue instead of blocking the cron handler
- Each cron trigger binds one expression to one function
- Overlapping schedules are fine; each trigger fires independently
Architecture
iii-cron timer tick
→ registerTrigger type:'cron' expression match
→ registerFunction handler
→ (optional) TriggerAction.Enqueue for heavy work
iii Primitives Used
| Primitive | Purpose |
|---|
registerFunction | Define the handler for the scheduled job |
registerTrigger({ type: 'cron' }) | Bind a cron expression to a function |
config: { expression: '0 0 9 * * * *' } | Cron schedule in 7-field format |
Reference Implementation