← Blog

August 3, 2026 · 9 min read

OpenClaw cron vs heartbeat: the production rule that actually works

Use Automations for independent schedules and heartbeat for small context-aware checks. The useful distinction is not cron syntax. It is failure ownership.

Use an OpenClaw Automation when a job needs its own schedule, run history, timeout, or delivery path. Use heartbeat when one short, approximate check benefits from the main session's context. That is the current product boundary, and it is a much better rule than 'cron for exact time, heartbeat for everything else.'

The name causes confusion. People hear heartbeat and imagine a scheduler. In current OpenClaw, heartbeat is closer to a periodic glance around the room. Automations are the actual alarms. Background Tasks record detached work. Task Flow coordinates several dependent phases.

The short answer

NeedUseReason
Daily report at 9:00AutomationIndependent cadence and task record
Inbox and calendar glanceHeartbeatSmall checks can share context and one turn
One reminder in 20 minutesAutomationPrecise one-shot schedule
Three dependent research phasesTask FlowDurable phase and revision tracking
See whether detached work finishedBackground TasksThe task ledger is the audit surface
Simple uptime pingScript or monitorA model may add cost without adding judgment

If you remember one line, use this one: heartbeat notices; Automations own. The component that owns the schedule should also own the timeout, run record, and failure signal.

Why the old HEARTBEAT.md advice is stale

Older OpenClaw setups often put several natural-language schedules in HEARTBEAT.md and tracked the last run in a state file. That worked, but it mixed a monitor, scheduler, state machine, and executor in one recurring prompt. It was easy to build and hard to know when it had quietly stopped doing what you thought.

Current OpenClaw documentation treats recurring work as Automations. Heartbeat scratch is monitor context. It stays useful, but it should stay small. A heartbeat can decide that an inbox message deserves attention. It should not pretend to be the durable ledger for a weekly publishing pipeline.

A real failure: schedule state is not completion state

We learned this through a boring marketing failure. A broad portfolio heartbeat ran every five days. It marked the cycle as started, then launched a worker to research, write, validate, and deploy content across several products. If the worker timed out after that first state update, the scheduler still believed the cycle had happened.

The sites were healthy. The date filters were healthy. The content queues simply reached their last scheduled post and sat empty until the next successful refill. Two properties published through July 27, then had nothing scheduled until August 5. The missing posts were an operating-control bug, not a rendering bug.

The fix is not a more elaborate prompt. It is separate state: due, started, and completed. Only successful closeout should advance completion. A timed-out run should remain visible as failed or incomplete, and the next check should be allowed to retry safely.

Choose by failure mode, not by convenience

  1. If late execution is unacceptable, use an Automation with an explicit timezone.
  2. If the job needs a fresh context or different model, use an isolated Automation.
  3. If several tiny checks naturally belong in one conversation, batch them in heartbeat.
  4. If the work has dependent phases, use Task Flow or bounded background tasks with a durable status artifact.
  5. If the action is deterministic, frequent, and cheap to express in code, use a script and let the agent handle exceptions.

The fifth rule matters. Asking a capable model to make the same HTTP health request every five minutes is not agentic. It is expensive cron with prose around it. Let code detect the condition. Wake the agent when diagnosis or communication needs judgment.

A production checklist

  • Give every scheduled job one owner and one success definition.
  • Record started and completed separately.
  • Set a time budget that is shorter than the interval between runs.
  • Make retries safe before enabling retries.
  • Check the task record and the business artifact. A green task without the expected file, post, or message is not success.
  • Keep heartbeat quiet by default. No finding should mean no interruption.
  • Keep the Gateway online for jobs that must run while your laptop sleeps.

The practical split

Put awareness in heartbeat. Put commitments in Automations. Put multi-step execution in Task Flow or bounded tasks. Put deterministic polling in code. This split is less magical than one giant HEARTBEAT.md, which is exactly why it survives longer.

Frequently asked questions

Should recurring OpenClaw tasks go in HEARTBEAT.md?

No. Current OpenClaw guidance assigns recurring schedules to Automations. HEARTBEAT.md should contain a small monitoring checklist when one heartbeat turn should inspect those items together.

Is OpenClaw cron more reliable than heartbeat?

Automations are the better fit when timing, isolation, task history, or delivery matters. Reliability still depends on keeping the Gateway online and defining safe failure and retry behavior.

When should I use a script instead of an agent?

Use a script when the input, rule, and output are deterministic. Use the agent for interpretation, diagnosis, prioritization, or communication after the script detects something worth attention.

Sources and further reading

More posts

October 30, 2026

Your certificate renewed. Is the public hostname serving it?

October 27, 2026

Your GitHub Actions run history is not your bill

October 23, 2026

A DNS record changed. Should your OpenClaw monitor alert?

October 20, 2026

Zero errors is not always good news: checking the log pipeline before an agent alerts

October 17, 2026

A running container is not a healthy service: an OpenClaw monitoring runbook

October 14, 2026

OpenClaw database backup checks vs restore tests: what each proves

October 5, 2026

OpenClaw automation ran, but no message arrived: diagnose execution and delivery

October 2, 2026

OpenClaw SecretRefs for recurring workflows: a practical migration checklist

September 29, 2026

The scheduled blog queue ran dry: a runway check that catches it early

August 24, 2026

Agent workflow validation checklist before you reuse a template

August 21, 2026

Bounded background tasks for coding agents

August 18, 2026

Agent runbook status files that actually work

August 15, 2026

7 OpenClaw workflows worth running, and 5 that are not

August 12, 2026

The OpenClaw workflow security checklist we use before turning on tools

August 9, 2026

Your HEARTBEAT.md should be boring

August 6, 2026

How to build an OpenClaw automation that survives retries

April 30, 2026

OpenClaw just shipped real voice agent calls. Here are 5 workflows worth setting up.

March 27, 2026

The best OpenClaw skills nobody knows about

March 25, 2026

Top AI agent workflow templates for developers in 2026

March 23, 2026

OpenClaw vs n8n: when to use each for agent automation

March 20, 2026

How to automate Make.com workflows with AI agents

March 18, 2026

Best n8n workflow templates for email automation

March 15, 2026

OpenClaw starter packs: the fastest way to a useful agent

March 12, 2026

How to build your own OpenClaw runbook from scratch

March 9, 2026

5 OpenClaw workflows that save 10 hours/week