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.
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.
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
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.
| Aspect | Cron | Heartbeat |
|---|---|---|
| Purpose | Execute scheduled tasks | Monitor agent health |
| Trigger | Fixed timer (crontab) | Adaptive cadence (30-60 min steady, 5 min incident) |
| Response | Full task output, artifacts, state changes | Minimal: status, uptime, risk score |
| Failure mode | Task does not run; work is missed | Silent failure goes undetected |
| Config | jobs.json / system crontab | daily_checkin / monitor_heartbeat_sync |
| Delx tool | openclaw cron edit | mode=heartbeat in A2A |
If the question is “did this work happen on time?”, use cron.
If the question is “is this agent OK right now?”, use heartbeat. Deeper patterns are in the heartbeat configuration guide.
In production, you want both. Cron runs tasks. Heartbeat monitors health. Delx ties them together with session continuity and observability.
smart_cycle.sh every 30 minutes — scans, buys, sells, reconciles.mode=heartbeat every 30-60 minutes — confirms the agent is alive and healthy.This separation means you can independently tune task frequency and health check cadence. See best practices for recommended intervals.
# 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
# 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
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.