Reinventing.AI
AI Agent InsightsBy Reinventing.AI
OpenClaw Guides

Using Cron Jobs

Schedule automated tasks at specific times with OpenClaw cron jobs. Perfect for reminders, reports, and time-sensitive workflows.

What Are Cron Jobs?

Cron jobs in OpenClaw let you schedule tasks to run at exact timesβ€”daily at 9 AM, every Monday, once a month, or even one-time reminders. Unlike heartbeats (which run periodically), cron jobs give you precise control over when things happen.

Common Use Cases

  • Daily reports: Send summary every morning at 8 AM
  • Weekly reminders: "Check metrics" every Friday
  • One-time tasks: "Call client in 3 hours"
  • Monthly workflows: Invoice generation on 1st of month
  • Event-based: Birthday reminders, subscription renewals

Creating Your First Cron Job

Method 1: Using the CLI

openclaw cron add --name "Morning Report" \--schedule "0 8 * * *" \--message "Generate daily metrics report"

Method 2: Ask OpenClaw

The easiest wayβ€”just tell OpenClaw what you want:

You:

"Remind me to check my email every day at 9 AM EST"

OpenClaw:

"I've created a daily cron job that will remind you at 9 AM EST. Job ID: abc123"

Cron Schedule Syntax

Cron expressions follow this pattern: minute hour day month weekday

Common Examples:

0 9 * * *Every day at 9:00 AM
0 9 * * 1Every Monday at 9:00 AM
0 9,17 * * *Every day at 9 AM and 5 PM
0 9 1 * *First day of every month at 9 AM
*/30 * * * *Every 30 minutes

πŸ’‘ Pro Tip:

Use crontab.guru to generate and test cron expressions visually!

Advanced: Isolated Sessions

For complex tasks, use isolated sessions. This runs the job in its own workspace without cluttering your main conversation.

Create an isolated cron job:

{
  "name": "Weekly Analytics Report",
  "schedule": {
    "kind": "cron",
    "expr": "0 9 * * 1",
    "tz": "America/New_York"
  },
  "payload": {
    "kind": "agentTurn",
    "message": "Generate weekly analytics report and email to [email protected]"
  },
  "sessionTarget": "isolated",
  "delivery": {
    "mode": "announce",
    "channel": "telegram"
  }
}

Managing Cron Jobs

List All Jobs

openclaw cron list

Check Job History

openclaw cron runs --jobId [your-job-id]

Disable a Job

openclaw cron update --jobId [your-job-id] --patch '{"enabled": false}'

Delete a Job

openclaw cron remove --jobId [your-job-id]

Real-World Examples

πŸ“§ Daily Email Digest

Send summary of important emails every morning:

"Create cron job to check my unread emails every day at 7 AM and send me a summary"

πŸŽ‚ Birthday Reminders

Get notified the day before birthdays:

"Remind me on February 14 at 9 AM: Sarah's birthday tomorrow"

πŸ“Š Weekly Metrics

Automated reporting every Friday:

"Every Friday at 4 PM, generate a summary of this week's GitHub activity"

πŸ’° Invoice Reminders

Monthly billing workflow:

"On the 1st of every month at 9 AM, remind me to send invoices"

Cron Jobs vs Heartbeats

⏰ Cron Jobs

  • Precise timing (exact time/date)
  • One task per job
  • Isolated sessions available
  • Can deliver to specific channels
  • Perfect for: Reminders, reports, scheduled workflows

πŸ’“ Heartbeats

  • Regular intervals (every 30m, 1h)
  • Multiple checks in one run
  • Main session context
  • Responds in current chat
  • Perfect for: Monitoring, ongoing checks

Best Practices

⚑ Use Timezones

Always specify timezone in your cron jobs to avoid confusion. "tz": "America/New_York"

πŸ“ Clear Job Names

Give jobs descriptive names so you can identify them later: "Weekly Sales Report" not "Job 1"

πŸ”„ Test First

Run jobs manually before scheduling:

openclaw cron run --jobId [id] --mode force

πŸ’° Cost Awareness

Each cron job execution uses API credits. Be mindful of frequency and task complexity.

Next Steps