
OpenClaw QuickStart (8): Heartbeat, Cron, and Getting Pinged at 7am
Heartbeat patrols and Cron timers — configs for daily briefings and weekly reports.
The first time I deployed OpenClaw I sat there sending it messages. After two days I realized I had built a chatbot, not an agent. The thing that made it an agent was the moment it started messaging me without being asked.
This piece is about the two ways to make that happen.

Heartbeat vs Cron — pick one in your head#

Both schedule work. They are not the same thing.
| Heartbeat | Cron | |
|---|---|---|
| Triggered by | a fixed interval (every 30 min) | a clock time (every day at 8:30) |
| Default behavior | “look around, only ping me if something matters” | “always run, always deliver” |
| Best for | catching exceptions, missed work | daily routines, scheduled reports |
| Session | latest active channel | isolated by default |
Heartbeat is the patrol officer. Cron is the kitchen timer.
In production I use both. Cron handles the 7am morning briefing and the 5pm shutdown summary. Heartbeat handles the “is there a PR I’m forgetting” patrol every 45 minutes.
Turn them on#
| |
message matters — without it the agent has no way to send anything outbound proactively.
Heartbeat — the patrol#
{
agents: {
defaults: {
heartbeat: {
every: "45m",
target: "last",
prompt: "Read HEARTBEAT.md if it exists. Follow it strictly. If nothing needs attention, reply HEARTBEAT_OK.",
activeHours: {
start: "09:00",
end: "22:00",
timezone: "Asia/Shanghai"
}
}
}
}
}
The trick is the HEARTBEAT_OK convention. You want a quiet patrol. The default prompt explicitly tells the agent to shut up unless something needs your attention. Without that line, you get pinged every 45 minutes with “everything looks fine,” which is exactly as annoying as it sounds.
Then HEARTBEAT.md carries the actual rules:
| |
Writing a good HEARTBEAT.md#
The example above is minimal. In production you need categories, priorities, and a weekend mode:
| |
The priority system is the key insight. Without it, every check becomes a ping. With it, low-priority items accumulate silently and get swept into your EOD summary via Cron. The weekend mode keeps infrastructure monitoring alive but drops the noise that can wait until Monday.
Cron — the alarm#
Two ways. CLI is the durable one (survives Gateway restarts):
| |
A one-shot delay (useful for “remind me in 20 minutes”):
| |
List and remove:
| |
Cron jobs persist to disk. Restart the Gateway, they come back.
Four patterns I actually use#
Pattern 1: Daily brief — Cron, 6:47am.
Weather, the day’s calendar, the three most-active GitHub items. The 6:47 instead of 7:00 is intentional — by the time you pick up your phone, the message is already there.
| |
What arrives at 6:47:
| |
Pattern 2: Repository watcher — Cron, hourly.
| |
Sent only if something exists. The “reply empty” instruction means no “all clear” spam.
Pattern 3: Competitor watch — Cron, daily 9pm.
| |
Example output:
| |
This one earned its keep within two weeks.
Pattern 4: End-of-day shutdown — Cron, 5:30pm.
Archives the day’s work and writes a summary to memory, closing the loop on anything the morning brief opened.
| |
The 1-5 means weekdays only. The memory write means tomorrow’s brief can reference yesterday’s unfinished items — the two jobs form a cycle.
The 3am anti-pattern#

