Iii iii-cron-scheduling
install
source · Clone the upstream repo
git clone https://github.com/iii-hq/iii
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/iii-hq/iii "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/iii-cron-scheduling" ~/.claude/skills/iii-hq-iii-iii-cron-scheduling && rm -rf "$T"
manifest:
skills/iii-cron-scheduling/SKILL.mdsource content
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
- 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 |
|---|---|
| Define the handler for the scheduled job |
| Bind a cron expression to a function |
| Cron schedule in 7-field format |
Reference Implementation
See ../references/cron-scheduling.js for the full working example — a recurring scheduled task that fires on a cron expression and optionally enqueues heavy work.
Also available in Python: ../references/cron-scheduling.py
Also available in Rust: ../references/cron-scheduling.rs
Common Patterns
Code using this pattern commonly includes, when relevant:
— worker initializationregisterWorker(url, { workerName })
— define the scheduled handlerregisterFunction(id, handler)
— bind the scheduleregisterTrigger({ type: 'cron', config: { expression } })
— offload heavy worktrigger({ function_id, payload, action: TriggerAction.Enqueue({ queue }) })
— structured logging per jobconst logger = new Logger()
Adapting This Pattern
Use the adaptations below when they apply to the task.
- Adjust the 7-field expression to match your schedule (e.g.
for every 6 hours)0 0 */6 * * * * - Keep the cron handler lightweight — use it to validate and enqueue, not to do the heavy lifting
- For jobs that need state (e.g. last-run timestamp), combine with
iii-state-management - Multiple cron triggers can feed the same queue for fan-in processing
Engine Configuration
iii-cron must be enabled in iii-config.yaml. See ../references/iii-config.yaml for the full annotated config reference.
Pattern Boundaries
- If the task is about one-off async work rather than recurring schedules, prefer
.iii-queue-processing - If the trigger should fire on state changes rather than time, prefer
.iii-state-reactions - Stay with
when the primary need is time-based periodic execution.iii-cron-scheduling
When to Use
- Use this skill when the task is primarily about
in the iii engine.iii-cron-scheduling - Triggers when the request directly asks for this pattern or an equivalent implementation.
Boundaries
- Never use this skill as a generic fallback for unrelated tasks.
- You must not apply this skill when a more specific iii skill is a better fit.
- Always verify environment and safety constraints before applying examples from this skill.