openclaw-cron-jobs-guide
Mastering OpenClaw Cron Jobs: The Foundation of Reliable Automation
OpenClaw's cron scheduler is the backbone of its automated workflows. It's the mechanism that allows you to schedule tasks to run at specific times and intervals, from simple one-shot reminders to complex recurring background processes.
What Cron Jobs Are (and Aren't)
Think of cron as the clock inside the Gateway, not a feature of the AI. It's responsible for waking your agent at the right moment and telling it what to do. This distinction is crucial:
- Cron schedules and triggers
- The agent executes and responds
This clean separation means your schedules persist across restarts (stored in ~/.openclaw/cron/jobs.json) and are managed independently of the AI's thought process.
Execution Modes: Main vs. Isolated
Cron offers two distinct execution paths, each with its own strengths.
Main Session Jobs
These enqueue a system event that runs during the next heartbeat cycle.
{
"schedule": { "kind": "at", "at": "2026-02-18T12:00:00Z" },
"sessionTarget": "main",
"payload": {
"kind": "systemEvent",
"text": "Reminder: Review project milestones"
}
}
Best for: Tasks that need the full context of your main session, like checking your calendar or reading recent chat history.
Isolated Session Jobs
These run in their own dedicated cron:<jobId> session, completely separate from your main chat.
{
"schedule": { "kind": "cron", "expr": "0 8 * * *" },
"sessionTarget": "isolated",
"payload": {
"kind": "agentTurn",
"message": "Generate today's daily standup summary"
},
"delivery": { "mode": "announce", "channel": "slack", "to": "channel:C1234567890" }
}
Best for: Background tasks that don't need your main session context, like sending daily reports. The announce delivery mode ensures the result is posted directly to your chosen channel.
Scheduling Made Simple
OpenClaw cron supports three ways to specify when your job should run.
One-Shot: at
For a single execution at a precise time (in ISO 8601 format). Remember, if you don't specify a timezone, it's treated as UTC.
openclaw cron add --at "10m" --session main --system-event "Check on support tickets"
Recurring: every
For a task that repeats every X milliseconds.
openclaw cron add --every "30m" --session isolated --message "Monitor server health"
Flexible: cron
For the familiar 5 or 6-field cron expression syntax, perfect for daily or weekly routines.
openclaw cron add --cron "0 9 * * 1-5" --tz "America/Los_Angeles" --session isolated --message "Start weekday morning briefing"
Delivery: Getting Results Where You Need Them
An isolated job's real power comes from its delivery options:
announce: The default. Posts your result directly to a channel (Slack, WhatsApp, etc.).webhook: Sends the result as an HTTP POST to a URL, ideal for integrating with external tools.none: Keeps the result internal, perfect for silent tasks.
Pro Tips for Production
- One-shot jobs auto-delete: Perfect for reminders that shouldn't clutter your job list.
- Use job names: Makes managing and editing jobs far easier than working with IDs.
- Leverage model overrides: Run critical reports with a higher-tier model using
--model "opus". - Set
--exactfor precision: By default, cron applies a small random stagger to prevent system load spikes. Use--exactwhen you need exact timing.
Mastering cron jobs transforms OpenClaw from a reactive assistant into a proactive operational engine, automating your workflow reliably and securely.
Enjoyed this article?
Join the ClawMakers community to discuss this and more with fellow builders.
Join on Skool โ It's Free โ