Agent skill
iii-cron-scheduling
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, health checks, batch processing, or any task that should run every N seconds, minutes, hours, or on a weekly/monthly calendar.
Install this agent skill to your Project
npx add-skill https://github.com/iii-hq/iii/tree/main/skills/iii-cron-scheduling
SKILL.md
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 |
|---|---|
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
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:
registerWorker(url, { workerName })— worker initializationregisterFunction(id, handler)— define the scheduled handlerregisterTrigger({ type: 'cron', config: { expression } })— bind the scheduletrigger({ function_id, payload, action: TriggerAction.Enqueue({ queue }) })— offload heavy workconst logger = new Logger()— structured logging per job
Adapting This Pattern
Use the adaptations below when they apply to the task.
- Adjust the 7-field expression to match your schedule (e.g.
0 0 */6 * * * *for every 6 hours) - 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
iii-cron-schedulingwhen the primary need is time-based periodic execution.
When to Use
- Use this skill when the task is primarily about
iii-cron-schedulingin the iii engine. - 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.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
iii-dead-letter-queues
Inspects and redrives jobs that exhausted all retries. Use when handling failed queue jobs, debugging processing errors, or implementing retry strategies.
iii-http-invoked-functions
Registers external HTTP endpoints as iii functions using registerFunction(id, HttpInvocationConfig). Use when adapting legacy APIs, third-party webhooks, or immutable services into triggerable iii functions, especially when prompts ask for endpoint maps like { path, id } iterated into registerFunction calls.
iii-channels
Binary streaming between workers via channels. Use when building data pipelines, file transfers, streaming responses, or any pattern requiring binary data transfer between functions.
iii-event-driven-cqrs
Implements CQRS with event sourcing on the iii engine. Use when building command/query separation, event-sourced systems, or fan-out architectures where commands publish domain events and multiple read model projections subscribe independently.
iii-agentic-backend
Creates and orchestrates multi-agent pipelines on the iii engine. Use when building AI agent collaboration, agent orchestration, research/review/synthesis chains, or any system where specialized agents hand off work through queues and shared state.
iii-engine-config
Configures the iii engine via iii-config.yaml — workers, adapters, queue configs, ports, and environment variables. Use when deploying, tuning, or customizing the engine.
Didn't find tool you were looking for?