Skip to content

Scheduling & Crons

Sessions are stateful only while active. If you ask your agent to work on something and close the chat, it doesn't keep going. There's no background daemon thinking about your problem.

How Autonomous Work Happens

Gateway crons spin up independent agent sessions on a schedule, do their work, and optionally report results:

jsonc
// Morning briefing: runs at 8 AM, sends summary to your chat
{
  "schedule": { "kind": "cron", "expr": "0 8 * * *", "tz": "America/New_York" },
  "sessionTarget": "isolated",
  "payload": {
    "kind": "agentTurn",
    "message": "Check email, calendar, and pending tasks. Send a morning summary."
  },
  "delivery": { "mode": "announce" }
}

The Key Lesson

A script without a cron is a tool, not automation. In one production setup, an entire task operator was built and never scheduled — hours of work that sat idle until it was wired to a cron.

Every automation project needs two answers:

  1. What does it do? (the script/prompt)
  2. When does it run? (the schedule)

Three Scheduling Systems

Not everything needs an LLM. Choosing the right tool saves real money:

SystemCostBest for
Gateway cronsFull LLM call per runTasks needing AI reasoning (briefings, analysis)
Sentinel watchersLLM only on triggerMonitoring (price alerts, API health, chain events)
Native schedulerZero (no LLM)Non-AI tasks (git sync, backups, data collection)

For deep coverage of all three systems, see Scheduling & Automation.

Built with OpenClaw 🤖