> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runtools.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Schedules

> Run an agent on a cron schedule — automatically, as you

A schedule runs one of your agents on a cron cadence with a prompt you choose. Each fire is a normal agent run — billed to your org, attributed to you — so anything an agent can do interactively, it can do on a schedule: a morning digest, an hourly check, a weekly report. Create one from the API, SDK, CLI, or dashboard; pause it any time; watch its run history.

## Create a schedule

<CodeGroup>
  ```bash CLI theme={null}
  runtools schedule create \
    --agent daily-digest \
    --cron "0 9 * * *" \
    --timezone "America/New_York" \
    --message "Summarize yesterday's activity." \
    --thread-mode rolling
  ```

  ```typescript SDK theme={null}
  const schedule = await rt.schedules.create({
    agent: 'daily-digest',
    cronExpression: '0 9 * * *',   // 9am daily
    timezone: 'America/New_York',
    message: "Summarize yesterday's activity.",
    threadMode: 'rolling',
  });
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.runtools.ai/v1/schedules \
    -H "Authorization: Bearer rt_live_xxx" \
    -H "Content-Type: application/json" \
    -d '{
      "agent": "daily-digest",
      "cronExpression": "0 9 * * *",
      "timezone": "America/New_York",
      "message": "Summarize yesterday'\''s activity.",
      "threadMode": "rolling"
    }'
  ```
</CodeGroup>

The cron expression is standard 5-field (minute granularity). The minimum interval is **one minute**; `timezone` is any IANA name (defaults to `UTC`).

## Thread modes

Pick how each run relates to the last when you create the schedule:

| Mode                   | Behavior                                                                                                                                                   |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `per_fire` *(default)* | A **new thread every run** — each run is independent. Overlapping runs are fine.                                                                           |
| `rolling`              | **One continuous thread** the schedule keeps appending to. If the previous run is still going, the next fire is skipped (no double-talking in one thread). |

## Manage schedules

<CodeGroup>
  ```bash CLI theme={null}
  runtools schedule list
  runtools schedule get <id>
  runtools schedule run <id>        # fire once, now
  runtools schedule runs <id>       # run history
  runtools schedule delete <id>
  ```

  ```typescript SDK theme={null}
  await rt.schedules.list();
  await rt.schedules.get(id);
  await rt.schedules.run(id);        // fire once, now
  await rt.schedules.listRuns(id);
  await rt.schedules.update(id, { enabled: false });  // pause
  await rt.schedules.delete(id);
  ```
</CodeGroup>

## Good to know

* **Runs as you.** A scheduled run executes with the permissions of whoever created the schedule and is billed to your org. If you lose access, the schedule is disabled.
* **Credit-aware.** A fire is skipped (not failed) when your org is out of credits.
* **Auto-disable.** After 10 consecutive failures (e.g. the agent was deleted) a schedule disables itself so it stops trying.
* **Missed runs are skipped**, not backfilled — if a fire time passes while nothing could run it, the schedule simply runs at the next scheduled time.

<Tip>
  Use the **Schedules** page in the dashboard for a visual cron builder, run history, and one-click pause / run-now.
</Tip>
