Back to Blog

OpenClaw Cron - Scheduling Recurring AI Agent Tasks That Actually Run Reliably

April 12, 20268 min readMichael Ridland

Deploy OpenClaw for Your Business

Secure deployment in 48 hours. Choose personal setup or fully managed.

The moment AI agents become useful for real business work - not just demos - you start wanting them to run on a schedule. Check overnight emails every morning at 7am. Summarise support tickets every Friday afternoon. Monitor a competitor's pricing page daily. Run a data quality check before the weekly board report.

OpenClaw's cron system handles exactly this. It lets you schedule AI agent runs the same way you'd schedule any server task - with cron expressions - but with enough flexibility to handle the messiness of agentic workflows. Things like retries when the LLM has a bad day, delivery to Slack or Telegram when the job finishes, and session isolation so scheduled runs don't pollute your main conversation history.

Microsoft has good documentation on the OpenClaw cron CLI, but I want to focus on the practical side. What we've set up for clients, what works, and what to watch out for.

The Basic Concept

At its core, openclaw cron manages scheduled jobs that run agent prompts at specified times. You add a job with a name, a cron expression, and a message (the prompt). When the schedule triggers, OpenClaw spins up an agent run, processes the prompt, and optionally delivers the result somewhere - a Slack channel, Telegram chat, or webhook endpoint.

The simplest possible job looks like this:

openclaw cron add \
  --name "Morning brief" \
  --cron "0 7 * * *" \
  --session isolated \
  --message "Summarise overnight updates." \
  --announce

