Dashboard/Human Track/Automation & Workflows
βš™οΈHuman Track

Automation & Workflows

Build automated check-ins, scheduled tasks, multi-agent pipelines, and end-to-end workflows

Learning Objectives

  • Set up HEARTBEAT.md for periodic AI check-ins
  • Build cron jobs that run on precise schedules
  • Delegate complex tasks to sub-agents using multi-agent orchestration
  • Design end-to-end workflows that combine heartbeat, cron, and multi-agent capabilities
1

Automated Check-ins (HEARTBEAT.md)

Your AI does not need to wait for you to ask. With HEARTBEAT.md, it checks in on you automatically β€” like a personal assistant who scans your inbox, calendar, and weather every 30 minutes.

How it works:
HEARTBEAT.md is a file in your workspace that lists what your AI should check periodically. Every ~30 minutes, OpenClaw reads this file and your AI performs the listed tasks.

Example HEARTBEAT.md:

# HEARTBEAT.md
- Check my email for any urgent messages
- Look at my calendar for upcoming events in the next 2 hours
- If it’s before 9am, check the weather for my location

HEARTBEAT vs Cron Jobs β€” when to use each:
- Heartbeat = periodic patrol. Multiple checks bundled together. Timing can drift. Best for "check a few things every so often."
- Cron = precise schedule. "At 9:00 AM every Monday, send me a weekly summary." Exact timing. One specific task.

Most users start with Heartbeat for general awareness, then add Cron jobs for specific scheduled tasks.

Cost note: Every heartbeat uses API tokens. Keep your HEARTBEAT.md focused β€” 3-5 items max. An empty HEARTBEAT.md means no automatic checks (and no extra cost).

Key Principle

HEARTBEAT.md turns your AI from reactive to proactive. Instead of waiting for you to ask, it checks in on you. Start small β€” one task β€” and build up.

Step-by-Step Instructions

Step 1: Create HEARTBEAT.md
In ~/.openclaw/workspace/, create HEARTBEAT.md.

Step 2: Add one simple task
Start with just one item:

# HEARTBEAT.md
- Check the weather for my location and tell me if I need an umbrella

Step 3: Wait for it
Within 30 minutes, your AI should proactively send you a weather update β€” without you asking.

Step 4: Add more tasks
Once you see it working, add 2-3 more checks that matter to you. Keep it under 5 items total.

Common Mistakes

  • ❌ HEARTBEAT.md is empty or only has comments β€” An empty file means no checks. Add at least one real task.
  • ❌ Too many tasks β€” Each heartbeat costs tokens. 3-5 focused tasks is the sweet spot. 20 tasks will burn through your API credits fast.
  • ❌ Expecting instant results β€” Heartbeats run every ~30 minutes, not instantly. Be patient after creating the file.
2

Scheduled Automation (Cron Jobs)

Heartbeat is a periodic patrol β€” "check a few things every 30 minutes." Cron jobs are precise scheduled tasks β€” "at exactly 9:00 AM every Monday, send me a weekly summary."

When to use Cron over Heartbeat:
- Exact timing matters ("remind me at 3pm")
- One-shot reminders ("in 20 minutes, tell me to check the oven")
- Weekly/daily reports on a schedule
- Tasks that need a specific model or isolation

Examples:
- /cron add every Monday 9am: Send me a summary of this week’s priorities
- /cron add in 25 minutes: Remind me to take the pizza out of the oven
- /cron add daily 8pm: Check my GitHub notifications and summarize

Cron jobs run in isolated sessions β€” they don’t pollute your main chat history. They can use different models (use a cheaper model for simple reminders). And they fire at exact times, not approximately.

Key Principle

Cron jobs give your AI a calendar. Heartbeats give it curiosity. Use heartbeats for periodic awareness, cron jobs for precise schedules. Together, your AI never misses anything.

Step-by-Step Instructions

Step 1: Create a quick test reminder
Ask your AI: "Set a reminder in 5 minutes to tell me to stretch and take a break."

Step 2: Wait for it
In exactly 5 minutes, your AI should message you with the reminder.

Step 3: Create a recurring job
Ask: "Create a daily cron job at 8:00 AM that checks the weather for my location."

Step 4: Verify it works
The next morning at 8:00 AM, you should receive a weather update without asking.

Common Mistakes

  • ❌ Cron time is in UTC β€” If you set a cron for "9am" but your timezone isn’t configured, it might fire at the wrong time. Make sure your timezone is set in USER.md.
  • ❌ Too many cron jobs β€” Each cron job costs API tokens when it fires. Start with 2-3 and add more as needed.
  • ❌ Confusing cron with heartbeat β€” Use heartbeat for "check these things periodically." Use cron for "do this exact thing at this exact time."
3

Multi-Agent Delegation

One AI doing everything is slow. OpenClaw supports multi-agent orchestration β€” your main agent breaks tasks into pieces and delegates them to specialist sub-agents that work in parallel.

