OPENCLAW PLAYBOOK
CTRL+K
INITIATE_PROTOCOL

OpenClaw Cron Jobs: Automating Workflows That Run Without You

BY MIRA8 MIN READ

The best OpenClaw workflows are the ones that run while you sleep. Cron jobs are how you get there — scheduled tasks that fire on a timer and execute everything from content publishing to inbox monitoring without any human trigger.

This guide covers how OpenClaw cron jobs work, how to set them up, and the patterns that are working in production right now.

How OpenClaw Cron Jobs Work

Cron jobs in OpenClaw are defined in ~/.openclaw/cron/jobs.json. Each job has a schedule (standard cron syntax), a task description, and optional context. When the schedule triggers, OpenClaw spins up a session, injects the task, and runs it autonomously.

The key difference from a traditional cron job is that the task is natural language, not a shell command. You describe what you want done, and the agent figures out how to do it — reading files, calling APIs, spawning subagents, and reporting results.

// ~/.openclaw/cron/jobs.json
{
  "jobs": [
    {
      "id": "daily-content",
      "schedule": "0 6 * * *",
      "task": "Run the daily content production workflow. Write one new article for each of the 13 sites, commit, and push. Send a Telegram summary when done.",
      "enabled": true
    },
    {
      "id": "inbox-triage",
      "schedule": "0 8,12,17 * * *",
      "task": "Check email for anything urgent. Flag anything that needs a response today. Update the task queue.",
      "enabled": true
    }
  ]
}

Patterns That Work

Content Production at Scale

The most reliable cron pattern I have running is daily content production across a portfolio of sites. The job fires at 6am, spawns parallel subagents for each site batch, and reports back via Telegram when all commits are pushed. The entire operation runs without human input.

The critical insight: the cron task description needs to be specific enough that the agent does not need to ask questions. "Write an article" is too vague. "Write one new comparison article for saas-versus.com, pick a topic not already covered in the /compare directory, commit to the kaykas/saas-versus repo, and push to main" gives the agent everything it needs.

Heartbeat Monitoring

A heartbeat job runs every few hours and checks the state of things: email inbox, calendar for today's events, any failing deployments, anything in the task queue that is overdue. It sends a brief status to Telegram. If everything is fine, it sends "HEARTBEAT_OK." If something needs attention, it flags it with specifics.

This pattern keeps a human in the loop without requiring them to actively check anything. The agent does the checking; the human only reads when something needs action.

SEO Monitoring

A weekly SEO job pulls Search Console data for all 13 sites, identifies pages that have dropped more than 20% in clicks week-over-week, and writes a brief with the top three things to fix. The brief goes into a file in the workspace so I can review it when I want to, not when the agent wants me to.

Common Mistakes

Vague task descriptions. The more specific the task, the fewer intervention points. Write task descriptions like you are briefing a contractor who cannot ask follow-up questions.

No output destination. Every cron job should end by writing output somewhere — a file, a database entry, a Telegram message. Without that, you have no way to know if the job did anything.

Overlapping schedules. If a content job takes 20 minutes and you schedule it every 15, you will have concurrent runs stepping on each other. Give jobs enough runway that they finish before the next run.

No error handling in the task description. Include instructions for what to do if something fails. "If a push fails, write the error to /tmp/cron-errors.log and send a Telegram message" gives the agent a recovery path.

After the Gateway Reload

Changes to jobs.json take effect after a gateway reload: openclaw gateway restart. Always back up the jobs file before editing. A syntax error in the JSON will disable all cron jobs until it is fixed.

Want the Cron Playbook?Get the full automation template pack