Your AI agent is powerful. But if you have to manually tell it what to do every single time, you are leaving 80% of the value on the table. OpenClaw cron jobs let your agent run tasks on autopilot: morning briefings, weekly reports, social media scheduling, git backups. Set it once, forget it, let the agent work while you sleep.
In This Guide
What Are OpenClaw Cron Jobs
Cron is the Gateway's built-in scheduler. It lives inside the OpenClaw Gateway process, persists jobs to disk under ~/.openclaw/cron/, and survives restarts. No external service. No third-party integration. Just your agent, running tasks on a schedule you define.
Think of it as: when to run + what to do.
You tell your agent "check my email every morning at 7 AM" and it creates a cron job. That job fires every day at 7:00, spins up a session, does the work, and optionally sends you the result on Telegram, Discord, or wherever you are connected.
No code required. You can create cron jobs by just chatting with your agent: "Remind me to review my content calendar every Monday at 9 AM." OpenClaw handles the scheduling syntax internally.
Three Schedule Types: At, Every, Cron
OpenClaw supports three distinct schedule kinds. Each fits a different use case.
1. At (One-Shot)
Runs once at a specific time, then auto-deletes. Perfect for reminders.
openclaw cron add \
--name "Reminder" \
--at "2026-03-15T09:00:00+08:00" \
--session main \
--system-event "Reminder: review sponsor proposals" \
--wake now \
--delete-after-run
Timestamps without a timezone default to UTC. Always include your offset if you care about the exact local time.
2. Every (Fixed Interval)
Runs at a fixed interval in milliseconds. Good for polling tasks.
openclaw cron add \
--name "Check inbox" \
--every 1800000 \
--session isolated \
--message "Check for urgent unread emails and summarize."
That is every 30 minutes (1,800,000 ms). The CLI also accepts human-readable durations like 30m.
3. Cron (Standard Expressions)
The classic 5-field cron syntax. Most flexible option for recurring schedules.
openclaw cron add \
--name "Morning brief" \
--cron "0 7 * * *" \
--tz "Asia/Singapore" \
--session isolated \
--message "Summarize overnight updates. Check calendar for today." \
--announce
Supports 5-field and 6-field (with seconds) expressions. If you omit the timezone, it uses the Gateway host's local time.
Pro tip: OpenClaw applies a deterministic stagger window of up to 5 minutes for top-of-hour expressions like 0 * * * * to prevent load spikes. Use --exact to force precise timing when it matters.
Main vs Isolated Sessions
This is the decision that trips most people up. Every cron job runs in one of two modes.
Main Session
Injects a system event into your main chat session. The agent sees it during the next heartbeat and responds in your normal conversation thread.
- Uses
sessionTarget: "main"withpayload.kind: "systemEvent" - Best for: reminders, nudges, anything that needs your conversation context
- The event appears in your chat history
Isolated Session
Spins up a completely separate session under cron:<jobId>. Fresh context every run. No conversation carry-over.
- Uses
sessionTarget: "isolated"withpayload.kind: "agentTurn" - Best for: background chores, research tasks, content generation, anything noisy
- By default, announces a summary back to your chat when done
- Supports
delivery.mode:announce(default),webhook, ornone
Rule: Main session requires systemEvent payload. Isolated requires agentTurn. Mix them up and the job will fail silently.
Setting Up Your First Cron Job
The fastest way? Just tell your agent what you want. In your Telegram or Discord chat:
"Set up a cron job to check my email every morning at 8 AM and send me a summary."
Your agent will call the cron tool internally and create the job. Done.
If you prefer the CLI, here is the exact command:
openclaw cron add \
--name "Email digest" \
--cron "0 8 * * *" \
--tz "Asia/Singapore" \
--session isolated \
--message "Check Gmail for unread emails. Summarize anything urgent." \
--announce
Verify it exists:
openclaw cron list
Test it immediately without waiting for the schedule:
openclaw cron run <job-id>
Check run history:
openclaw cron runs --id <job-id>
7 Real Automation Examples
These are actual cron jobs you can copy and adapt for your own setup.
1. Morning Briefing (Daily, 7 AM)
openclaw cron add \
--name "Morning brief" \
--cron "0 7 * * *" \
--tz "Asia/Singapore" \
--session isolated \
--message "Check email, calendar for today, and any pending tasks. Send me a morning briefing." \
--announce
2. Weekly Content Report (Mondays, 9 AM)
openclaw cron add \
--name "Weekly report" \
--cron "0 9 * * 1" \
--tz "Asia/Singapore" \
--session isolated \
--message "Generate a weekly report: YouTube views, new subscribers, top tweets, newsletter signups. Compare to last week." \
--announce
3. Social Media Scheduling (3x Daily)
openclaw cron add \
--name "Post to X" \
--cron "0 9,13,18 * * *" \
--tz "Asia/Singapore" \
--session isolated \
--message "Pick the next scheduled draft and post it. Confirm with the post URL." \
--announce
4. SEO Article Publisher (Twice Daily)
openclaw cron add \
--name "SEO article" \
--cron "0 9,21 * * *" \
--tz "Asia/Singapore" \
--session isolated \
--message "Write and publish the next pending SEO article from the keyword queue." \
--announce
5. One-Shot Reminder
Just tell your agent: "Remind me in 20 minutes to call the sponsor back." It creates an at job that fires once and self-deletes. No CLI needed.
6. Git Backup (Every 6 Hours)
openclaw cron add \
--name "Git backup" \
--cron "0 */6 * * *" \
--session isolated \
--message "Commit any uncommitted changes in the workspace and push to GitHub." \
--delivery none
7. Health Check (Daily, 6 AM)
openclaw cron add \
--name "Health check" \
--cron "0 6 * * *" \
--session isolated \
--message "Run a system health check. Disk space, memory usage, open ports, failed services. Alert me if anything is off." \
--announce
8. Competitor Monitoring (Weekly, Wednesday 10 AM)
openclaw cron add \
--name "Competitor check" \
--cron "0 10 * * 3" \
--tz "Asia/Singapore" \
--session isolated \
--message "Search for recent blog posts, product updates, and social mentions for [competitor names]. Summarize anything noteworthy." \
--announce
9. Newsletter Draft (Every Thursday at 3 PM)
openclaw cron add \
--name "Newsletter draft" \
--cron "0 15 * * 4" \
--tz "Asia/Singapore" \
--session isolated \
--message "Read research/newsletter-queue.md. Pick the top 5 stories by relevance score. Draft the newsletter using the template in templates/newsletter.md. Push to Beehiiv as draft." \
--announce
10. Workspace Cleanup (Monthly, First Sunday at 2 AM)
openclaw cron add \
--name "Workspace cleanup" \
--cron "0 2 1-7 * 0" \
--session isolated \
--message "Archive memory files older than 60 days. Remove temp files. Check disk space. Report what was cleaned up." \
--delivery none
Cost control: Each isolated cron job run costs API tokens. For routine jobs, set a cheaper model override with --model to keep costs down. Save your expensive model for high-value tasks.
Scheduling Patterns Worth Knowing
Cron expressions can be confusing. Here are the patterns I use most often:
| Pattern | Expression | What It Means |
|---|---|---|
| Every weekday at 9 AM | 0 9 * * 1-5 | Monday through Friday only |
| Twice daily | 0 9,18 * * * | 9 AM and 6 PM |
| Every 4 hours | 0 */4 * * * | Midnight, 4 AM, 8 AM, noon, 4 PM, 8 PM |
| First Monday of month | 0 9 1-7 * 1 | First Monday, 9 AM |
| Every 15 minutes | */15 * * * * | Careful with this. Expensive if using cloud APIs. |
The 5-field format is: minute, hour, day-of-month, month, day-of-week. OpenClaw also supports 6-field format where the first field is seconds, but you rarely need second-level precision for agent tasks.
Monitoring Cron Job Performance
Once you have 5+ cron jobs running, you need to track their performance. Here is how:
- Run history:
openclaw cron runs --id <job-id>shows timestamps, duration, and status for past runs. Check this weekly to catch silent failures. - Cost tracking: Each cron run consumes API tokens. Track your monthly spend per job. If your "check email" cron costs more than your "weekly report" cron, something is wrong. The email check should be a quick scan, not a deep analysis.
- Overlap prevention: If a cron job takes longer than its interval, OpenClaw skips the next run. For example, if your 30-minute email check takes 45 minutes, it will not stack another run on top. But this is a signal that the task is too broad. Break it into smaller, focused jobs.
- Failure notifications: Set up a meta-cron that checks other cron jobs for failures. Or just add a daily heartbeat check that reviews
openclaw cron runsoutput and alerts you to any errors.
Cron Jobs vs Heartbeats
OpenClaw has two scheduling mechanisms. Knowing when to use each saves you headaches.
| Cron Jobs | Heartbeats | |
|---|---|---|
| Timing | Exact ("9:00 AM sharp") | Approximate (~30 min intervals) |
| Context | Fresh per run (isolated) or main session | Full main session history |
| Best for | Precise schedules, standalone tasks | Batched checks, context-aware actions |
| Model override | Yes, per job | Uses main session model |
| Delivery | Announce, webhook, or silent | Replies in main chat |
Use cron when: exact timing matters, the task needs isolation, or you want a specific model for cost control.
Use heartbeats when: you want to batch multiple checks together, timing can drift, or the task needs your conversation context.
Most setups use both. Heartbeats for inbox and calendar monitoring. Cron for precise scheduled tasks like content publishing and weekly reports.
Debugging Failed Cron Jobs
Jobs not firing? Here is a checklist.
Check If the Job Exists
openclaw cron list
If your job is not listed, it was never created or was auto-deleted after a one-shot run.
Check Run History
openclaw cron runs --id <job-id>
This shows past runs with timestamps and status. Look for errors here.
Common Issues
- Wrong timezone: If you omit
--tz, the Gateway uses its host timezone. Running on a VPS? That is probably UTC, not your local time. - Payload mismatch: Main session jobs must use
systemEvent. Isolated jobs must useagentTurn. Mixing them causes silent failures. - Gateway not running: Cron lives inside the Gateway process. If the Gateway is stopped, no jobs fire. Check with
openclaw gateway status. - Job disabled: After errors, jobs can get disabled. Use
openclaw cron listto check the enabled status and re-enable if needed.
Quick fix: Run openclaw doctor --fix to normalize any legacy cron store fields. This resolves most weird scheduling issues after an OpenClaw update.
For deeper troubleshooting, check out our OpenClaw Troubleshooting Guide.
Want to see all the things you can automate? Check our full list of OpenClaw use cases. If you are new to OpenClaw, start with What is OpenClaw and get it installed at installopenclawnow.com.
Running OpenClaw on a Mac Mini or VPS? Our Telegram bot setup guide shows you how to connect your agent to Telegram so cron job results land right in your chat.
Frequently Asked Questions
What are OpenClaw cron jobs?
OpenClaw cron jobs are scheduled tasks that your AI agent executes automatically at specified times. They use standard cron syntax to define when tasks run, like checking email every 30 minutes or posting to social media three times a day.
How do I set up a cron job in OpenClaw?
Use the OpenClaw CLI to create cron jobs with a schedule and prompt. For example, set a job to check email every hour or generate a morning brief at 7 AM. Each cron job runs in its own session so tasks stay isolated.
What are the best cron jobs for OpenClaw?
The most useful OpenClaw cron jobs include email checking (every 30 minutes), social media posting (3x daily), morning briefs (daily at 7 AM), analytics reports (weekly), and inbox monitoring (every hour). Start with 2 to 3 cron jobs and add more as needed.
Can OpenClaw cron jobs use different AI models?
Yes, each cron job can be configured to use a different AI model. Use a cheaper model for simple tasks like email checking and a more powerful model for complex tasks like content writing. This optimizes your API costs.
How many cron jobs can I run in OpenClaw?
There is no hard limit on the number of OpenClaw cron jobs. The practical limit depends on your API budget and how frequently jobs run. Most users run 5 to 15 cron jobs covering different aspects of their workflow.
OpenClaw Lab is the #1 community for founders building AI agent systems. I share the exact playbooks, skill files, and workflows inside. Weekly lives, expert AMAs, and 260+ founders building real systems.
Join OpenClaw Lab →