Setting Up Cron Jobs
Explore how to configure cron jobs in OpenClaw to enable your AI assistant to perform scheduled tasks autonomously. Understand the difference between main session and isolated modes, learn to create, manage, and debug cron jobs, and discover practical uses like morning briefings and reminders. This lesson prepares you to automate routine workflows and keep your agent proactive.
Everything we have built so far is reactive. You send a message, and your agent responds. You ask about a pull request, and it checks the status. While that is useful, it is not what makes OpenClaw feel different from a standard chatbot. The real shift occurs when the agent starts acting on its own.
Cron jobs are the mechanism that makes this possible. They allow you to schedule your agent to execute tasks on a fixed rotation. The agent delivers results directly to you on WhatsApp, Slack, or Telegram. It wakes up, completes the work, reports back, and remains quiet until the next scheduled run.
How does the cron system work?
Cron runs inside the Gateway, not inside the model. That distinction matters: your scheduled jobs persist across restarts, survive model changes, and do not depend on you having an active conversation. The Gateway wakes up at the right time, triggers the agent, and handles delivery.
Jobs are stored at ~/.openclaw/cron/jobs.json and run history is logged per-job. If your Gateway is running, your cron jobs are running.
What are the two execution modes?
Every cron job runs in one of two modes, and choosing the right one matters.
Main session: The job injects a message into your normal conversation as if you had sent it yourself. The agent picks it up on the next heartbeat, ...