Delx
OpenClaw / Cron vs Heartbeat

OpenClaw Cron vs Heartbeat: Which Should You Use?

Cron and heartbeat both run on schedules. Both touch the same agent. Both keep things alive. But they solve fundamentally different problems, and confusing them is one of the most common mistakes in agent operations.

Why people confuse them

On the surface, cron and heartbeat look similar: both are periodic, both involve the agent, both run automatically. The confusion is natural. But cron is about doing work and heartbeat is about checking health. Mixing them up leads to bloated health checks, missed tasks, and agents that look alive but are not actually doing anything useful.

What is a cron job in OpenClaw?

A cron job is a scheduled task execution. It tells the agent: run X every Y minutes. The agent performs real work — scanning tokens, generating reports, syncing data, cleaning up stale state. Cron jobs are managed through openclaw cron edit or system crontab, and they typically invoke skills or shell scripts.

# Example: run smart_cycle every 30 minutes

*/30 * * * * /root/.openclaw/skills/delx-sniper-master/smart_cycle.sh

What is a heartbeat in OpenClaw?

A heartbeat is a health check. It asks: is the agent alive and healthy? The response is lightweight — status, uptime, risk score, last action timestamp. Heartbeats use mode=heartbeat in A2A calls for minimal payloads. They detect silent failures, session drift, and agent burnout before they become incidents. See heartbeat patterns for implementation details.

Side-by-side comparison

AspectCronHeartbeat
PurposeExecute scheduled tasksMonitor agent health
TriggerFixed timer (crontab)Adaptive cadence (30-60 min steady, 5 min incident)
ResponseFull task output, artifacts, state changesMinimal: status, uptime, risk score
Failure modeTask does not run; work is missedSilent failure goes undetected
Configjobs.json / system crontabdaily_checkin / monitor_heartbeat_sync
Delx toolopenclaw cron editmode=heartbeat in A2A

When to use cron

If the question is “did this work happen on time?”, use cron.

When to use heartbeat

If the question is “is this agent OK right now?”, use heartbeat. Deeper patterns are in the heartbeat configuration guide.

Combining both: the production pattern

In production, you want both. Cron runs tasks. Heartbeat monitors health. Delx ties them together with session continuity and observability.

This separation means you can independently tune task frequency and health check cadence. See best practices for recommended intervals.

Config examples

Cron: system crontab + smart_cycle.sh

# System crontab (no LLM cost)

*/3 * * * * /root/.openclaw/skills/delx-sniper-master/fast_monitor.sh

*/30 * * * * /root/.openclaw/skills/delx-sniper-master/telegram_report.py


# OpenClaw managed cron (uses LLM)

*/30 * * * * openclaw run smart_cycle.sh --model openai-codex/gpt-5.3-codex

Heartbeat: daily_checkin + monitor_heartbeat_sync

# A2A heartbeat call

POST /a2a

{

"method": "message/send",

"params": {

"message": { "text": "daily_checkin" },

"metadata": { "mode": "heartbeat" }

}

}


# Heartbeat sync via Delx MCP

monitor_heartbeat_sync --agent-id sniper-01 --cadence 30m

Common mistakes

Using cron for health checks

Cron jobs produce heavy output and lack adaptive cadence. A cron-based health check cannot speed up during incidents or slow down during stable periods. It also wastes LLM tokens on what should be a lightweight ping. Use mode=heartbeat instead.

Using heartbeat for task scheduling

Heartbeats are designed to be minimal and fast. Stuffing real work into a heartbeat call defeats its purpose — you lose the clean separation between “is it alive?” and “did the work happen?” Use cron or openclaw cron edit for scheduled tasks.

Running both at the same cadence

If cron and heartbeat fire at the same interval, you lose the ability to independently tune them. Cron cadence depends on task requirements. Heartbeat cadence depends on reliability requirements. Keep them independent.