The mistake that wakes you up: setting target: "all" on a Heartbeat without activeHours, then writing a HEARTBEAT.md that doesn’t reply HEARTBEAT_OK when nothing’s wrong.
Result: every 45 minutes, every channel you’re in lights up with “Patrolled, no anomalies.” Including at 3am. Including in group chats with people who didn’t ask for this.
Two fixes: respect activeHours, and make HEARTBEAT_OK the loud default in your rules file.
Cron job debugging#
Four failure modes I have hit personally.
Failure 1: Timezone mismatch. You write "30 7 * * *" expecting 7:30am Shanghai, but the Gateway runs in UTC. Your brief arrives at 3:30pm. Diagnose with openclaw cron list --verbose (shows next fire time in local tz). Fix: always pass --tz explicitly.
Failure 2: Output goes nowhere. The job runs (visible in logs) but no message appears. The session has no channel binding. Diagnose with openclaw cron logs --name "morning-brief" --last 3 and look for delivery: no_channel_bound. Fix: openclaw session bind --name main --channel general.
Failure 3: Missed fire during restart. Gateway restarts at the exact minute your cron fires. The job is skipped. Diagnose with openclaw cron history --name "morning-brief" --days 7 (you’ll see a gap). Fix:
| |
Don’t set the window too wide — a morning brief at noon is useless.
Failure 4: Job takes too long. A complex skill chain runs 8 minutes, hits a timeout, and you get partial output or nothing. Diagnose with openclaw cron logs --name "competitor-watch" --last 1 --full (look for timeout or context_cancelled). Fix: openclaw cron edit --name "competitor-watch" --timeout "5m". If it legitimately needs more time, simplify the prompt and offload heavy work to a background skill.
Combining Heartbeat and Cron#
The real power is when they work together as a closed-loop system:
- Morning Cron (6:47am) — generates the brief, writes today’s action items to memory.
- Heartbeat (every 45min, 9am-6pm) — checks if those action items are getting addressed. PR still un-reviewed after 3 hours? Escalate.
- Evening Cron (5:30pm) — reports what got done, flags what didn’t, writes summary to memory.
The heartbeat config ties into the morning brief’s output:
{
agents: {
defaults: {
heartbeat: {
every: "45m",
target: "last",
prompt: "Read HEARTBEAT.md. Also check if action items from today's morning brief (memory key 'today_actions') remain unaddressed >3h. If so, escalate as P1.",
activeHours: { start: "09:00", end: "18:00", timezone: "Asia/Shanghai" }
}
}
}
}
| |
This turns three independent scheduled jobs into a coherent daily workflow with accountability. If my morning brief said “Review PR #412” and by 2pm I haven’t touched it, the heartbeat nudges me. The EOD cron then records whether I followed through.
Token cost of scheduled jobs#
Scheduled jobs cost tokens. Here is the math.
Heartbeat: 13 active hours / 45min interval = ~17 calls/day. At ~800 tokens per quiet patrol (system prompt + memory + HEARTBEAT_OK): 13,600 tokens/day. On qwen-plus ($0.003/1K tokens) that is $ 0.04/day. When patrols trigger skills, they cost 3,000-8,000 tokens each. With 3 triggered patrols: total rises to ~26,200 tokens = $0.08/day.
Cron: Always heavier because they always produce output. Morning brief: 3,500 tokens. Repo watcher (8 hourly fires): 12,000. Competitor watch: 10,000. EOD summary: 4,000. Total: ~29,500 tokens = $0.09/day.
Combined: $0.15-0.20/day = $ 4.50-6.00/month on qwen-plus. On gpt-4o or claude-sonnet, multiply by 5-8x.
Recommendation: Keep heartbeat prompts short — the system prompt and HEARTBEAT.md load on every single patrol, so every extra line costs 17x per day. Use cron for heavy lifting (complex skills, long summaries) because those run once. If your heartbeat costs more than your cron, you have the division of labor backwards.
Summary#
The whole point of OpenClaw is the agent comes to you. Heartbeat and Cron are the two doors that make it possible. Use Cron for things that should happen on a schedule no matter what; use Heartbeat for things you want noticed only when they break. Don’t mix them up.
OpenClaw QuickStart 10 parts
- 01 OpenClaw QuickStart (1): What This Thing Actually Is
- 02 OpenClaw QuickStart (2): Install and First Chat in 10 Minutes
- 03 OpenClaw QuickStart (3): The Six Layers That Make the Agent Loop Work
- 04 OpenClaw QuickStart (4): Configuration, Model Providers, and the Coding Plan Trick
- 05 OpenClaw QuickStart (5): Wiring Telegram, DingTalk, and the WeChat Reality
- 06 OpenClaw QuickStart (6): Skills, MCP, and Shipping Something Real
- 07 OpenClaw QuickStart (7): The Memory System, Without the Magic
- 08 OpenClaw QuickStart (8): Heartbeat, Cron, and Getting Pinged at 7am you are here
- 09 OpenClaw QuickStart (9): The China IM Picker, with Honest Tradeoffs
- 10 OpenClaw QuickStart (10): Production Deploy and the Failure Modes Nobody Warns You About