Automating Tasks with OpenClaw Cron Jobs
Automating Tasks with OpenClaw Cron Jobs
When building automated systems, one of the most powerful tools at your disposal is scheduled execution. In OpenClaw, that’s handled by the cron system — a robust, persistent scheduler that lets you run tasks at precise times or on recurring intervals.
Unlike periodic heartbeat checks that batch multiple awareness tasks, cron jobs are designed for exact timing, isolation, and automated delivery. They’re perfect for sending reports, running maintenance, triggering workflows, or reminding you about time-sensitive actions.
Why Use Cron Instead of Heartbeats?
OpenClaw supports two main ways to schedule work: heartbeats and cron jobs. While both can run on a schedule, they serve different purposes:
-
Heartbeats are best for routine checks — scanning your inbox, calendar, or notifications every 30 minutes in a single batched operation. They run in your main session and have full conversational context.
-
Cron jobs are ideal when you need precision: a report at exactly 9:00 AM, a reminder in 20 minutes, or a weekly analysis that runs independently of everything else.
If you need something to happen at a specific time or without affecting your main session history, cron is the right choice.
Creating Your First Cron Job
Let’s say you want to send a daily status update every morning at 7:00 AM.
Here’s how to set that up:
openclaw cron add \
--name "Morning Status" \
--cron "0 7 * * *" \
--tz "America/New_York" \
--session isolated \
--message "Summarize yesterday’s activity and today’s priorities." \
--announce \
--channel whatsapp \
--to "+15551234567"
Let’s break this down:
--cron "0 7 * * *": Standard cron syntax for “at 7:00 AM every day”--tz "America/New_York": Ensures the time is interpreted in Eastern Time--session isolated: Runs in a clean environment without polluting your main conversation--message: The prompt the agent will execute--announce: Sends a summary directly to your chosen channel--channel whatsapp: Delivers the result via WhatsApp
This job will run silently in the background, generate a summary, and deliver it to you — no manual intervention needed.
One-Shot Reminders
Sometimes you just need a reminder. You can schedule one without creating a recurring job:
openclaw cron add \
--name "Call Back" \
--at "20m" \
--session main \
--system-event "Reminder: call the client back in 10 minutes" \
--wake now \
--delete-after-run
This creates a one-time reminder that triggers in 20 minutes, sends a system event to your main session, wakes up the agent immediately, and then deletes itself.
Isolated vs Main Session Jobs
You have two options for where a cron job runs:
Isolated Sessions
Use --session isolated when you want:
- A clean slate (no prior context)
- Different model/thinking settings
- Direct delivery to a channel (
--announce) - No clutter in your main chat history
Isolated jobs are perfect for automated reports, maintenance sweeps, or anything that works independently.
Main Session Jobs
Use --session main with --system-event when you want:
- The reminder to appear in your main conversation
- The agent to process it with full context
- No separate session overhead
This is great for time-based nudges that benefit from recent context.
Controlling Output: Announce vs Silent
By default, isolated cron jobs use --announce, which means:
- The result is delivered directly to your specified channel
- A brief summary appears in your main session
- If nothing needs attention, no message is sent
If you want completely silent execution (e.g., internal logging or health checks), use --delivery none:
openclaw cron add \
--name "Health Check" \
--cron "*/30 * * * *" \
--session isolated \
--message "Run system health diagnostics" \
--delivery none
This runs every 30 minutes but never sends a message unless you explicitly ask it to.
Viewing and Managing Jobs
To see what’s scheduled:
openclaw cron list
To run a job immediately (for testing):
openclaw cron run <job-id>
To edit or delete:
openclaw cron edit <job-id> --message "Updated prompt"
openclaw cron remove <job-id>
Final Thoughts
Cron jobs unlock precision automation in OpenClaw. They let you move beyond reactive behavior to proactive, scheduled actions — all while keeping your main session clean and focused.
Whether you’re sending daily briefings, running weekly reviews, or setting one-off reminders, cron gives you the control you need to build truly autonomous systems.
Start small. Automate one thing. Then build from there.
What will you automate first?
Enjoyed this article?
Join the ClawMakers community to discuss this and more with fellow builders.
Join on Skool — It's Free →