OpenClaw Heartbeat Scheduler: Always-On AI Agent
HEARTBEAT.md defines periodic tasks your OpenClaw agent runs on a schedule — from morning briefings to system health checks to end-of-day summaries. It turns your agent from a reactive assistant into a proactive one that monitors, reports, and acts without being asked. Think of it as your agent's cron job system.
The OpenClaw Heartbeat scheduler wakes your AI agent at configurable intervals for proactive, unprompted execution. Configured via a plain markdown file called HEARTBEAT.md in your workspace directory, it transforms OpenClaw from a reactive chatbot into a persistent, always-on agent that checks messages, runs scheduled tasks, monitors systems, and performs maintenance — even when you are not actively using it. This is the key innovation that solved the "persistence problem" that killed predecessor AI agents.
The Heartbeat is what makes OpenClaw truly autonomous. Combined with SOUL.md, MEMORY.md, and AGENTS.md, it creates an AI agent that works for you around the clock.
What Is the Heartbeat Scheduler?
The Heartbeat is OpenClaw's built-in scheduling system that gives your AI agent a pulse — regular wake cycles where it proactively checks for work and takes action.
Configurable Wake Intervals
Set your agent to wake every minute, every hour, or on any custom schedule. Fine-tune timing per task for optimal resource usage.
Proactive Execution
Your agent does not wait for prompts. It autonomously checks inboxes, processes queues, runs reports, and handles tasks on its own schedule.
Plain Markdown Config
All configuration lives in a single HEARTBEAT.md file. No database, no YAML, no JSON schemas. Just readable markdown in your workspace.
Why the Heartbeat Changes Everything
Before OpenClaw, AI agents like AutoGPT suffered from the "persistence problem" — they could only respond when a user sent a message. Once the session ended, the agent went silent. OpenClaw solved this with the Heartbeat scheduler combined with messaging platform accessibility (WhatsApp, Telegram, email). The agent stays alive, keeps working, and reaches you wherever you are. This is why OpenClaw is the first AI agent to achieve true persistence and accessibility, and a major reason it has earned over 200,000 GitHub stars. OpenClaw is free, MIT-licensed, and created by Peter Steinberger.
How the Heartbeat Works
The Heartbeat follows a simple cycle: sleep, wake, execute tasks, sleep again. Here is how each cycle unfolds.
Step 1: Timer Triggers Wake
AutomaticThe configured interval elapses (e.g., 5 minutes since last cycle). OpenClaw activates the agent for a new heartbeat cycle.
Step 2: Agent Reads HEARTBEAT.md
InstantThe agent loads your HEARTBEAT.md file to understand what tasks to perform, in what order, and under what conditions.
Step 3: Agent Scans for Work
VariesBased on the instructions, the agent checks inboxes, monitors systems, reviews queues, and evaluates whether any action is needed.
Step 4: Agent Executes Tasks
VariesIf work is found, the agent takes action: drafts replies, sends alerts, updates records, generates reports, or performs any configured task.
Step 5: Agent Sleeps Until Next Cycle
AutomaticOnce all tasks are complete (or if nothing needed attention), the agent goes back to sleep until the next heartbeat interval.
Copy-Paste HEARTBEAT.md Templates
These ready-to-use templates cover the three most common Heartbeat use cases. Copy, customize the placeholders, and drop into your workspace directory.
Template 1: Morning Briefing
Check email, weather, calendar, and news — generate a daily summary by 8 AM.
# Heartbeat Configuration — Morning Briefing Agent
## Schedule
- Wake every **5 minutes** from 7:30 AM to 9:00 AM
- Outside of briefing window: wake every **60 minutes** for urgent messages only
## Morning Briefing Tasks (Run at 7:50 AM daily)
### 1. Check Email
- Scan inbox for unread messages since last briefing
- Flag urgent items (keywords: urgent, ASAP, deadline, client)
- Draft replies for time-sensitive messages
### 2. Check Weather
- Fetch today's weather forecast for the user's location
- Note any travel-disrupting conditions
### 3. Check Calendar
- Review today's appointments and meetings
- Confirm all meeting links are present
- Flag back-to-back conflicts
### 4. Check News
- Scan configured news sources for industry headlines
- Filter by relevance to user's business topics
### 5. Generate Summary
- Compile all findings into a concise morning briefing
- Send summary to user via WhatsApp by 8:00 AM
- Format: bullet points, priority order, action items first
## Quiet Hours
- Do not run briefing tasks between 9 PM and 7:30 AM
- Urgent message check only during quiet hoursTemplate 2: Business Monitor
Check CRM pipeline, support tickets, and sales metrics — send a daily report to your team.
# Heartbeat Configuration — Business Monitor Agent
## Schedule
- Wake every **15 minutes** during business hours (8 AM - 7 PM)
- Wake every **60 minutes** outside business hours
## Priority 1: CRM Pipeline (Every Cycle)
- Check for new leads in GoHighLevel/HubSpot
- Review deals that have been inactive for more than 48 hours
- Flag any hot leads that need immediate follow-up
- Update pipeline stage based on latest activity
## Priority 2: Support Tickets (Every 2nd Cycle)
- Check for new support tickets or unresolved issues
- Escalate tickets open longer than 4 hours without response
- Summarize ticket volume and category trends
## Priority 3: Sales Metrics (Every 3rd Cycle)
- Pull daily revenue figures from payment processor
- Compare against daily target
- Flag if revenue is more than 20% below target
## Daily Report (Sent at 6:00 PM)
- Compile full day summary: leads, pipeline, revenue, tickets
- Compare to same day last week
- Send report to owner via WhatsApp and email
- Save report to ./reports/YYYY-MM-DD.md
## Error Handling
- If CRM API fails, retry after 5 minutes
- If 3 consecutive failures, alert owner immediately
- Log all failures to ./logs/heartbeat-errors.mdTemplate 3: Developer Watch
Check CI/CD status, error logs, and PR reviews — notify the team of failures immediately.
# Heartbeat Configuration — Developer Watch Agent
## Schedule
- Wake every **5 minutes** during active development (9 AM - 6 PM)
- Wake every **30 minutes** off-hours
## Priority 1: CI/CD Status (Every Cycle)
- Check GitHub Actions / CircleCI for running pipelines
- Alert immediately if any build fails on main or staging branch
- Notify assigned developer via Slack DM on failure
## Priority 2: Error Log Monitoring (Every Cycle)
- Scan application error logs for new critical errors
- Group errors by type and frequency
- Alert if error rate exceeds threshold (>10 errors/minute)
## Priority 3: PR Reviews (Every 2nd Cycle)
- Check for pull requests awaiting review for more than 2 hours
- Identify reviewers who have been assigned
- Send Slack reminder to reviewers if PR is blocked
## Priority 4: Deployment Status (Every 3rd Cycle)
- Verify latest deployment is healthy
- Check uptime monitoring for anomalies
- Confirm all health check endpoints return 200
## Daily Dev Summary (Sent at 5:45 PM)
- Builds: passed / failed count
- PRs opened, merged, and awaiting review
- Error rate trends
- Send to #dev-updates Slack channel
## Quiet Hours
- Off-hours: only alert on production outages (P0 only)Use Cases for Proactive Execution
The Heartbeat enables your agent to handle these tasks autonomously, without waiting for a prompt.
Message Monitoring
Check email, WhatsApp, Slack, and other channels for new messages. Draft replies, flag urgent items, and route conversations to the right people.
Recommended: Every 1-5 minutesSystem Monitoring
Watch server health, uptime status, error logs, and performance metrics. Alert you immediately when something requires attention.
Recommended: Every 5-15 minutesData Synchronization
Keep your CRM, spreadsheets, project management tools, and databases in sync. Reconcile records and resolve conflicts automatically.
Recommended: Every 15-60 minutesScheduled Reports
Generate daily sales summaries, weekly project updates, or monthly analytics reports. Deliver them to the right channels at the right time.
Recommended: Every 1-24 hoursFollow-Up Automation
Check if leads need follow-ups, send reminders for overdue tasks, nudge stalled conversations, and keep pipelines moving.
Recommended: Every 30-60 minutesSecurity & Compliance
Scan for unauthorized access attempts, verify backups completed, check certificate expiration dates, and audit permission changes.
Recommended: Every 1-6 hoursHeartbeat Best Practices
Follow these guidelines to get the most from your agent's always-on capabilities.
Start with longer intervals
Begin with 30-60 minute intervals and shorten them as you understand your agent's workload. This prevents unnecessary resource consumption while you tune the system.
Prioritize tasks within each cycle
List tasks in order of importance in your HEARTBEAT.md. If a wake cycle runs long, the agent handles critical items first and defers lower-priority work to the next cycle.
Use conditional logic
Instruct the agent to skip certain checks based on time of day or day of week. For example, skip Slack monitoring outside business hours or increase email check frequency during product launches.
Monitor resource usage
Each heartbeat cycle uses API calls and compute time. Track your usage and adjust intervals to balance responsiveness with cost efficiency.
Combine with SOUL.md and MEMORY.md
The Heartbeat works best when paired with a well-defined SOUL.md (personality and rules) and MEMORY.md (persistent context). Together, these three files create a fully autonomous agent.
Log heartbeat activity
Include a logging directive in your HEARTBEAT.md so the agent records what it did on each wake cycle. This makes debugging easier and helps you optimize the schedule over time.
The Heartbeat in Context
HEARTBEAT.md works alongside OpenClaw's other configuration files to create a fully autonomous agent.
SOUL.md
Defines who the agent is
Personality, rules, boundaries, and decision-making guidelines. The Heartbeat tells the agent when to act; SOUL.md tells it how to act.
Read the guideMEMORY.md
Stores what the agent knows
Persistent context, conversation history, learned preferences, and accumulated knowledge. The Heartbeat can read and update MEMORY.md on each cycle.
Read the guideAGENTS.md
Coordinates multiple agents
Multi-agent orchestration and delegation rules. The Heartbeat can wake specific sub-agents for specialized tasks within a cycle.
Read the guideHEARTBEAT.md
Controls when the agent acts
The scheduling backbone that transforms a passive chatbot into a persistent, proactive assistant. Without it, the agent only responds when prompted.
Read the guideOpenClaw Heartbeat FAQ
Configure Your Always-On Agent This Week
The 20-minute workshop includes done-for-you HEARTBEAT.md templates, step-by-step configuration, and best practices for persistent AI automation. One payment, no subscriptions, 30-day guarantee.
Get the Automation Playbook (Free)
One deploy-ready automation every week. Same strategies our clients pay thousands for. 400+ business owners already inside.
Need it done for you?
Book a Free Strategy Call See what we've built for real businesses →Related OpenClaw Configuration Guides
OpenClaw .md Files Hub
Overview of all OpenClaw configuration files and how they work together.
MEMORY.md Guide
Configure persistent memory so your agent retains context across Heartbeat cycles.
BOOTSTRAP.md Guide
Set up one-time initialization tasks that run before your agent's first Heartbeat cycle.
AGENTS.md Guide
Orchestrate multiple agents, each with their own Heartbeat schedules and task queues.