# Schedules

import Screenshot from "@docs/Screenshot.astro"
import SurfaceTabs from "@docs/SurfaceTabs.astro"
import AskRen from "@docs/AskRen.astro"

A schedule is a recurring request to Ren, such as every weekday at 9am. Each run starts a new chat in the schedule's project automatically.

For example, a schedule can check your sales data every morning and update a dashboard [artifact](/docs/concepts/artifacts/), or summarize the week's support tickets every Friday afternoon.

In the API and CLI, a schedule is a `cronTrigger`.

## Create a schedule

| Setting  | What it does                                                                                                        |
| -------- | ------------------------------------------------------------------------------------------------------------------- |
| Message  | The request Ren receives on each run.                                                                               |
| Project  | Where each run's chat starts. The run uses the project's instructions, tools, and permissions.                      |
| Repeat   | **Every hour**, **Every day**, **Every weekday**, **Every week**, **Every month**, or **Custom cron**, with a time. |
| Timezone | The time zone the schedule follows. New schedules use your organization's time zone.                                |
| Until    | An optional end date, after which the schedule stops running.                                                       |
| Model    | An optional model for the runs. Without one, runs use the project's default model.                                  |

<SurfaceTabs>
<Fragment slot="app">

1. Open **Scheduled** in the sidebar and select **Create schedule**.
2. Enter the **Message**, like "Summarize yesterday's support tickets and post the top three issues."
3. Choose the **Project**.
4. Choose a repeat interval and time. For a custom schedule, select **Custom cron**. Enter a cron expression, such as `0 9 * * 1-5` for weekdays at 9am.
5. If you want, change the **Timezone**, set an **Until** date, or pick a **Model**.
6. Select **Create schedule**. The dialog shows when the next run is.

<Screenshot
  shot="schedules/drawer"
  alt="The New schedule dialog with message, project, repeat, time, timezone, and model filled in"
/>

</Fragment>
<Fragment slot="ask-ren">

<AskRen prompt="Run this every weekday at 9am Pacific time." />

Send this in a chat after Ren has done the work once.

</Fragment>
<Fragment slot="cli">

```sh
ren cron-triggers create <project-id> \
  --input-message "Summarize yesterday's support tickets." \
  --schedule "0 9 * * 1-5" \
  --timezone "America/Los_Angeles"
```

</Fragment>
</SurfaceTabs>

## Run history and limits

To find past runs, filter the sidebar's chat list by the **Scheduled** source.

Scheduled chats deny actions set to **Ask**. Set required actions to **Allow** in the project's [permissions](/docs/concepts/projects/#permissions).

If your organization runs out of credits, Ren pauses its schedules and skips their runs until credits are added.

## Edit, pause, resume, or delete a schedule

A paused schedule keeps its settings but doesn't run, and its card stops showing a next run time.

Pausing, editing, or deleting a schedule doesn't stop an active chat, and chats from earlier runs stay in the chat list.

<SurfaceTabs>
<Fragment slot="app">

Open **Scheduled** in the sidebar. Use **Filter schedules** to show only **Enabled** or **Paused** schedules. On the schedule's card:

- Select the edit button to change its settings, then **Save**.
- Select the pause button to pause it, or the resume button to resume it.
- Select the delete button, then **Delete** to remove it.

<Screenshot shot="schedules/list" alt="The Scheduled page with one active and one paused schedule" />

</Fragment>
<Fragment slot="ask-ren">

<AskRen prompt="Pause the daily support summary schedule." />

</Fragment>
<Fragment slot="cli">

```sh
ren cron-triggers update <project-id> <schedule-id> --is-enabled false
ren cron-triggers archive <project-id> <schedule-id>
```

</Fragment>
</SurfaceTabs>