OpenClaw Automation: Cron Jobs and Heartbeats

The moment your agent starts doing things without being asked is the moment it stops being a chatbot and becomes an agent. Automation is what makes the agent vs assistant distinction real โ€” a proactive AI that monitors, alerts, reports, and acts on schedule transforms your relationship with technology.

OpenClaw's automation happens through two systems: the heartbeat (built-in scheduled checks) and integration with system cron for more complex scheduling. Both are simple to set up and dramatically expand what your agent can do.

The Heartbeat System

The heartbeat is OpenClaw's native automation engine. At regular intervals, the agent "wakes up" and checks HEARTBEAT.md in your workspace for tasks to perform. Think of it as a configurable alarm clock for your agent.

How It Works

  1. The gateway fires a heartbeat at configured intervals (typically every 15-60 minutes)
  2. The agent reads HEARTBEAT.md
  3. It evaluates which tasks are due based on time and conditions
  4. It executes due tasks and logs results to daily memory
  5. If a task produces output for you, it sends it to the configured channel

Your First HEARTBEAT.md

# HEARTBEAT.md ## Core Principle Catch leverage early, ignore noise. Silence = nothing worth acting on. ## Morning Briefing - **When:** 5:30am weekdays - **Channel:** Telegram - **Tasks:** - Check today's calendar events - Review yesterday's memory for pending items - Summarize overnight work completed - Flag urgent emails or messages - Weather forecast for the day ## Evening Scan - **When:** 8:00pm daily - **Channel:** Telegram - **Tasks:** - Summarize what was accomplished today - List items that need attention tomorrow - Check for any scheduled overnight work to approve ## Health Check - **When:** Every 4 hours - **Action:** Check gateway status, channel connections, disk space - **Alert only if:** Something is wrong

Notice the principle at the top: "Silence = nothing worth acting on." This is crucial. A heartbeat that sends you a message every 15 minutes saying "Everything is fine!" defeats the purpose. The agent should only contact you when there's something worth your attention.

Common Automation Recipes

1. Morning Briefing (The Gateway Drug)

This is where most people start, and it's immediately valuable:

## Morning Briefing - **When:** 6:00am weekdays - **Channel:** Telegram (as voice message) - **Include:** - Calendar: Today's meetings with times and participants - Tasks: Open action items from yesterday - Emails: Flagged or urgent messages - Weather: Temperature and conditions - Custom: [Add anything relevant to your work]

Using the TTS skill, this can be delivered as an audio message you listen to while getting ready โ€” arguably the most pleasant way to start a workday.

2. Website Monitoring

## Website Monitor - **When:** Every 2 hours - **Check:** https://status.yourservice.com - **Alert if:** Status is not "All Systems Operational" - **Also check:** Response time > 3 seconds - **Channel:** Telegram + Slack

3. Competitive Intelligence

## Competitor Watch - **When:** 9:00am weekdays - **Do:** - Search web for "[Competitor Name] news" (past 24 hours) - Check competitor pricing page for changes - Scan competitor social media for announcements - **Report:** Only if new information found - **Save:** Findings to memory/competitive-intel.md

4. Content Pipeline

## Content Check - **When:** 10:00am Monday - **Do:** - Review content calendar for the week - Check which posts are drafted but not published - Identify gaps in the publishing schedule - Generate content brief for missing slots - **Report:** Telegram with action items

5. System Maintenance

## System Health - **When:** Every 6 hours - **Check:** - Disk space (alert if > 85% used) - Memory usage - pm2 process status - SSL certificate expiry (alert if < 14 days) - Backup status - **Alert only if:** Issues detected

๐Ÿ“– 50+ Automation Recipes in the Book

The Personal Agent Revolution includes 50+ tested automation recipes covering sales, content, monitoring, personal productivity, and team coordination.

Get the Book โ€” $29.95 โ†’

System Cron Integration

For more granular scheduling or tasks that need to run regardless of gateway state, you can use system cron:

# Edit crontab crontab -e # Morning briefing at 5:30am weekdays 30 5 * * 1-5 openclaw run "Deliver morning briefing to Telegram" # Hourly health check 0 * * * * openclaw run "Check system health, alert if issues" # Daily backup at midnight 0 0 * * * openclaw run "Backup workspace to git, commit daily changes" # Weekly report every Friday at 4pm 0 16 * * 5 openclaw run "Generate weekly summary and send to Telegram"

The openclaw run command sends a message to your agent as if you typed it. The agent processes it with full access to its personality, memory, skills, and tools.

The Overnight Work Pattern

One powerful automation pattern: queue work in the evening, let the agent execute overnight, review results in the morning.

# In AGENTS.md or a dedicated overnight-work.md ## Overnight Work Flow 1. **8pm:** Evening scan delivers findings and proposals 2. **Rudi approves:** Mark items as APPROVED 3. **Overnight:** Agent moves items to IN PROGRESS, executes 4. **5:30am:** Morning briefing reports COMPLETED items ## Current Queue ### APPROVED - Generate 7 social media posts for next week - Research top 5 VPS providers and create comparison ### IN PROGRESS [Agent moves items here during execution] ### COMPLETED [Agent moves items here when done, includes results]

This pattern is incredibly efficient. You approve a batch of work before bed. You wake up to completed deliverables. Your agent literally works while you sleep.

Automation Safety

Automated tasks respect your trust tier configuration in AGENTS.md:

This means your 3am health check can read logs and analyze errors (Tier 1), restart a crashed service (Tier 2 with notification), but won't send an email to your client about the outage (Tier 3 โ€” waits for your approval).

Debugging Automation

Check Heartbeat Logs

# View recent heartbeat activity openclaw gateway logs --filter heartbeat # Check if heartbeats are firing openclaw gateway status

Common Issues

Advanced: Chaining Automations

Individual automations are useful. Chains are powerful:

## Content Automation Chain 1. **Monday 9am:** Research trending topics (web search) 2. **Monday 10am:** Generate content briefs from research 3. **Monday-Wednesday:** Draft articles from approved briefs 4. **Thursday 9am:** Compile all drafts for review 5. **Friday:** Schedule approved content for next week

Each step depends on the previous one. The agent manages the state, tracks progress in daily memory, and only proceeds when preconditions are met.

Frequently Asked Questions

A scheduled task system. The agent checks HEARTBEAT.md at regular intervals and executes due tasks โ€” briefings, monitoring, reports, etc.
Yes. Both the native heartbeat system and system cron integration are supported. Use heartbeat for most tasks, cron for precise timing.
Morning briefings, monitoring, reports, content pipeline, backups, competitive intel, system maintenance โ€” anything you'd do manually on a schedule.
Yes. Automation respects your trust tiers. Safe operations auto-execute. Risky operations still require your approval, even during automated runs.
๐Ÿ‘จโ€๐Ÿ’ป

Rudi Ribeiro Jr.

Early OpenClaw Adopter ยท HubSpot AE ยท Author of The Personal Agent Revolution

Rudi runs a personal AI agent daily and wrote The Personal Agent Revolution based on hundreds of hours of real-world experience. He is not the creator of OpenClaw โ€” he's a power user who documented everything he learned.

๐Ÿ“– Master OpenClaw with the Book

37 chapters, 187 pages, 3 bonus resources. 50+ automation recipes included.

Get the Book โ€” $29.95 โ†’