That creates a job that runs every day at 7am, processes the message in an isolated session (so it doesn't interfere with anything else), and announces the result back to the configured chat channel.

If you only need something to run once, use --at instead of --cron:

openclaw cron add \
  --name "End of quarter report" \
  --at "2026-06-30T17:00" \
  --tz "Australia/Sydney" \
  --session isolated \
  --message "Generate the Q2 summary report." \
  --announce

One-shot jobs delete themselves after successful execution by default. If you want them to stick around (maybe for auditing), add --keep-after-run.

Session Isolation Matters More Than You Think

When we first started setting up OpenClaw cron jobs, we made the mistake of running scheduled tasks in the main session. Don't do this. Every scheduled run adds to the session context, and after a few days your main conversation thread is cluttered with automated output that makes interactive use confusing.

The --session isolated flag gives each cron run its own session. It starts clean, does its work, delivers the result, and the session gets pruned after the retention window (24 hours by default). Your main session stays untouched.

You can also bind a job to a specific persistent session using --session "session:daily-brief". This is useful when you want the agent to remember context from previous runs of the same job. A daily monitoring task that should notice trends across days, for example, benefits from a persistent session that accumulates context over time.

For most cases though, isolated sessions are the right default. Keep things clean.

Delivery - Getting Results Where They Need to Go

Running an agent on schedule is only useful if the result goes somewhere. OpenClaw supports several delivery patterns:

Announce mode (--announce) delivers the agent's final reply to the configured chat channel. This is the simplest option and works well for briefings and summaries that should land in a team channel.

openclaw cron edit <job-id> --announce --channel slack --to "channel:C1234567890"

Webhook delivery posts the completed payload to a URL. This is what we use when the cron job needs to trigger a downstream system - maybe a Power Automate flow or an internal API that processes the agent's output.

No delivery (--no-deliver) keeps the output internal. The job runs, the result gets logged, but nothing is sent anywhere. Useful for jobs that take actions directly (through tools) rather than producing output that needs to be read.

One nuance worth knowing: isolated cron jobs default to announce delivery. If you create an isolated job and forget to specify delivery, it will try to announce the result. Use --no-deliver explicitly if you want silent execution.

Failure Notifications

Jobs fail sometimes. The LLM might time out, a tool call might error, or the model might produce an unhelpful response. OpenClaw lets you configure where failure notifications go:

The system checks delivery.failureDestination first (per-job setting), then cron.failureDestination (global setting), and falls back to the job's primary announce target if neither is configured. Set up the global failure destination early - you don't want failed jobs disappearing silently.

Retry Behaviour and Error Handling

This is one area where OpenClaw's cron system is genuinely well-designed. Recurring jobs use exponential retry backoff when they hit consecutive errors: 30 seconds, then 1 minute, then 5 minutes, 15 minutes, and finally 60 minutes between retries. Once a run succeeds, the backoff resets and the job returns to its normal schedule.

This matters because LLM APIs are not perfectly reliable. Rate limits, temporary outages, and occasional model errors are part of working with AI services. The exponential backoff means a transient failure doesn't cascade into dozens of rapid retry attempts hammering the API, but a persistent problem eventually slows down enough that you notice it in your failure notifications.

Deploy OpenClaw for Your Business

Secure deployment in 48 hours. Choose personal setup or fully managed.

If a run throws a LiveSessionModelSwitchError (when the configured model becomes unavailable), OpenClaw will persist the switched provider and retry up to twice. After that it aborts rather than looping indefinitely. This is sensible defensive behaviour that prevents runaway costs from a misconfigured model fallback chain.

Model Selection for Cron Jobs

You can specify which model a cron job uses with --model. The precedence order is worth understanding:

  1. Gmail-hook override (if applicable)
  2. Per-job --model setting
  3. Stored cron-session model override
  4. Agent/default model selection

For most jobs, setting --model at job creation time is sufficient. But if the specified model isn't in your allowed models list, OpenClaw will warn you and fall back to the agent's default model. Check your model configuration before assuming a specific model will be used.

Practical Patterns We've Set Up

Daily Morning Briefing

openclaw cron add \
  --name "Morning brief" \
  --cron "0 7 * * 1-5" \
  --session isolated \
  --message "Review overnight alerts and summarise key items requiring attention." \
  --announce --channel slack --to "channel:C_TEAM_CHANNEL" \
  --light-context

The --light-context flag is worth noting here. It keeps the bootstrap context lightweight for isolated runs, which speeds up the job and reduces token costs. For a quick briefing that doesn't need the full workspace context, this makes sense.

Weekly Data Quality Check

openclaw cron add \
  --name "Friday data check" \
  --cron "0 14 * * 5" \
  --session "session:data-quality" \
  --message "Run the data quality checks and compare results to last week. Flag any new issues." \
  --announce --channel slack --to "channel:C_DATA_TEAM"

Notice this uses a persistent session (session:data-quality) so the agent can reference previous weeks' results and spot trends.

Silent Cleanup Job

openclaw cron add \
  --name "Nightly cleanup" \
  --cron "0 2 * * *" \
  --session isolated \
  --message "Archive completed tickets older than 30 days." \
  --no-deliver

No delivery because this job takes action through tools rather than producing output to read.

Managing Jobs Day-to-Day

The admin commands are straightforward:

openclaw cron list                        # See all jobs
openclaw cron show <job-id>               # Job details with delivery route
openclaw cron runs --id <job-id> --limit 50  # Run history with delivery diagnostics
openclaw cron run <job-id>                # Force-run immediately

The cron runs output includes delivery diagnostics showing the intended target, resolved target, whether the agent sent directly via the message tool, whether fallback delivery was used, and the final delivered state. This diagnostic info is extremely helpful when debugging why a result didn't land where you expected.

To modify a job without recreating it:

openclaw cron edit <job-id> --announce --channel telegram --to "123456789"
openclaw cron edit <job-id> --agent ops    # Retarget to a different agent
openclaw cron edit <job-id> --clear-agent  # Reset to default agent

Retention and Cleanup

Two configuration values control how much history accumulates:

  • cron.sessionRetention (default 24h) prunes completed isolated run sessions
  • cron.runLog.maxBytes and cron.runLog.keepLines prune the run log files

The defaults are reasonable for most setups. If you're running many jobs with long outputs, you might want to tighten the retention or increase the max bytes. The run logs live at ~/.openclaw/cron/runs/<jobId>.jsonl.

Getting Started With Scheduled Agent Work

If you're already running AI agents for ad-hoc tasks and want to move toward automated, scheduled workflows, OpenClaw's cron system is a solid starting point. The isolated session model means scheduled work stays separate from interactive work, the retry logic handles the inherent unreliability of LLM APIs, and the delivery options are flexible enough to fit into most team communication setups.

For organisations looking to build agentic automations that run reliably in production, our team at Team 400 helps design and implement these kinds of workflows. We also offer managed AI services if you'd rather have someone else handle the operational side of keeping agents running on schedule.

Start with one job. Make it something low-stakes - a daily summary, a monitoring check. Get comfortable with the delivery and failure notification setup. Then expand from there.

Deploy OpenClaw for Your Business

Secure deployment in 48 hours. Choose personal setup or fully managed.