> For the complete documentation index, see [llms.txt](https://www.openclawbook.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.openclawbook.xyz/en/ch05-scheduling-and-automation/5.1-getting-started-with-cron.md). Agents can also search and read this documentation through its [MCP server](https://www.openclawbook.xyz/~gitbook/mcp).

# 5.1 Getting Started with Cron Jobs

> **Generated by**: Claude Opus 5 (claude-opus-5\[1m]) **Token usage**: Input \~204,000 tokens, Output \~9,000 tokens (this section) **Source baseline**: `v2026.3.9` (`v2026.3.8-170-g665f67726`)

***

## 5.1.1 Cron Expression Syntax

OpenClaw supports three schedule kinds; the classic cron expression is one of them.

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

Common patterns:

| Expression     | Meaning                         |
| -------------- | ------------------------------- |
| `0 9 * * *`    | 9:00 every day                  |
| `0 9 * * 1-5`  | 9:00 on weekdays                |
| `*/15 * * * *` | Every 15 minutes                |
| `0 */4 * * *`  | Every 4 hours                   |
| `0 9 1 * *`    | 9:00 on the first of each month |

The other two kinds are simpler:

| Kind    | Use                                   |
| ------- | ------------------------------------- |
| `at`    | One-shot at a specific time           |
| `every` | Fixed interval, e.g. every 30 minutes |

### Timezones

Jobs carry a timezone, so `0 9 * * *` means 9:00 **your** time, not UTC. Set it explicitly if your machine's timezone isn't what you want.

### One thing that happens automatically

**On-the-hour jobs get staggered within a 0–5 minute window** (§26.4.2), derived from a hash of the job ID.

Why? Because otherwise everyone's "daily briefing at 9:00" fires at exactly 9:00:00 and overwhelms both the gateway and the model API. The offset is **stable per job**, so your job doesn't wander around day to day — it just isn't at the exact top of the hour.

## 5.1.2 Creating and Managing Jobs

### From the CLI

```bash
# One-shot
openclaw cron add --at "2026-08-05T09:00:00" \
  --message "Remind me about the dentist appointment"

# Recurring, isolated session
openclaw cron add --schedule "0 9 * * 1-5" \
  --message "Check my calendar and summarize today's meetings" \
  --isolated

# List, inspect, remove
openclaw cron list
openclaw cron status <id>
openclaw cron remove <id>
openclaw cron run <id>        # run once now, for testing
```

**`openclaw cron run <id>` is the thing to use while setting a job up** — it runs immediately so you can see the output without waiting for the schedule.

### From a chat

The agent has a `cron` tool, so you can just ask:

```
Every weekday at 9am, check my calendar and send me a summary
```

It'll create the job. `openclaw cron list` will show it.

## 5.1.3 Two Job Shapes, and Which to Use

This is the decision that matters, and it's enforced at creation time (§26.4.1).

### Shape one: main session (`systemEvent`)

The job pushes an event into your **main session**, handled on the next heartbeat or immediately.

```bash
openclaw cron add --at "+20m" --message "Remind me to take the laundry out"
```

| Property | Value                                                                |
| -------- | -------------------------------------------------------------------- |
| Context  | **Complete** — it knows your ongoing conversation                    |
| Cost     | **Nearly free** — it rides along with the heartbeat                  |
| Timing   | Precise if `wakeMode: now`, otherwise up to one heartbeat cycle late |

**Use it for**: reminders and anything that benefits from knowing your current context.

### Shape two: isolated session (`agentTurn`)

The job starts a **clean agent turn** under its own session.

```bash
openclaw cron add --schedule "0 8 * * *" \
  --message "Fetch the weather and top news, write a briefing" \
  --isolated \
  --model "claude-haiku"
```

| Property | Value                                                      |
| -------- | ---------------------------------------------------------- |
| Context  | **Clean** — no conversation history                        |
| Cost     | A full turn each time, **but you can use a cheaper model** |
| Timing   | Precise                                                    |

**Use it for**: recurring work that doesn't need your conversation history — briefings, monitoring, reports.

> **The practical rule**: does this job need to know what we've been talking about? If yes, main session. If no, isolated — and put a cheaper model on it.

## 5.1.4 Delivery: Where Results Go

An isolated job's result has to go somewhere. Three options:

| Mode       | Behavior                                                           |
| ---------- | ------------------------------------------------------------------ |
| `announce` | Send a summary through a message channel — you get a message       |
| `webhook`  | HTTP POST to a URL you specify                                     |
| `none`     | Nothing; the job just runs (useful when its work is a side effect) |

```bash
openclaw cron add --schedule "0 8 * * *" \
  --message "Write the daily briefing" \
  --isolated \
  --deliver announce \
  --channel telegram \
  --to "123456789"
```

**If delivery fails**, there's a fallback path that forwards a summary to your main session — gated to avoid duplicate interruptions (§26.4.4).

## 5.1.5 Things That Will Bite You

**A job that keeps failing gets disabled.** If the schedule expression itself won't parse, OpenClaw disables the job and alerts rather than erroring every minute forever (§26.4.2). Check `openclaw cron status <id>` if a job stops running.

**Restarts don't replay everything.** After a gateway restart, only jobs **with run history** replay missed slots, and backlogged jobs are re-staggered. A job you created but never ran won't fire a catch-up.

**Isolated jobs don't see your memory.** `MEMORY.md` isn't injected into cron sessions (§28.5.2) — deliberately, for privacy and token cost. If a job needs some context, put it in the message.

**Test with `cron run` before trusting a schedule.** The single most common mistake is a job that works logically but produces something you didn't expect — and finding out at 8am for a week.

***

## Section Summary

1. **Three schedule kinds**: cron expression, `at` (one-shot), `every` (interval); jobs carry a timezone so `0 9 * * *` is your local 9:00.
2. **On-the-hour jobs are auto-staggered within 0–5 minutes**, derived from a hash of the job ID — avoiding everyone's daily briefing firing simultaneously, with a **stable offset per job**.
3. **`openclaw cron run <id>` runs a job immediately** — use it while setting jobs up rather than waiting for the schedule.
4. **The key decision is main session vs. isolated**: main is nearly free and knows your context; isolated is clean and can use a cheaper model. **Ask whether the job needs to know what you've been talking about.**
5. **Delivery has three modes** (`announce` / `webhook` / `none`), with a gated fallback to the main session when delivery fails.
6. **Four things that bite**: persistently failing jobs get disabled (check `cron status`), restarts only replay jobs with run history, **isolated jobs don't see `MEMORY.md`**, and you should always test with `cron run` first.
