OpenClaw Cron Automation
Schedule tasks, automate workflows, and let your AI work while you sleep. Master the built-in Gateway scheduler.
OpenClaw Cron is a built-in scheduler that runs inside the Gateway process. It persists across restarts and lets you automate any task on a schedule.
- ✓Built-in Gateway scheduler - No external dependencies needed
- ✓Persistent across restarts - Jobs survive Gateway restarts
- ✓Automate any task - Reminders, reports, checks, deliveries
- ✓Flexible scheduling - One-shot, intervals, or cron expressions
Three Scheduling Types
atOne-shot timestamp. Runs once at a specific time.
Examples: "2024-12-25T09:00:00Z", "20m", "2h"
everyFixed intervals in milliseconds. Repeats forever.
Examples: 60000 (1 min), 3600000 (1 hour)
cronFive-field expressions with timezone support.
Examples: "0 9 * * *", "*/15 * * * *"
Execution Modes
Enqueues the event for the next heartbeat. The task runs with full conversation context.
- +Access to conversation history
- +Shares context with user interactions
- -May wait for current turn to complete
Dedicated agent turn in a separate cron:<jobId> session.
- +Runs immediately, no waiting
- +Clean slate every execution
- -No access to main conversation
CLI Examples
Set a one-shot reminder that triggers in 20 minutes:
openclaw cron add --name "Check calendar" --at "20m" --session main --wake now--at "20m": Runs once, 20 minutes from now
--session main: Uses main conversation context
--wake now: Activates immediately
Schedule a daily morning status that delivers to WhatsApp:
openclaw cron add --name "Morning status" --cron "0 7 * * *" --tz "America/Los_Angeles" --session isolated --message "Summarize inbox" --deliver --channel whatsapp --to "+1555..."--cron "0 7 * * *": Every day at 7:00 AM
--tz: Timezone for the cron expression
--session isolated: Runs in dedicated session
--deliver: Sends output to a channel
Run a health check every 5 minutes:
openclaw cron add --name "Health check" --every 300000 --session isolated --message "Check system status"300000ms = 5 minutes
Cron Expression Reference
| Field | Range | Examples |
|---|---|---|
| Minute | 0-59 | 0, 30, */15 |
| Hour | 0-23 | 9, 0, */2 |
| Day of Month | 1-31 | 1, 15, * |
| Month | 1-12 | 1, 6, * |
| Day of Week | 0-6 (0=Sunday) | 0, 1-5, * |
| Pattern | Description |
|---|---|
| 0 9 * * * | Daily at 9 AM |
| 0 9 * * 1 | Every Monday 9 AM |
| */15 * * * * | Every 15 minutes |
| 0 0 1 * * | First of month at midnight |
| 0 */2 * * * | Every 2 hours |
| 30 8 * * 1-5 | Weekdays at 8:30 AM |
Advanced Features
Model Override
Use a specific model for scheduled tasks:
Thinking Level
Control reasoning depth for complex tasks:
Channel Delivery
Send output to messaging platforms:
Telegram Topic Support
Target specific forum topics:
Managing Jobs
List all jobs
openclaw cron listShows all scheduled jobs with their IDs, schedules, and status.
Remove a job
openclaw cron remove <id>Permanently delete a scheduled job by its ID.
Pause and resume
openclaw cron pause <id>openclaw cron resume <id>Temporarily stop a job without deleting it.
Storage
Cron jobs and their execution history are stored locally:
~/.openclaw/cron/jobs.json~/.openclaw/cron/runs/The runs directory contains timestamped logs for each job execution, useful for debugging and auditing.
Start Automating
Build your first scheduled task and let OpenClaw work while you focus on what matters.