🦞
Tutorial

Cron Automation

Schedule tasks and automate workflows with OpenClaw's built-in scheduler.

What is Cron?

OpenClaw includes a powerful built-in scheduler for automating repetitive tasks. Schedule daily briefings, periodic checks, or complex workflows - all triggered automatically.

  • Time-based TriggersRun tasks at specific times or intervals
  • Natural LanguageSchedule with 'every day at 9am' or cron syntax
  • Full AI AccessScheduled tasks can use all OpenClaw capabilities
  • Execution ModesRun in main session or isolated contexts

Schedule Types

at

Run at a specific time

at HH:MM

at 09:00, at 14:30, at 00:00

every

Run at regular intervals

every N minutes/hours/days

every 30 minutes, every 2 hours, every day at 9am

cron

Full cron expression for complex schedules

cron: * * * * *

0 9 * * 1-5 (weekdays at 9am)

Execution Modes

💬 Main Session

Task runs in your main OpenClaw session with full context and memory access.

  • +Access to conversation history
  • +Shared memory and context
  • +Can reference previous tasks
  • -May interrupt active conversations
  • -Shares rate limits
🔒 Isolated

Task runs in a separate, sandboxed context with its own memory.

  • +No interference with main session
  • +Clean execution environment
  • +Better for sensitive tasks
  • -No access to main session history
  • -Separate memory space

CLI Examples

Simple Reminder

Schedule a daily reminder:

$openclaw cron add --name "Check calendar" --at "20m" --session main --wake now

This creates a job that runs every day at 9:00 AM.

Daily Briefing

Get a morning briefing with weather, calendar, and news:

$openclaw cron add --name "Morning status" --cron "0 7 * * *" --tz "America/Los_Angeles" --session isolated --message "Summarize inbox" --deliver --channel whatsapp --to "+1555..."

The AI will gather information and send a formatted briefing.

Periodic Check

Check something every 30 minutes:

$openclaw cron add --name "Health check" --every 300000 --session isolated --message "Check system status"

Runs every 30 minutes starting from when the job is created.

Cron Syntax Reference

Five-Field Format
* * * * *
MinuteHourDay of MonthMonthDay of Week
FieldRangeExamples
Minute0-590, 30, */15
Hour0-239, 14, */2
Day of Month1-311, 15, */7
Month1-121, 6, */3
Day of Week0-6 (Sun=0)1-5, 0,6
Common Patterns
PatternDescription
0 9 * * *Every day at 9:00 AM
0 9 * * 1-5Weekdays at 9:00 AM
*/30 * * * *Every 30 minutes
0 */2 * * *Every 2 hours
0 9 1 * *First of every month at 9 AM
0 0 * * 0Every Sunday at midnight

Advanced Features

Conditional Execution

Run only if certain conditions are met

openclaw cron add "every day at 9am" "If it's a weekday, send me my calendar"

Chained Tasks

Run multiple tasks in sequence

openclaw cron add "every monday at 9am" "1. Check emails 2. Summarize important ones 3. Add to my todo list"

With Tools

Use specific tools in scheduled tasks

openclaw cron add "every hour" "Check https://example.com for changes" --tools browser

Managing Jobs

1

List all jobs

$openclaw cron list

Shows all scheduled jobs with their IDs and next run time

2

Remove a job

$openclaw cron remove <job-id>

Removes a scheduled job by its ID

3

Pause/Resume

$openclaw cron pause <job-id>
$openclaw cron resume <job-id>

Temporarily disable a job

4

View history

$openclaw cron history

See past executions and their results

Job Storage

Cron jobs are stored locally and persist across restarts.

Jobs: ~/.openclaw/cron/jobs.json:~/.openclaw/cron/jobs.json
History: ~/.openclaw/cron/history.json:~/.openclaw/cron/runs/

Jobs are loaded automatically when OpenClaw starts.

Start Automating!

Set up your first automated task and let OpenClaw work for you.