Skip to main content
🎤 Luca Berton is speaking at Red Hat Summit & KubeCon EU 2026!Learn more →
Back to Blog

OpenClaw Heartbeats

Learn how to configure OpenClaw heartbeats for proactive monitoring — email checks, calendar alerts, weather updates, and more.

Luca BertonFebruary 18, 20262 min read

What Are Heartbeats?

Heartbeats are periodic check-ins where your OpenClaw agent wakes up and does useful background work — even when you haven't asked it anything.

How They Work

At configured intervals, OpenClaw sends a heartbeat prompt to your agent. The agent reads HEARTBEAT.md and decides what to do:

  • Something needs attention? → Send you a message
  • Nothing new? → Reply HEARTBEAT_OK and go back to sleep
Related Course

Master this topic with hands-on labs

Go beyond reading — build real projects in sandboxed environments with expert video guidance.

Browse Courses →

Configuring HEARTBEAT.md

markdown
# HEARTBEAT.md

## Checks (rotate through these)
- [ ] Check email for urgent messages
- [ ] Review calendar for upcoming events (next 24h)
- [ ] Check website uptime for copypastelearn.com
- [ ] Weather forecast if rain expected

## Rules
- Only alert for genuinely important things
- Quiet hours: 23:00 - 08:00 (don't disturb)
- If nothing important, reply HEARTBEAT_OK

Heartbeats vs Cron

OpenClaw also supports cron jobs. When to use each:

FeatureHeartbeatsCron
TimingApproximate (every ~30min)Exact (9:00 AM sharp)
ContextHas recent chat historyIsolated session
BatchingMultiple checks per beatOne task per job
ModelUses main session modelCan use different model

Rule of thumb: Use heartbeats for batched periodic checks, cron for precise schedules.

Tracking State

Use memory/heartbeat-state.json to avoid redundant checks:

json
{
  "lastChecks": {
    "email": 1703275200,
    "calendar": 1703260800,
    "weather": null
  }
}

The agent checks timestamps and skips recently-completed tasks.

Stay Updated

Get weekly IT automation tips

Docker, Ansible, Terraform, MLOps — curated insights delivered to your inbox. No spam.

Subscribe Free →

Practical Examples

Email Monitor

markdown
## Email Check
- Look for unread emails from VIP senders
- Summarize anything marked urgent
- Skip newsletters and marketing

Calendar Alert

markdown
## Calendar
- Alert 2 hours before any meeting
- Include video call links if available
- Mention if preparation is needed

Infrastructure Monitor

markdown
## Infra
- Ping copypastelearn.com
- Check SSL certificate expiry
- Alert if any service is down

Best Practices

  1. Keep HEARTBEAT.md small — it's read every interval, burning tokens
  2. Rotate checks — don't run everything every heartbeat
  3. Respect quiet hours — nobody wants 3 AM alerts
  4. Track state — avoid redundant API calls
  5. Be selective — only alert on genuinely important things

---

Ready to go deeper? Check out our hands-on course: OpenClaw Agent — practical exercises you can follow along on your own machine.

For a production-focused walkthrough, see Luca Berton's guide on agentic Ansible automation with OpenClaw.

Ready to learn by doing?

Stop reading tutorials — start building. Expert video courses with hands-on labs in real sandboxed environments.

Share this article
LB
Luca Berton

Docker Captain, IT automation expert, Red Hat Summit & KubeCon speaker. Building hands-on education for DevOps engineers at CopyPasteLearn.

Related Articles

Explore topics

Browse more articles on the topics covered here.