# Waits and schedules

> Start a flow on a schedule, pause a run for a while or until a date, and know when to use the Wait node and when the Delay step.

Source: https://docs.go-lumen.ai/build/waits-and-schedules

A schedule starts a run at the times you choose. A wait pauses a run that is already going, for a length of time or until a date, and then carries on. Neither holds a worker or costs credits while it waits.

-   Any workspace
-   Console or YAML

## Start on a schedule

The **On a schedule** trigger starts one run each time its schedule fires. It carries no document, so the steps after it must not need an email or a file: add a step that fetches its data, or one that needs nothing. The run has three fields of its own: `run.trigger`, `run.startedAt` (the scheduled moment) and `run.date` (that day, in the schedule's time zone).

**Console:**

1.  In the editor, click the trigger and choose **On a schedule** (or **Change** on an existing one).
2.  Under **How often**, choose **Every day**, **Every week**, **Every month** or **At intervals**.
3.  Choose the days and **At what time**. For **At intervals**, set every how many minutes or hours.
4.  Pick the **Time zone**. The default is your browser's.
5.  Optional: under **Active from / until**, set the first and last day it may fire. Leave either end empty to keep it open.
6.  Check **Next runs**, which lists the next fires in that time zone and about how many runs a month the schedule makes. Click **Done**.

![The schedule trigger panel. How often is set to Every week with Sun selected under On which days. At what time reads 08:00 and Time zone reads Asia/Jerusalem. Active from / until is empty, with the note Leave either end empty to keep it open. A Next runs box lists three Sundays at 08:00 and says About 4 runs a month.](https://docs.go-lumen.ai/img/build/waits-and-schedules-01-schedule.png)

*A weekly schedule. Next runs shows what the settings mean.*

In months with fewer days, a monthly schedule runs on the last day of the month.

**YAML:**

Set exactly one of `cron` and `every`.

| Setting | Meaning |
| --- | --- |
| `cron` | A five-field cron line, read on the wall clock in `timeZone`. Lists, ranges and steps work: `*/20 8-9 * * 1-5`. |
| `every` | An interval, `{value: 15, unit: minutes}`. Unit is `minutes` or `hours`; value is from 1 up to 1440 minutes or 24 hours. |
| `timeZone` | An IANA zone such as `Asia/Jerusalem`. Unset is UTC. |
| `startDate`, `endDate` | The first and last day it may fire, `YYYY-MM-DD` in `timeZone`. Both optional. |

```yaml title="digest.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: waits-digest
  namespace: tenant-acme
spec:
  displayName: Twice-weekly digest
  triggers:
    - id: twice-weekly
      title: Mondays and Wednesdays at 09:30
      ref: {name: on-schedule}
      config:
        cron: "30 9 * * 1,3"
        timeZone: Asia/Jerusalem
        startDate: "2026-11-01"
        endDate: "2027-10-31"
      next: [notify]
    - id: often
      title: Every 15 minutes (disabled while testing)
      ref: {name: on-schedule}
      config:
        every: {value: 15, unit: minutes}
      disabled: true
      next: [notify]
  nodes:
    - id: notify
      stepRef: {name: notify-in-app}
      config:
        to: admins
        title: Digest time
```

### How the clock behaves

-   **Intervals count from midnight** in the time zone and start over each midnight. Every 4 hours is 00:00, 04:00, 08:00. Every 5 hours is 00:00, 05:00, 10:00, 15:00, 20:00, then 00:00 again.
-   **Cron with both a day of the month and a weekday** matches either, as in cron.
-   **Daylight saving.** A time that does not exist (02:30 when clocks go forward) fires once, an hour later by the clock. A time that happens twice (02:30 when clocks go back) fires once, the first time.
-   **Missed time is not a backlog.** After an outage, a schedule fires once, for the newest moment it missed, and only if that moment is less than a day old.
-   **One run per fire, exactly once.** Restarts and failovers do not start the same moment twice.
-   **A new or edited schedule starts from now.** A suspended flow fires nothing, and switching it back on does not replay what it skipped. The same holds for a disabled trigger.
-   **Cost.** There is no minimum interval. Each run costs credits like any run, and extra runs queue behind your plan's parallel-run limit. They are never dropped.

## Pause a run with a wait

A **Wait** node pauses the run, then goes on to its next node. Set exactly one of:

| Mode in the console | YAML | Waits |
| --- | --- | --- |
| **For a while** | `for: 48h` | A length of time. |
| **Until a time** | `until: "2026-12-24T09:00:00+02:00"` | A fixed moment, as an RFC 3339 time. |
| **Until a date** | `until: invoice.dueDate` | The moment held in a date field an earlier step or the trigger produced, written `<node>.<field>`. |

**Console:**

1.  Hover the line where the pause belongs and click the **+**.
2.  Choose **Wait**.
3.  Choose **For a while**, **Until a time** or **Until a date**.
4.  For a while: set **How long** and the **Unit** (minutes, hours or days). For a time: pick a date and time; it is read in the schedule's time zone, or your browser's. For a date: pick the **Date field**.
5.  Click **Done**.

![The Wait panel. Under Duration, three options: For a while (selected), Until a time and Until a date. How long reads 1 and Unit reads hours. A note below says Pauses the run, then carries on with the next step.](https://docs.go-lumen.ai/img/build/waits-and-schedules-02-wait.png)

*A new Wait defaults to one hour.*

> **Leave Offset empty:**
> 
> Under **Until a date**, the panel shows an **Offset (optional)** field. A saved Wait has no offset, so do not rely on it. To wait until two days after a date, wait until the date, then add a second Wait for `48h`.

**YAML:**

A wait node has [`wait`](https://docs.go-lumen.ai/reference/nodes/wait.md) instead of `stepRef`, and no `config`.

```yaml
- id: pause
  wait: {for: 48h}
  next: [follow-up]
```

`for` is a duration written with `m` and `h`, such as `30m`, `48h` or `1h30m`. Days are written in hours (`72h`).

What to know about a wait:

-   **How long.** The shortest is one minute (a shorter duration is rounded up to a whole minute). The longest is 90 days.
-   **A date in the past does not wait.** The run goes straight on. A date with no time of day, such as `2026-12-24`, means the start of that day in UTC, so give a full time with an offset when the hour matters.
-   **Nothing is held.** The run is parked and picked up again when its time comes. A wait of days uses no worker and costs nothing while it waits.
-   **A wait is part of the run.** The run stays open, and the steps after the wait run on the same documents and fields as before it.

### A complete example

An invoice webhook sends an invoice number and a due date. The flow tells the team it arrived, waits until the due date, then tells the admins it is due.

```yaml title="invoices-hook.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Connector
metadata:
  name: waits-invoices-hook
  namespace: tenant-acme
spec:
  classRef: {name: webhook}
  config: {signature: none}
```

```yaml title="due-date-reminder.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: waits-due-date-reminder
  namespace: tenant-acme
spec:
  displayName: Remind the team when an invoice is due
  triggers:
    - id: invoice
      ref: {name: webhook-received}
      connectorRef: {name: waits-invoices-hook}
      config:
        mapping:
          - {name: number, type: string, jsonPath: $.invoice.number}
          - {name: dueDate, type: date, jsonPath: $.invoice.dueDate}
      next: [received]
  nodes:
    - id: received
      stepRef: {name: notify-in-app}
      config:
        to: members
        title: Invoice received
        body: "Invoice {invoice.number} is due {invoice.dueDate}."
      next: [hold]
    - id: hold
      title: Wait for the due date
      wait: {until: invoice.dueDate}
      next: [due]
    - id: due
      stepRef: {name: notify-in-app}
      config:
        to: admins
        title: Invoice due today
        body: "Invoice {invoice.number} is due."
```

## Wait node or Delay step

The catalog also has a **Delay** step in the **Logic** group. It pauses the run the same way and has the same 90-day limit. The difference is how you set it:

|  | Wait node | Delay step |
| --- | --- | --- |
| Added from | **Wait** in the **+** menu | **Action**, then **Logic** |
| Length | `for: 48h` (any length of minutes or hours) | **For** an amount and a unit of minutes, hours or days |
| Until | A fixed time, or a date field `<node>.<field>` | **Until**, a time or date, which may hold a placeholder such as `{invoice.dueDate}` |

Both behave the same at run time. Prefer the Wait node: it is the one with `for` and `until` in YAML, and it is drawn as a control node on the canvas, not as a step.

## Next steps

[TriggersEvery way to start a flow, and how to switch one off.](https://docs.go-lumen.ai/build/triggers.md)[Branches and filtersCheck a condition after a wait, then choose a path.](https://docs.go-lumen.ai/build/branches-and-filters.md)[Runs and retriesSee a waiting run, and what its status says.](https://docs.go-lumen.ai/operate/runs-and-retries.md)[Credits and budgetsWhat a scheduled flow costs over a month.](https://docs.go-lumen.ai/concepts/credits-and-budgets.md)
