$ 0 7 * * *
Automation

Cron Jobs and Automation: Schedule Recurring AI Tasks

Learn how to set up scheduled tasks with OpenClaw cron jobs. Automate daily briefings, inbox processing, reminders, and more with cron expressions.

OT
OPENCLAW.EXPERT TEAM
|DEC 28, 2024|6 MIN READ

Introduction to Cron Jobs

OpenClaw can automatically execute tasks on a schedule using cron jobs. Perfect for:

  • Morning briefings

  • Daily inbox processing

  • Scheduled reminders

  • Periodic report generation
  • Creating a Cron Job

    Using the CLI

    openclaw cron add \
    --name "Morning Brief" \
    --cron "0 7 * * *" \
    --message "Give me today's schedule and any urgent emails"

    Cron Expression Format

    ┌───────────── minute (0 - 59)
    │ ┌───────────── hour (0 - 23)
    │ │ ┌───────────── day of month (1 - 31)
    │ │ │ ┌───────────── month (1 - 12)
    │ │ │ │ ┌───────────── day of week (0 - 6)
    │ │ │ │ │
    * * * * *

    Common Schedules

    ScheduleCron Expression

    Every morning at 7 AM0 7 * * *
    Every hour0 * * * *
    Every weekday at 9 AM0 9 * * 1-5
    Every Sunday at 6 PM0 18 * * 0

    Managing Cron Jobs

    List All Jobs

    openclaw cron list

    Delete a Job

    openclaw cron delete --name "Morning Brief"

    Pause/Resume

    openclaw cron disable --name "Morning Brief"
    openclaw cron enable --name "Morning Brief"

    Heartbeat Mode

    For periodic checks without specific scheduling:

    {
    "automation": {
    "heartbeat": {
    "enabled": true,
    "interval": "30m"
    }
    }
    }

    The agent runs every 30 minutes to check for tasks.

    Webhook Triggers

    For event-driven automation:

    openclaw webhooks create --name github-events

    This creates an endpoint that triggers your agent when called.

    Troubleshooting

    Cron Job Not Firing

  • Check job is enabled: openclaw cron list

  • Verify gateway is running: openclaw status

  • Check timezone configuration

  • Review logs: openclaw logs --follow
  • Wrong Timezone

    Set your timezone in config:

    {
    "automation": {
    "timezone": "America/New_York"
    }
    }

    Advanced: Email-Triggered Automation

    Connect Gmail for email-triggered tasks:

    {
    "automation": {
    "gmail": {
    "enabled": true,
    "watchLabels": ["INBOX"]
    }
    }
    }

    Need Help Setting Up Automation?

    Contact us for professional automation configuration.

    Need Professional OpenClaw Setup?

    Skip the technical hassle. Our expert team handles installation, configuration, and ongoing support so you can focus on what matters.