Automation & Tasks (OpenClaw)
OpenClaw provides six distinct mechanisms for automating agent work. They are complementary and can be combined.
Decision Guide
| Need | Mechanism |
|---|---|
| Exact timing (precise schedule) | Cron |
| Flexible periodic monitoring | Heartbeat |
| Track / audit detached work | Background Tasks |
| Multi-step workflow orchestration | Task Flow |
| React to lifecycle events | Hooks |
| Persistent per-session instructions | Standing Orders |
The Six Mechanisms
Cron (Scheduled Tasks)
Gateway's built-in scheduler. Persists jobs, fires agents at precise times, routes output to chat channels or webhooks. Supports one-shot (--at), fixed interval (--every), and cron-expression (--cron) schedules. Every execution creates a Background Task record.
Heartbeat
Periodic main-session turn (default 30-minute interval) for routine monitoring. Driven by HEARTBEAT.md checklist or tasks: blocks. Does not create background task records — lower overhead than cron for fuzzy polling.
Background Tasks
Append-only ledger recording all detached work: ACP runs, subagent spawns, cron executions, CLI operations. Inspected via openclaw tasks list. A passive audit log — not a scheduler.
Task Flow
Orchestration layer for multi-step workflows: durable execution, managed/mirrored sync modes, revision tracking. Inspected via openclaw tasks flow.
Hooks
Event-driven scripts triggered by agent lifecycle events: session init, resets, stops, compaction, tool calls. Auto-discovered from directories; managed via openclaw hooks. See OpenClaw Hooks for full detail.
Standing Orders
Persistent agent directives stored in AGENTS.md (workspace file), automatically injected into every session. Establishes standing operating authority without needing to re-state instructions each session. Feeds through Context Assembly.
How They Work Together
Cron / Heartbeat / Hooks
│ triggers
▼
Agent turn runs
│ spawns detached work
▼
Background Tasks (audit ledger)
│ multi-step work
▼
Task Flow (orchestration)
Standing Orders inform every agent turn regardless of trigger source.
See Also
- Source - Automation & Tasks (OpenClaw Docs)
- Source - Scheduled Tasks / Cron Jobs (OpenClaw Docs)
- OpenClaw Gateway — Gateway process hosts the cron runtime
- OpenClaw Hooks — full hook event reference