# Runs, retries and history

> Read a run, stop one that has not ended, run it again on the flow as it is now or as it was, start from a single step, and understand why a run is on hold.

Source: https://docs.go-lumen.ai/he/operate/runs-and-retries

Every run of every flow is kept with what it received, what each step did and what it cost. This page shows how to read a run, stop one, run it again without repeating work that already succeeded, and what to do when a run is on hold.

-   Console and CLI
-   Cancel needs a workspace admin

## Find a run

In the console, open **Flows** and choose the **Runs** tab. Runs are listed newest first with their **Status**, **Flow**, **Trigger**, **Started**, **Duration** and **Credits**. A small lightning icon marks a run where Lumen saved model tokens (see [Billing and usage](https://docs.go-lumen.ai/he/operate/billing-and-usage.md#saved-by-lumen)). Use the filter button above the table to narrow by flow, status, dates or trigger, and click a row to open the run.

![The Runs tab of the Flows page. A table with columns Status, Flow, Trigger, Started, Duration and Credits. The first row is Running with a red stop icon at its end; the next rows are Success, Success, Error and so on, each with its flow name, trigger, how long ago it started, its duration and its credits.](https://docs.go-lumen.ai/he/img/operate/runs-and-retries-01-runs-tab.png)

*Flows, then Runs. A run that has not ended has a stop icon at the end of its row.*

From the CLI, `lumen get runs` lists runs and `lumen get runs RUN` shows one.

## Read a run

The run page answers four questions: what started it, what happened at each step, what it cost, and what it made.

![The Run detail page of a failed run. The summary card shows the flow handle-invoices, a link Flow revision #3, the run ID, the line Started by its email trigger, an Error badge and a Retry button with a small arrow beside it. Below it a table shows Queued, Started, Finished, Duration 31.0 s, Credits 1.1 and Documents 1. A red panel reads This run stopped, Step 1, Read the invoice, is where this stopped, and gives the reason. The run's canvas follows, with the first step marked in red and the later steps greyed out.](https://docs.go-lumen.ai/he/img/operate/runs-and-retries-02-run-detail.png)

*A failed run. The red panel names the step and the reason; the canvas shows how far it got.*

| Where | What it tells you |
| --- | --- |
| Summary card | The flow, the **Run ID**, what started it (a trigger, or somebody by hand), the status and, when there is one, the **Flow revision** the run used. |
| Timings | **Queued**, **Started**, **Finished** and **Duration**. |
| **Credits** and **Documents** | What the run cost and how many documents it carried. |
| Canvas | The flow as this run saw it. Every step that ran shows a check and its duration, and each edge shows how many documents went along it. Steps on a path that was not taken are greyed out. |
| **What it found** | The fields the flow's AI steps pulled out, when there are any. |
| **Files** | Files the run made, with a **Download** button each. |
| **This run stopped** | On a failed run: the step it stopped at and the reason. |

Click a step on the canvas to open its **Input** and **Output**: the documents it received and the documents it made. A step that ran more than once, as on each item of a list, shows each visit.

**Flow revision** opens the flow's history at the version the run used, so you can see exactly what had been saved when the run started, even if the flow has changed since.

### Runs that belong together

Runs can point at each other, and the run page links them:

-   **Retry of** and **Retried as** connect a run to the run it reproduced, and back.
-   **Started from step 2, "Name it by supplier and date"** says a run began part-way through another run.
-   **Started by the flow ...** links a run to its parent when a [Run another flow](https://docs.go-lumen.ai/he/build/run-another-flow.md) step started it. The parent lists the runs it started.
-   When one email or upload started several runs, a switcher moves between them: **This email or upload started 3 runs**.

## Cancel a run

A run that has not ended can be stopped: queued, running, waiting for an answer, or on hold. Only a workspace admin can cancel. A run that has already ended is left as it is.

**Console:**

1.  Open the run, or find it in the **Runs** tab. Click the stop icon (**Cancel this run**).
2.  Optionally write a **Reason**. It is shown on the run.
3.  Click **Cancel the run**.

![The Cancel this run dialog. It says the run stops where it is, that a running step is stopped, an approval or question it waits for is closed, no reminder is sent, and that this cannot be undone. A Reason (optional) text box and two buttons, Keep it and Cancel the run.](https://docs.go-lumen.ai/he/img/operate/runs-and-retries-05-cancel.png)

*Cancelling asks once. The reason is optional and stays with the run.*

**CLI:**

```bash title="Cancel a run, with a reason"
lumen cancel run 87912742-2bba-5bfa-b40d-9b6fd7a81d76 --reason "the supplier withdrew the invoice"
```

An API key can cancel too, when it has the admin scope.

The run ends as **Cancelled**; hover the status to see who cancelled it, when, and why. What happens to what the run was waiting on:

-   A step a worker is running is stopped.
-   An approval form or an email question the run was waiting for is closed and no longer takes an answer. Its reminders are never sent.
-   A file the run had locked goes to the next run waiting for it.

Cancelling does not undo what a finished step already did. An email it sent stays sent.

## Retry a run

Retry starts a new run on the same documents. It is available on a run that has ended, and not on a test run. The new run is linked to the old one.

1.  Open the run and click **Retry** to run it on the flow as it is now. Or use the arrow beside it (**More ways to retry**) and choose **Retry with the original version** to run it on the flow exactly as the original run had it.
2.  If any step would send or save something outside Lumen again, a dialog asks first (below).
3.  The console opens the new run.

Use the current flow when you fixed the flow after the failure. Use the original version to see whether a failure repeats, or to reproduce what happened.

The console and the API can retry. The CLI cannot: `lumen run` always starts a new run, not a retry of an old one.

### Steps with side effects

A step that changes something outside Lumen, like sending an email or saving a file to a connection, does it again if it runs again. Before the new run starts, Lumen names every such step it could reach, on any path, and asks what to do with each.

![A dialog titled Some steps would send or save something again. It says 1 step would send or save something again and explains that Preview only is the default. One step is listed, File it away (save-file), with the line Would save the file again, a Preview only and Run for real choice with Preview only selected, and the note Dry run, sends nothing. Buttons Cancel and Run again.](https://docs.go-lumen.ai/he/img/operate/runs-and-retries-03-retry-side-effects.png)

*Preview only is the default. Pick Run for real only where you mean it.*

-   **Preview only** (the default) is a dry run: the step shows what it would send, save or call, does none of it, and passes its input along unchanged. The step is tagged **Dry run** on the new run.
-   **Run for real** does it again.

Click **Run again** to start. Nothing outside Lumen happens until you choose it.

## Run from a step

When the early steps worked and a later one failed, you do not need to repeat the early ones.

1.  Open the run and click the step to start from.
2.  Click **Run from here** at the top of the step's panel.
3.  Answer the side-effects dialog if it appears.

![The side panel of the step Name it by supplier and date, marked Done. A Run from here button is at the top right. Two tabs, Input and Output, with Output selected, show one document and a Files list holding one PDF with Preview and Download buttons.](https://docs.go-lumen.ai/he/img/operate/runs-and-retries-04-run-from-here.png)

*Run from here is at the top of any step's panel.*

The new run starts at that step. Every earlier step is not run again: its output is copied from the original run, it costs no credits, and it is tagged **Reused**. From the chosen step on, the run is a normal one.

Run from here uses the flow as it is now. If a step before the one you chose has changed since the original run, Lumen refuses, because the copied output would not be what the flow makes today. Use **Retry** instead.

## Held runs

A run can be admitted and still not start. It then shows **On hold**, with a message. No worker picks it up, and it goes on by itself when the reason clears. You can cancel a held run if you no longer want it.

| Reason | What clears it |
| --- | --- |
| The flow or the workspace reached its monthly credit budget | The month turns over, or the budget is raised or removed. See [Billing and usage](https://docs.go-lumen.ai/he/operate/billing-and-usage.md#budgets). |
| Another run holds a lock on a file this flow declares | That run ends. The run page says **Waiting for** the file and links to the run that holds it. Runs that update the same file go one at a time, oldest first. |

The same state is reserved for a workspace that has no credits left and for a plan that does not allow a run to start, such as an ended trial. In those cases the message on the run says why.

## History and retention

A run's page stays available after it ends, with its steps, timings and credits. The files a run made are kept for 365 days. After that the run still shows its steps, and the file reads **File no longer available**. Lumen is not an archive, so keep your own copy of anything you must not lose.

The notifications bell keeps each notification for 90 days.

## Next steps

[When a run failsDecide what a flow does on an error, so fewer runs need a retry.](https://docs.go-lumen.ai/he/build/when-a-run-fails.md)[AlertsBe told when a run fails or spending jumps.](https://docs.go-lumen.ai/he/operate/alerts.md)[Billing and usageRead and control what runs cost.](https://docs.go-lumen.ai/he/operate/billing-and-usage.md)[Audit logSee who retried, cancelled or changed what.](https://docs.go-lumen.ai/he/operate/audit-log.md)
