# Schedules

> Run a workflow at set times: calendar or exchange timing, run times in a time zone, the run policy, and the version every scheduled run uses.

Source: https://orbitalaip.com/docs/workflows/schedules

## Where schedules live

A schedule is one of three automations that start a workflow without a click; [Webhooks and signals](https://orbitalaip.com/docs/workflows/webhooks-and-signals) covers the other two.

In the editor's top bar, **Automations** (the lightning button) opens **What starts this workflow**, the list of every automation. **Add automation** asks **How should this workflow start?** and offers three cards, **Schedule**, **Monitor a signal** and **Incoming webhook**, each with a **Configure** button.

## Create a schedule

1. **Open the automations**
   
   Click **Automations** in the editor's top bar, then **Add automation** if it lists automations already.

2. **Choose Schedule**
   
   Click **Configure** on the **Schedule** card.

3. **Name it**
   
   **Name** is optional, up to 120 characters.

4. **Pick the timing**
   
   **When should it run?** offers **Calendar timing**, **XNYS trading days**, **XNYS market hours**, **Market open** and **Market close**. XNYS is the New York Stock Exchange calendar.

5. **Set the pattern**
   
   With **Calendar timing**, **Repeat** is **Weekdays**, **Every day**, **Weekly** or **Advanced**. **Weekly** adds a **Day of week**, and **Advanced** replaces the run times with a **Cron expression**.

6. **Add the run times**
   
   Unless you chose **Advanced**, **Market open** or **Market close**, set each time under **Run times**; **Add time** adds another. A schedule holds up to 20 run times, and a duplicate must be removed before saving.

7. **Choose the time zone**
   
   **Time zone** starts on your device's zone and follows daylight-saving changes on its own. **Search time zones…** finds any region.

8. **Supply run inputs, if the workflow needs them**
   
   A workflow that requires tickers shows **Run inputs**. Only values the workflow confirms can be saved, and they are handed to every run. A workflow that requires any other kind of input cannot be scheduled from this form.

9. **Save**
   
   Check the **Run policy**, then click **Activate schedule**. The row reads **Pending** while the scheduler registers it, then **Active**.

## Timing

- **Calendar timing**: the run times on the days **Repeat** names, in the schedule's **Time zone**. **Weekdays** means Monday to Friday and does not know exchange holidays.

- **XNYS trading days**: the run times on exchange trading days, judged by the date in New York. Weekends and exchange holidays are skipped. A time outside the session, such as 07:00, still runs.

- **XNYS market hours**: the run times on trading days, only while the regular session is open. Premarket, after-hours and time after an early close are skipped. The session ends just before the close, so a run time of 16:00 never runs.

- **Market open**: one run at the official opening bell, 09:30 Eastern Time, on each trading day.

- **Market close**: one run at the official close on each trading day. That is 16:00 Eastern Time, or 13:00 on a scheduled early close.

The two bell timings fix the time zone to **Eastern Time (New York)** and follow daylight-saving changes and early closes on their own. Once saved, a bell schedule keeps its timing; create another schedule to use a different one. If exchange calendar coverage is unavailable, the run is skipped rather than guessed.

**Advanced** takes a five-field cron expression: minute, hour, day, month and weekday. For example, `0 9 * * 1-5` is 09:00 on weekdays.

## Limits

- A run time's pattern may not repeat more often than every five minutes, so an **Advanced** expression such as `*/2 * * * *` is refused when you save.

- A run that would start more than five minutes late is skipped, not run late.

## Run policy

**Run policy**, under the timing, sets what happens when runs collide and how many may start.

**When a previous run is still active** has three choices. **Skip the new run** is the default. **Keep only the latest** waits for the active run, then uses only the newest pending run. **Queue every run** preserves every occurrence in order and can consume [credits](https://orbitalaip.com/docs/glossary#credits) quickly.

**Cooldown** is the minimum time between runs that start: **No cooldown** by default, then **1 minute** up to **1 day**.

**Maximum per hour** is a hard cap on runs that start in any rolling hour, 120 by default and at most 120. **Maximum per day** is an optional second cap of up to 2,880; tick the box beside its field to set it. A run that a cap or the cooldown refuses does not start, and its **Last outcome** reads **Rate limited**.

**Uncertain signals** applies to signal monitors. **Skip them** is the default. **Ask for review** holds uncertain matches for confirmation and switches on **Confirmation before every run**.

**Confirmation before every run** holds each run for an authorized person to approve before any credits are reserved. Held runs appear at the top of **Automations** under **Needs your decision**, each reading **Scheduled automation waiting to start** and **Awaiting approval**, with **Approve** and **Reject**. A request nobody decides within 24 hours expires.

## The version a schedule runs

Scheduled runs use the workflow's [main](https://orbitalaip.com/docs/glossary#main) version once it has one, and the canvas until then; see [Main](https://orbitalaip.com/docs/workflows/runs-and-versions#main).

> [!TIP] Edit without changing what runs overnight
> Save a version before you add a schedule, so the workflow has a main. Then edit and test on the canvas freely. The schedule keeps running main until you save a version and make it main.

A schedule is saved against the inputs the workflow requires. If they change under it, the schedule stops at its next run time. That happens after you resume a schedule that was paused while main moved, or edit the canvas of a workflow with no main. Its row shows **Needs attention**, and you get an **Automation stopped** notification. Edit the schedule and save it again with the inputs it now needs.

## Edit, pause and remove

Each row under **What starts this workflow** has **Edit**, a pause button and a trash button, which asks **Remove?** before **Remove** deletes it. **Edit** opens the same form with **Save changes**.

On a schedule with several run times, the chip that counts them, such as **3 times**, lists each time with its state, last outcome and next run. Each time has its own pause control.
