Clawist
📖 Guide7 min read••By Lin

OpenClaw Cron Jobs: Schedule AI Tasks That Run Themselves

OpenClaw Cron Jobs: Schedule AI Tasks That Run Themselves

Your AI assistant doesn't need to wait for you to type commands. OpenClaw's cron system lets you schedule tasks that run automatically—daily reports, weekly summaries, content creation, data monitoring, whatever you need.

This tutorial walks you through setting up your first cron job and building toward a fully automated AI workflow.

What Are OpenClaw Cron Jobs?

Cron jobs are scheduled tasks that run at specified times. Unlike heartbeats (which poll periodically for new work), cron jobs execute specific commands on a fixed schedule.

Use cron jobs when you need:

  • Exact timing — "Run at 9 AM every Monday"
  • One-shot reminders — "Alert me in 30 minutes"
  • Isolated execution — Tasks that shouldn't affect your main conversation
  • Different models — Run a thinking-heavy task with Opus while your main session uses Sonnet

Creating Your First Cron Job

The simplest cron job sends you a message at a scheduled time:

/cron add "0 9 * * 1" "Send me a summary of my calendar for this week"

This runs every Monday at 9 AM UTC. The first part is a standard cron expression:

FieldValuesExample
Minute0-590 = top of hour
Hour0-239 = 9 AM
Day of month1-31* = every day
Month1-12* = every month
Day of week0-61 = Monday

Common patterns:

  • 0 9 * * * — Daily at 9 AM
  • 0 */4 * * * — Every 4 hours
  • 0 9 * * 1-5 — Weekdays at 9 AM
  • 0 0 1 * * — First of each month at midnight

Practical Cron Job Examples

Daily standup prep — Get a summary of yesterday's commits and today's calendar:

/cron add "0 8 * * 1-5" "Check my GitHub activity from yesterday, 
review my calendar for today, and give me a 3-bullet standup summary"

Weekly analytics digest — Compile data from multiple sources:

/cron add "0 10 * * 1" "Pull last week's Google Analytics for my sites, 
summarize traffic trends, and highlight any pages with significant changes"

Content creation pipeline — Generate blog posts on a schedule:

/cron add "0 6 * * *" "Research trending topics in AI, write a 1000-word 
blog post with SEO optimization, and save it to /content/posts/"

Infrastructure monitoring — Check server health:

/cron add "*/30 * * * *" "Check disk space, memory usage, and running 
processes. Alert me if anything looks concerning."

Managing Cron Jobs

List all your active cron jobs:

/cron list

Remove a cron job by its ID:

/cron remove <job-id>

Pause a cron job without deleting it:

/cron pause <job-id>

Resume a paused job:

/cron resume <job-id>

Cron Job Isolation

Each cron job runs in its own isolated session. This means:

  • No context bleed — Cron jobs don't see your main conversation history
  • No interruptions — Long-running cron tasks don't block your interactive sessions
  • Clean failures — If a cron job fails, it doesn't affect other jobs or your main session

This isolation is why cron jobs are better than heartbeat tasks for complex, independent work.

Delivering Cron Results

Cron job output goes to your configured channel by default. You can also:

Write to files — Save output for later review:

/cron add "0 7 * * *" "Generate daily metrics report and save to 
/reports/daily-$(date +%Y-%m-%d).md"

Send to specific channels — Route different reports to different places:

/cron add "0 9 * * 1" "Send weekly team summary to #team-updates on Discord"

Trigger webhooks — Integrate with external systems:

/cron add "0 * * * *" "Check for new support tickets, summarize any 
urgent ones, and POST to my Slack webhook"

Advanced: Chained Cron Jobs

For complex workflows, chain multiple cron jobs that build on each other:

Step 1: Data collection (runs early morning)

/cron add "0 5 * * *" "Download latest analytics data, parse it, 
and save to /data/daily-analytics.json"

Step 2: Analysis (runs after data collection)

/cron add "0 6 * * *" "Read /data/daily-analytics.json, identify 
anomalies, and save findings to /data/daily-analysis.md"

Step 3: Report generation (runs after analysis)

/cron add "0 7 * * *" "Read /data/daily-analysis.md, generate 
executive summary, and email to stakeholders"

Each job is independent—if one fails, the others continue with whatever data is available.

Cron vs Heartbeat: When to Use Each

Use cron when:

  • Exact timing matters ("9 AM sharp")
  • Tasks need isolation from your main session
  • You want different model settings
  • One-shot reminders ("in 20 minutes")
  • Output should go directly to a channel

Use heartbeat when:

  • Multiple checks can batch together
  • You need recent conversation context
  • Timing can drift slightly
  • Reducing API calls by combining checks

In practice, use heartbeats for lightweight, frequent checks (email, calendar) and cron for heavyweight, scheduled tasks (reports, content creation).

Monitoring Cron Jobs

Check the status of your cron jobs:

/cron status

This shows recent executions, success/failure rates, and next scheduled runs.

For production workloads, set up failure alerts:

/cron add "0 * * * *" "Run hourly health check. If it fails, 
immediately notify me via high-priority message."

Common Patterns

Morning briefing

/cron add "0 7 * * 1-5" "Good morning! Here's your briefing:
1. Weather forecast
2. Calendar highlights
3. Priority emails
4. Top news in AI"

End of day cleanup

/cron add "0 18 * * 1-5" "Review today's completed tasks, 
archive old files, and prepare tomorrow's todo list"

Weekend project updates

/cron add "0 10 * * 6" "Check all my GitHub projects for open 
issues, PRs, and stale branches. Give me a weekend action list."

Getting Started

Start simple. Set up one cron job for something you do manually every day:

  1. Identify a recurring task (checking email, reviewing metrics, generating a report)
  2. Write a clear prompt that describes what you want
  3. Choose the right schedule
  4. Test it and refine

Once your first cron job is running smoothly, add more. Build toward a system where your AI assistant handles routine work automatically, freeing you to focus on what matters.

The goal isn't to automate everything—it's to automate the boring stuff so you can do more interesting work.