Skip to content

Master OpenClaw Automation: Choose the Right Mechanism

Managing agents manually is a drag. You want your tools to work for you while you sleep, whether that’s checking your email or running a report every Monday. OpenClaw gives you several ways to automate these tasks, but it isn’t always obvious which one to pick.

This guide breaks down the different automation styles so you can get your setup running without the guesswork.

flowchart TD
A{Run on a schedule?} -->|Yes| B{Exact timing needed?}
A -->|No| C{React to events?}
B -->|Yes| D[Cron]
B -->|No| E[Heartbeat]
C -->|Yes| F[Hooks]
C -->|No| G[Standing Orders]
MechanismWhat it doesRuns inCreates task record
HeartbeatPeriodic main-session turn — batches multiple checksMain sessionNo
CronScheduled jobs with precise timingMain or isolated sessionYes (all types)
Background TasksTracks detached work (cron, ACP, subagents, CLI)N/A (ledger)N/A
HooksEvent-driven scripts triggered by agent lifecycle eventsHook runnerNo
Standing OrdersPersistent instructions injected into the system promptMain sessionNo
WebhooksReceive inbound HTTP events and route to the agentGateway HTTPNo
MechanismWhat it does
Gmail PubSubReal-time Gmail notifications via Google PubSub
PollingPeriodic data source checks (RSS, APIs, etc.)
Auth MonitoringCredential health and expiry alerts

Most effective setups use a mix of these tools. Here is how they usually fit into a workflow:

  1. Heartbeat handles routine monitoring (inbox, calendar, notifications) in one batched turn every 30 minutes.
  2. Cron handles precise schedules (daily reports, weekly reviews) and one-shot reminders.
  3. Hooks react to specific events (tool calls, session resets, compaction) with custom scripts.
  4. Standing Orders give the agent persistent context (“always check the project board before replying”).
  5. Background Tasks automatically track all detached work so you can inspect and audit it.

See Cron vs Heartbeat for a detailed comparison of the two scheduling mechanisms.

Older release notes and docs may mention ClawFlow or openclaw flows, but the current CLI surface in this repo is openclaw tasks.

See Background Tasks for the supported task ledger commands, plus ClawFlow and CLI: flows for compatibility notes.

If you are ready to start building, I recommend checking out the Cron vs Heartbeat guide first. It helps you decide how to handle your recurring tasks. You can also look at Background Tasks to see how to manage your work once it is running.

AI Setup Assistant

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.