How it works:
Your main agent is the orchestrator (the CEO). When it receives a complex task, it can spawn sub-agents (the team) to handle specific pieces. The coding-agent skill makes this seamless for development tasks.

Example:
You say: "Build me a Python script that fetches Bitcoin prices"
Your main agent: Spawns a coding sub-agent β†’ gives it the spec β†’ sub-agent writes the code β†’ main agent reviews and delivers the result

Why this matters:
- Complex tasks get broken into manageable pieces
- Sub-agents can use different models (cheaper for simple tasks)
- Multiple sub-agents can work in parallel
- Your main agent stays free to handle your messages

The key insight: You are building an AI operating system, not using a chatbot. The main agent orchestrates. Sub-agents execute. Your job is to set the goals.

Key Principle

You are building an AI operating system, not using a chatbot. The main agent orchestrates. Sub-agents execute. Your job is to set the goals.

Step-by-Step Instructions

Step 1: Verify coding-agent is installed
It should already be there (it’s an essential skill). Check:

ls ~/.openclaw/workspace/skills/ | grep coding

Step 2: Give your AI a complex task
Ask: "Create a Python script that fetches the current Bitcoin price from CoinGecko API and prints it formatted as USD."

Step 3: Watch the delegation
Your AI should spawn a sub-agent to write the code. You’ll see it in the logs.

Step 4: Review the result
Your main agent delivers the finished script. Check if it works.

4

Workflow Design

Heartbeat checks things periodically. Cron fires tasks on schedule. Multi-agent delegates work to specialists. Workflow design is combining all three into end-to-end automated pipelines.

A workflow is a chain: trigger β†’ process β†’ deliver.

Example 1 β€” Morning Briefing Workflow:
- Trigger: Cron job at 7:30 AM daily
- Process: Main agent spawns 3 sub-agents in parallel:
- Sub-agent 1: Check email for urgent items (uses Himalaya skill)
- Sub-agent 2: Check calendar for today’s events (uses calendar skill)
- Sub-agent 3: Check weather and news (uses agent-browser)
- Deliver: Main agent synthesizes all results into a single briefing, sends to WhatsApp

Example 2 β€” Code Review Pipeline:
- Trigger: Heartbeat detects new PR on GitHub
- Process: Main agent spawns coding-agent to review the diff
- Deliver: Review comments posted directly on the PR

Example 3 β€” Content Publishing Workflow:
- Trigger: You say "publish this draft"
- Process: Main agent orchestrates:
- Sub-agent 1: Proofread and format
- Sub-agent 2: Generate social media posts
- Sub-agent 3: Schedule distribution
- Deliver: Content published, social posts queued

Designing your own workflows:

  • β€’Identify the trigger β€” What starts this workflow? A time (cron), a condition (heartbeat), or a command (you)?
  • β€’Map the process β€” What steps need to happen? Which can run in parallel? Which need sub-agents?
  • β€’Define the delivery β€” Where does the result go? WhatsApp? Email? A file? A PR comment?
  • β€’Set failure handling β€” What happens if a sub-agent fails? Retry? Skip? Alert you?

Start simple. Your first workflow should have one trigger, one process step, and one delivery channel. Add complexity only after the simple version works reliably.

Key Principle

Workflows combine triggers (cron/heartbeat), processing (sub-agents), and delivery (channels) into automated pipelines. Start simple: one trigger, one step, one output. Complexity comes later.

Step-by-Step Instructions

Step 1: Design a simple workflow on paper
Pick a real task you do repeatedly. Map it: trigger β†’ process β†’ deliver.

Step 2: Implement the trigger
If it’s time-based, create a cron job. If it’s condition-based, add it to HEARTBEAT.md.

Step 3: Build the process
Tell your AI what to do when the trigger fires. If it needs sub-agents, make sure the relevant skills are installed.

Step 4: Test end-to-end
Trigger the workflow manually first. Watch every step. Fix any failures. Then let it run automatically.

Step 5: Document your workflow
Add a description to AGENTS.md so your AI remembers how the workflow works across sessions.

Common Mistakes

  • ❌ Too complex too soon β€” Start with a 1-step workflow. Don’t build a 5-step pipeline on day one.
  • ❌ No failure handling β€” What if the email check fails? What if the sub-agent times out? Always define what happens when things go wrong.
  • ❌ Undocumented workflows β€” If it’s not in AGENTS.md, your AI will forget it next session. Document every workflow.

Recommended Skills

Coding AgentEssential

Delegate coding tasks to background AI agents for parallel execution

clawhub install coding-agent

Category Assessment

Your AI proactively sends you check-in messages (heartbeat working). You have a cron job running on a schedule (automation working). Your AI can delegate a coding task to a sub-agent (multi-agent working). And you have designed at least one end-to-end workflow combining these capabilities.