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

# Runs and Versions

> Activate published Workflow versions, start version-pinned runs, read their status, and cancel safely.

A Workflow run always executes one immutable published version. Draft edits and
later publications cannot change the source, bindings, or schemas underneath an
existing run.

## Active and pinned versions

The **active version** is the default selected for a new run. A caller may
request another published version, but the Workflow itself must still be
active.

At start, Noorle records the selected version and artifact on the run. That pin
is used for recovery, inspection, and child execution throughout the run's
lifetime.

## Start from the Portal

Open **Workflows → (workflow) → Runs**, select **Run**, choose a version, and
provide JSON input. The Portal opens the new run after it is accepted.

## Start through the Management API

```bash theme={"dark"}
curl -X POST "https://api.noorle.com/v1/workflows/${WORKFLOW_ID}/runs" \
  -H "Authorization: Bearer ${NOORLE_API_KEY}" \
  -H "Idempotency-Key: ${START_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"input":{"order_id":"4471"}}'
```

Omit `version` to use the active version, or include it beside `input`:

```json theme={"dark"}
{
  "version": 3,
  "input": { "order_id": "4471" }
}
```

The response contains the stable `run_id`. Retrying with the same
`Idempotency-Key` returns the same logical start; changing the key requests a
new run.

## Read status

```bash theme={"dark"}
curl "https://api.noorle.com/v1/workflows/${WORKFLOW_ID}/runs/${RUN_ID}" \
  -H "Authorization: Bearer ${NOORLE_API_KEY}"
```

The status response includes the run and Workflow IDs, status, pinned
`workflow_version`, timestamps, result or error when terminal, and pending-wait
details when parked.

| Product status | Meaning |
| - | - |
| **Pending** | Accepted by the Portal and not yet visible as active in the run projection |
| **Running** | Starting or executing an activation or external effect |
| **Waiting** | Durably parked on a timer, approval, signal, callback, or child Workflow |
| **Success** | Completed with a result |
| **Failed** | Could not start or terminated with a recorded failure |
| **Canceled** | Terminated after a cancellation request |

When status is **Waiting**, inspect the wait kind rather than guessing from the
status:

| Wait kind | What resolves it |
| - | - |
| `sleep` | Recorded timer |
| `approval` | Explicit approval decision |
| `signal` | Matching authenticated named signal |
| `callback` | Signed callback URL |
| `workflow` | Child Workflow completion |

## Inspect a run

The Portal run detail shows the pinned version, current wait, result or error,
usage, and the pinned execution outline. It also exposes the action relevant to
the current wait: approve or deny, deliver a named signal, read a callback path,
or cancel.

> [!NOTE]
>
> Step-by-step journal and executed-path detail are not yet projected into the
> Portal for ledger-backed runs. An empty **Journal / phases** section does not
> mean the Program did no work; use the authoritative run status, wait, result,
> and usage fields.

## Cancel a run

```bash theme={"dark"}
curl -X POST "https://api.noorle.com/v1/workflows/${WORKFLOW_ID}/runs/${RUN_ID}/cancel" \
  -H "Authorization: Bearer ${NOORLE_API_KEY}" \
  -H "Idempotency-Key: cancel-${RUN_ID}" \
  -H "Content-Type: application/json" \
  -d '{"reason":"No longer needed"}'
```

Cancellation is durable and monotonic. Reuse the same key when retrying the
request. A canceled run does not resume if a late timer, approval, signal, or
callback arrives.

## Recovery behavior

The durable runtime executes a Program in bounded activations. On recovery it
replays from the entrypoint against recorded effect and wait results. Completed
recorded effects are supplied from their durable memos instead of being
dispatched again, and an unresolved wait remains parked without keeping a guest
process alive.

This is why source and version pinning both matter: replay uses the same Program
artifact and the same resolved outcomes, not the current draft.

## Next

* [Approvals and signals](https://noorle.com/docs/run/workflows/human-in-the-loop.md)
* [Callbacks](https://noorle.com/docs/run/workflows/webhooks.md)
* [Authoring and publishing](https://noorle.com/docs/run/workflows/node-types.md)


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