Automation in OpenClaw: Tasks, Hooks, Standing Orders, and Task Flow

Learn how OpenClaw handles background operations through tasks, automations, hooks, standing orders, and Task Flow. This guide helps you choose the right approach for scheduled jobs, event-driven actions, and recurring workflows.

Read this when

  • Deciding how to automate work with OpenClaw
  • Choosing between heartbeat, automations, hooks, and standing orders
  • Looking for the right automation entry point

OpenClaw executes background operations through tasks, scheduled jobs, event hooks, and standing instructions. This page helps you choose the appropriate approach.

Quick decision guide

flowchart TD
    START([What do you need?]) --> Q1{Schedule work?}
    START --> Q2{Track detached work?}
    START --> Q3{Orchestrate multi-step flows?}
    START --> Q4{React to lifecycle events?}
    START --> Q5{Give the agent persistent instructions?}

    Q1 -->|Yes| Q1a{Specific job or ambient monitor?}
    Q1a -->|Specific job| CRON["Automations"]
    Q1a -->|Ambient monitor| HEARTBEAT["Heartbeat monitor automation"]

    Q2 -->|Yes| TASKS[Background Tasks]
    Q3 -->|Yes| FLOW[Task Flow]
    Q4 -->|Yes| HOOKS[Hooks]
    Q5 -->|Yes| SO[Standing Orders]
Use caseRecommendedWhy
Send daily report at 9 AM sharpAutomationsExact timing, isolated execution
Remind me in 20 minutesAutomationsOne-shot with precise timing (--at)
Run weekly deep analysisAutomationsStandalone task, can use different model
Check inbox every 30 minAutomationsIndependent recurring schedule and job history
Trigger safely on new IMAP emailIMAP pluginSender-gated isolated reader sessions
Monitor calendar for upcoming eventsAutomationsExplicit recurring schedule and delivery policy
Surface ambient main-session updatesHeartbeatSystem-owned monitor automation and quiet alerts
Inspect status of a subagent or ACP runBackground TasksTasks ledger tracks all detached work
Audit what ran and whenBackground Tasksopenclaw tasks list and openclaw tasks audit
Multi-step research then summarizeTask FlowDurable orchestration with revision tracking
Run a script on session resetHooksInternal HOOK.md scripts react to lifecycle events
Trigger an agent from an external serviceWebhooksAuthenticated HTTP ingress, not an internal event hook
Execute code on every tool callPlugin hooksTyped api.on(...) handlers can intercept tool calls
Always check compliance before replyingStanding OrdersInjected into every session automatically

Automations vs Heartbeat

DimensionUser-authored automationsHeartbeat monitor automation
TimingOne-shot, interval, or cron expressionScheduler-owned interval, default 30min
Session contextIsolated, current, named, or main sessionMain session, optionally isolated
Task recordsCreated for detached runsNot created for monitor turns
DeliveryChannel, webhook, or silentOwner-routed alerts or silent
Best forExplicit reports, reminders, recurring workAmbient monitoring and event follow-up

Both rely on the same Automations scheduler. For work with its own instructions or schedule, create an automation; when periodic main-session awareness is valuable, let heartbeat serve as the system-owned ambient monitor.

Core concepts

Automations

Automations function as OpenClaw's built-in scheduler for all recurring and one-shot work, heartbeat monitors included. Jobs are persisted by the scheduler, which wakes the agent at the appropriate moment and can route output to a chat channel or webhook endpoint. One-shot reminders, recurring intervals, cron expressions, and inbound webhook triggers are all supported.

See Automations.

Tasks

All detached work is recorded in the background task ledger: ACP runs, subagent spawns, isolated automation runs, and CLI operations. Tasks serve as records, not schedulers. Inspect them with openclaw tasks list and openclaw tasks audit.

See Background Tasks.

Task Flow

Above background tasks sits Task Flow, the orchestration layer for flows. It handles durable multi-step flows with managed and mirrored sync modes, revision tracking, and openclaw tasks flow list|show|cancel for inspection.

See Task Flow.

Standing orders

Standing orders provide the agent with permanent operating authority for defined programs. Stored in workspace files (typically AGENTS.md), they are injected into every session. Pair them with automations for time-based enforcement.

See Standing Orders.

Hooks

Internal hooks are event-driven scripts that respond to agent lifecycle events (/new, /reset, /stop), session compaction, gateway startup, and message flow. Hook directories are scanned for discovery, and management happens via openclaw hooks. For in-process tool-call interception, turn to Plugin hooks.

See Hooks.

Heartbeat

Heartbeat operates as a system-owned monitor automation, running a periodic main-session turn every 30 minutes by default. Small monitor-scratch context can surface items needing attention without creating a detached task record or extending session freshness. For work with its own schedule, create separate automation jobs. Empty scratch skips as empty-heartbeat-file. Scheduled monitor turns defer while the main queue or automation work is busy, another run for the same agent is active, or the target session has active or queued work.

See Heartbeat.

How they work together

  • Automations manage every recurring schedule, from reports and reminders to heartbeat monitors. Detached automation runs generate task records; main-session runs do not.
  • Heartbeat is the system-owned ambient monitor automation. Independently scheduled checks belong in their own automation jobs.
  • Hooks react to specific events (session resets, compaction, message flow) with custom scripts. Plugin hooks cover tool calls.
  • Standing orders give the agent persistent context and authority boundaries.
  • Task Flow coordinates multi-step flows above individual tasks.
  • Tasks automatically track all detached work so you can inspect and audit it.
938 words · updated Aug 28, 2026