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

# Flow Schedule

> Visual cron / interval / RRule builder for ir.schedule. Schedules are stored on the IR and fired by the built-in Flow Scheduler.

<Note>
  The Schedule tab edits `ir.schedule`; the built-in
  **[Flow Scheduler](/data/pipelines/flow-scheduler)** is what actually
  fires due pipelines — in-process every minute, no external cron
  required. Saving a schedule is enough for it to start firing on the
  next tick.
</Note>

The Schedule tab in the [Flow Editor UI](/data/pipelines/flow-editor-ui)
edits the optional `ir.schedule` field. It supports all three kinds the
[scheduleSchema](/data/transforms/pipeline-ir) accepts.

## Kinds

| Kind         | Editor surface                                | IR shape                                                           |
| ------------ | --------------------------------------------- | ------------------------------------------------------------------ |
| **cron**     | text input + 6 preset shortcuts + tz dropdown | `{ kind: "cron", expression: "0 9 * * 1", timezone: "UTC" }`       |
| **interval** | minutes input (1–1440 bounded)                | `{ kind: "interval", minutes: 15 }`                                |
| **rrule**    | RRule string + tz dropdown                    | `{ kind: "rrule", rrule: "FREQ=DAILY;COUNT=10", timezone: "UTC" }` |

## Cron presets

Built-in shortcuts in the cron editor:

* Every 15 minutes → `*/15 * * * *`
* Every hour → `0 * * * *`
* Daily at 09:00 → `0 9 * * *`
* Weekdays at 09:00 → `0 9 * * 1-5`
* Mondays at 09:00 → `0 9 * * 1`
* First of month 09:00 → `0 9 1 * *`

## "Next 5 fires" preview

Live preview block recomputes on every change. Backed by the
flow-schedule next-fire-times helper:

* **cron** uses `cron-parser` v5 with timezone support
* **rrule** uses `rrule` v2; honors recurrence-count and until-date stop conditions
* **interval** is pure arithmetic from `now`

Preview failures (bad cron expression, malformed rrule) surface as a
red error block with the underlying parser message — preserved via
`Error.cause`.

## Saving

Save → POST `/api/v1/pipelines/:id/ir` with the new IR (mutated
`schedule` field) → bumps IR version → version pill in the editor topbar
updates → preview re-loads from the new IR.

## Firing & related

* **Schedules fire automatically** via the built-in
  [Flow Scheduler](/data/pipelines/flow-scheduler) — in-process every
  minute, or drive `/api/v1/cron/flow-scheduler-tick` from your own
  orchestrator.
* **File-arrival deadlines** (`trigger.file_arrival.deadline.{windowMinutes,
  onMiss}`) are enforced by the same scheduler — see
  [Flow Scheduler → Deadline enforcement](/data/pipelines/flow-scheduler).
* A visual cron-spec dropdown ("every X minutes between 9-5 on
  weekdays") builder is planned; today, non-preset expressions are
  typed directly.
