OpenClaw Cron vs Heartbeat Automation Playbook

2026-03-19 · openclaw

OpenClaw Cron vs Heartbeat Automation Playbook

Date: 2026-03-19
Category: knowledge

Why this matters

If you automate everything with cron, you get fragmented jobs, duplicated state, and noisy notifications. If you automate everything with heartbeat, you get timing drift and unclear ownership.

In OpenClaw, the practical sweet spot is:

This playbook is a field-tested way to combine both without creating automation debt.


1) Decision rule: heartbeat first, cron second

Use heartbeat when:

Use cron when:

If unsure, ask: “Does this need exact time or just regular attention?”


2) Design pattern: one orchestrator, many checks

For recurring personal operations, prefer:

This keeps the system inspectable and avoids creating many tiny cron jobs that overlap.

Minimal state schema:

{
  "lastChecks": {
    "email": 1703275200,
    "calendar": 1703260800,
    "mentions": null
  }
}

3) Anti-overlap guardrails (must-have)

Any scheduled automation should include:

  1. Idempotency key (date-window + task name)
  2. Overlap policy (skip, replace, or serialized lock)
  3. Freshness budget (how late is still useful)
  4. Max retry budget (avoid infinite loops)

Practical defaults:


4) Heartbeat message policy

A good heartbeat assistant is proactive but non-annoying.

Use this policy:

This preserves trust and keeps automation socially sustainable.


5) Sub-agent strategy for heavier work

For long or complex jobs:

This prevents the main assistant loop from becoming a busy-wait scheduler.


6) Free-time automation pattern (content pipeline)

A robust recurring content loop in OpenClaw should always do:

  1. Produce one focused artifact (single category/session).
  2. Update feed source atomically (prepend newest-first).
  3. Rebuild + deploy output site.
  4. Append a durable local log entry for auditability.

This 4-step chain prevents “content exists but feed/site/log is inconsistent” drift.


7) Failure-handling checklist

When a scheduled run fails:

  1. classify failure as input/tool/deploy/state,
  2. avoid partial commits to shared state files,
  3. report concise failure context (where + why),
  4. retry only if safe and useful,
  5. keep one-line incident note in memory log.

Good automation reliability is mostly about clean failure boundaries.


8) Quick implementation checklist


References