# Runs and versions

> What each run status means, how to read Run History, what the timeouts and On node failure do, and how versions and main decide what a run executes.

Source: https://orbitalaip.com/docs/workflows/runs-and-versions

## Run statuses

Every run carries one status:

- **pending**: the run is queued and has not started.

- **running**: nodes are executing.

- **paused**: a node failed under **Pause on first failure**. **Resume** continues it.

- **awaiting approval**: the run waits for approval under **Needs your decision** in **Automations**; see [Run policy](https://orbitalaip.com/docs/workflows/schedules#run-policy).

- **completed**: every node finished.

- **failed**: a node failed, or the run timed out.

- **cancelled**: stopped by **Stop** or **Force cancel** in the editor, or because its deployment was paused or stopped.

- **skipped**: the run started and found nothing to do.

Skipped is not a failure. A run skips when each failed node had nothing to work on, such as a missing symbol, an empty watchlist or an app turned off in the project. If any other node fails, the run is failed.

## Run History

**Run History**, the clock button in the toolbar, opens a side panel of this workflow's runs, newest first. Each row shows the status, any error, the duration, when it finished, and a word for what started the run:

- manual: **Run** in the editor, or chat.

- schedule, webhook or event (a signal).

- batch or episode: a dashboard's **Run watchlist** or **Run all**. Each is an ordinary run of main; see [Run workflows and batch runs](https://orbitalaip.com/docs/dashboards/overview#run-workflows-and-batch-runs).

- sub-workflow: a **Run workflow** node.

1. **Expand a run**
   
   Click its row. It opens with the **Run id** and **Nodes**: each node with its status, duration and any error.

2. **Click View on canvas**
   
   The nodes take on that run's state and the **Console** opens with its outputs.

## Run and node timeouts

1. **Open the settings**
   
   Click the gear at the right of the toolbar (**Settings**). **Workflow Settings** opens.

2. **Set the budgets**
   
   Under **Wall-clock timeouts**, **Run timeout (minutes)** caps the whole run (default 60), and **Node timeout (minutes)** caps any one node (default 10). Each takes 1 to 1440.

3. **Choose what a failure does**
   
   Pick an option under **On node failure**.

4. **Click Save**
   
   The toast reads **Timeouts saved**.

A run copies these settings when it starts, so a change never touches a run in flight. A run that passes its budget fails, and so does a node that passes its own; see [A run timed out](https://orbitalaip.com/docs/workflows/troubleshooting#a-run-timed-out).

After a node fails, **On node failure** decides the rest:

- **Continue (current behavior)**: nodes that depend on the failed one are skipped; independent branches keep running.

- **Halt on first failure**: everything still to run is marked skipped and the run ends as failed.

- **Pause on first failure**: the run pauses, and a banner reads **Run paused at** and the node's id. **Resume** reruns the failed node from the version the run started with and reuses the outputs of the nodes before it.

## Versions

The row under the toolbar names the [version](https://orbitalaip.com/docs/glossary#version) the canvas holds:

- **v3** with a **Main** badge: the main version, or with a **Make main** button when it is not main.

- **Edited**: changes no version has. **Save version…** sits beside it.

- **No versions**: nothing has been saved as a version yet.

1. **Click Save version…**
   
   Unsaved edits are saved first.

2. **Say what changed**
   
   Type a note in **What changed?**, up to 200 characters, or leave it blank.

3. **Click Save**
   
   The toast reads **Saved v4**.

Identical content never gets a new number: if the canvas already matches a version, the toast reads **No changes since v3**. Moving nodes or autosave makes no version. A [backtest](https://orbitalaip.com/docs/glossary#backtest) of code that has no version gives it one, so every backtest records the version it tested. A Program must be built before the workflow can be saved as a version.

**Versions** opens the list, newest first, with each version's note and who saved it and when; a version an agent saved reads **Agent**. Each row's **More** menu holds **Restore** and **Clone**.

## Main

Until a workflow has a [main](https://orbitalaip.com/docs/glossary#main), the next version you save becomes main on its own, with two exceptions:

- An enabled schedule, webhook or signal cannot run that version, because it needs an input that automation does not supply. Main waits, and the **Saved v1** toast says why: **Morning scan can't run v1.**

- The workflow is a Rules or Program strategy. Main starts at the first version whose backtest, run by a person, completes.

A version an agent saves, or an agent's backtest, never starts main.

After that, main moves only by **Make main**: from the bar, the **Versions** list or the strategy's page in Backtesting. Its toast offers **Undo** when there was a main before. **Make main** refuses for the same two reasons, and main stays where it was: **Morning scan can't run v4.** or **Backtest v4 first.**

What a run executes depends on what started it:

- **Run** in the editor, or chat: the canvas.

- A schedule, a signal monitor, an incoming webhook, a dashboard (a batch included), another workflow or an API key: main.

- A [deployment](https://orbitalaip.com/docs/glossary#deployment): the version it was deployed with; see [Deploy a strategy](https://orbitalaip.com/docs/trade/deploy-a-strategy).

A workflow with no main runs the canvas everywhere except in a deployment. Once it has one, an edit on the canvas changes nothing automated until you save a version and make it main.

## Restore and clone

**Restore** copies a version's graph onto the canvas, and main stays where it is.

**Clone** makes a new workflow from the version, named after this one with **copy** added, and opens it. It starts with no versions and no automations.
