OpenClaw Cron Jobs: Automate Your Agent's Daily Routine
Learn how to set up cron jobs in OpenClaw to schedule recurring tasks — from email summaries to security audits. Includes practical examples with code.
OpenClaw Cron Jobs: Automate Your Agent's Daily Routine
The best AI agent is one you don't have to babysit. Cron jobs let your OpenClaw agent do things on a schedule — check email, scan for security issues, summarize news, send you a morning briefing — without you typing a single message.
I run about 15 cron jobs on my own setup. Some fire every 30 minutes, others once a week. Together they handle maybe 60% of what used to be manual check-in work.
Here's how to set them up and some patterns that actually work in practice.
How Cron Jobs Work in OpenClaw
A cron job is a scheduled task. You define three things:
- When it runs (schedule)
- What it does (payload)
- Where the output goes (delivery)
Each job runs in its own isolated session. That means it gets a fresh context window, doesn't interfere with your main conversation, and can use a different model if you want.
Creating Your First Cron Job
The simplest approach — through the CLI:
openclaw cron add \
--name "Morning Briefing" \
--schedule "0 8 * * *" \
--message "Check my unread emails, today's calendar, and the weather in São Paulo. Give me a 3-paragraph summary."
That fires at 8:00 AM every day. The agent reads your email (if you've configured the Gmail skill), checks your calendar, grabs weather data, and sends you the summary.
You can also create jobs through the dashboard or by asking your agent directly in chat: "Set up a daily cron job at 8 AM that checks my email and calendar."
Schedule Syntax
OpenClaw supports standard cron expressions:
┌───── minute (0-59)
│ ┌───── hour (0-23)
│ │ ┌───── day of month (1-31)
│ │ │ ┌───── month (1-12)
│ │ │ │ ┌───── day of week (0-7, 0 and 7 = Sunday)
│ │ │ │ │
* * * * *
Common patterns:
| Schedule | Expression | Use Case |
|----------|------------|----------|
| Every morning at 8 AM | 0 8 * * * | Daily briefing |
| Every 30 minutes | */30 * * * * | Inbox monitoring |
| Monday and Thursday at 9 AM | 0 9 * * 1,4 | Content publishing |
| First day of month at noon | 0 12 1 * * | Monthly report |
| Every weekday at 6 PM | 0 18 * * 1-5 | End-of-day summary |
You can also set a timezone. Default is UTC, but you probably want your local time:
{
"schedule": {
"kind": "cron",
"expr": "0 8 * * *",
"tz": "America/New_York"
}
}
Payload Types
System Events (for your main session)
Inject a message into your existing conversation:
{
"payload": {
"kind": "systemEvent",
"text": "Reminder: standup meeting in 15 minutes"
}
}
Good for reminders and nudges. The message appears in your main chat as if the system sent it.
Agent Turns (isolated execution)
Run the agent with a specific prompt in its own session:
{
"payload": {
"kind": "agentTurn",
"message": "Research the top 5 HackerNews stories from today and write a 200-word summary of each",
"model": "anthropic/claude-sonnet-4-20250514"
}
}
The agent does the work independently. When it finishes, it can deliver the result to your chat or a specific channel.
Delivery Options
Where should the output go after the job runs?
- announce — sends the summary to your chat (default for isolated jobs)
- webhook — POSTs the result to a URL
- none — runs silently, useful for maintenance tasks
{
"delivery": {
"mode": "announce",
"channel": "telegram"
}
}
Real-World Cron Patterns
Pattern 1: Email Triage
openclaw cron add \
--name "Email Check" \
--schedule "*/30 * * * 1-5" \
--message "Check my Gmail inbox. For any unread emails from the last 30 minutes: summarize the sender, subject, and whether it needs a reply. If something looks urgent, flag it."
Runs every 30 minutes on weekdays. My agent categorizes emails into "needs reply," "FYI only," and "spam/marketing." Saves me from checking email every 5 minutes.
Pattern 2: Security Audit
openclaw cron add \
--name "Security Check" \
--schedule "0 3 * * *" \
--message "Run openclaw security audit --deep. If any issues are found, summarize them with severity levels. Check for failed SSH login attempts in the last 24 hours. Report any new listening ports."
Runs at 3 AM daily. I wake up to either "all clear" or a specific list of things to look at.
Pattern 3: Content Pipeline
openclaw cron add \
--name "Blog Publisher" \
--schedule "0 9 * * 1,4" \
--message "Check projects/blog/queue/ for any posts marked as ready. For each one: validate frontmatter, run a final spell check, then publish by moving to the content directory and running the deploy script."
Mondays and Thursdays at 9 AM. I queue up blog posts during the week, and the agent handles the actual publishing.
Pattern 4: Project Status
openclaw cron add \
--name "Weekly Status" \
--schedule "0 17 * * 5" \
--message "Generate a weekly status report. Check git logs for all repos in ~/projects/. Summarize commits, open issues, and any failed CI runs. Format as a brief report."
Friday at 5 PM. A quick snapshot of what happened across all my projects that week.
Managing Cron Jobs
List all your jobs:
openclaw cron list
Check run history for a specific job:
openclaw cron runs --job-id JOB_ID
Disable without deleting:
openclaw cron update --job-id JOB_ID --enabled false
Trigger a job manually (useful for testing):
openclaw cron run --job-id JOB_ID
Delete a job:
openclaw cron remove --job-id JOB_ID
Cost Control
Each cron job triggers an AI model call. With 15 jobs running throughout the day on Sonnet, I spend roughly $5-10/month on scheduled tasks alone. A few things that help:
- Use Haiku for simple checks. Email triage doesn't need Opus-level reasoning. Specify the model in the payload.
- Don't run things more often than needed. Every-5-minute email checks burn tokens for minimal benefit over every-30-minute checks.
- Set timeouts. A stuck research task can run up your bill. Add
"timeoutSeconds": 120to the payload. - Batch related checks. Instead of three separate jobs for email, calendar, and weather, combine them into one morning briefing job.
Debugging Failures
Jobs fail sometimes. The agent couldn't connect to Gmail, or the web search returned nothing, or the model hit a rate limit. Check the run history:
openclaw cron runs --job-id JOB_ID
Each run shows the status (completed, failed, timed out) and the full output. Look at the agent's reasoning — it usually explains what went wrong.
Common fixes:
- Auth expired — re-authenticate the skill (Gmail, calendar, etc.)
- Rate limited — space out your jobs or use a different model
- Timeout — increase the timeout or simplify the prompt
- Empty output — the agent ran but had nothing to report. That's fine — maybe there were no new emails.
Start Small, Expand Later
Don't set up 20 cron jobs on day one. Start with one daily briefing. See if the output is useful. Tweak the prompt until it gives you what you actually want. Then add a second job. Build your automation layer gradually.
The whole point is to reclaim attention. Every cron job that works well is one fewer thing you have to remember to check manually.
For more on building automated workflows, check out our guide on building AI content pipelines or the OpenClaw official docs.