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

# Schedules

> Start a workflow on a cron expression in a time zone.

```ts theme={null}
const schedule = await client.schedules.create({
  workflow: { app: "shop", name: "nightly-report" },
  cron: "0 2 * * *",
  timezone: "Europe/Berlin",
  externalId: "nightly-report",
});

await client.schedules.pause(schedule.id);
await client.schedules.resume(schedule.id);
await client.schedules.update(schedule.id, { cron: "0 3 * * *" });
await client.schedules.delete(schedule.id);
```

Over HTTP: `GET, POST /schedules`; `GET, PATCH, DELETE /schedules/{id}`;
`POST /schedules/{id}/pause` and `/resume`.

## Fields

| Field | Rule |
| - | - |
| `workflow` | `{ app, name }`; it may be registered later |
| `cron` | Five fields, no `TZ=` prefix |
| `timezone` | IANA name, default `UTC` |
| `overlap` | `skip` (default), `cancel_running` or `allow_all` |
| `missedFire` | `fire_once` (default) or `skip` |
| `externalId` | Your own id, unique in the project |
| `paused` | `true` creates it paused, default live; on `PATCH`, left out keeps the pause and sent sets it, as `POST /schedules/{id}/pause` and `/resume` do |

## Check an expression

`POST /cron_previews { cron, timezone?, count? }` answers `{ data: [...] }`,
the next fire times (at most 10), without creating anything.

A cron expression that does not parse is `422 cron_expression_invalid`; a time
zone that is not an IANA name is `422 timezone_invalid`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.