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

# Versions

> Every save creates a version. Compare any two, restore one, and see which version a run used.

Ingestly keeps a full history of a workflow's saved graphs. Open the **Workflow versions** drawer from the
[editor toolbar](/workflows/editor#workflow-versions) to browse that history, compare any two versions, and
restore an earlier one.

## How versions are created

A version is a snapshot of the saved graph. Ingestly creates one automatically every time you save, and in a
few other situations:

| Kind        | When it is created                                                                                                                                                                                                                                                      |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Auto**    | Every ordinary save from the editor                                                                                                                                                                                                                                     |
| **Manual**  | You click **Create version** and add a message, marking a deliberate checkpoint                                                                                                                                                                                         |
| **Restore** | You restore an earlier version. The restore itself becomes a new version, so the version you restored from is never rewound or removed                                                                                                                                  |
| **Copy**    | You [copy a workflow to another environment](/workflows/stages#copy-to-another-environment). Ingestly records the copied graph as a version on the target workflow, and, if the target already had a graph, a checkpoint of what was there before the copy overwrote it |

History is append-only. Nothing is ever rewound in place: restoring, copying, and saving all add a new entry
rather than editing an old one.

<Tip>Use **Create version** before a risky edit, a demo, or a release so you have a named checkpoint to come back to, separate from the automatic saves around it.</Tip>

### Graph revision

A graph revision is the exact configuration of nodes, edges, and node settings at one point in time. Every
version records the graph revision it captured, except the checkpoint Ingestly writes of a target's previous
graph before a copy overwrites it, which has no revision of its own. That is expected and does not affect
comparing or restoring the version.

## Comparing versions

The versions drawer lets you compare any two versions, or a version against the current saved workflow. Pick
a **from** side and a **to** side; the diff panel shows what differs between them (added, modified, and
removed nodes and edges).

Restoring always restores the **from** side. Selecting a version and clicking **Restore** replaces the
current draft with that version's graph and appends a new **Restore** version, so the restore itself is
reversible.

Use this to recover from a bad change, understand what shipped on a given date, or check what changed
between two checkpoints before deciding whether to restore.

## Retention

Ingestly prunes **Auto** versions over time so history stays useful without growing without bound:

* All **Auto** versions are kept for 30 days.
* After 30 days, one **Auto** version per day is kept.
* **Auto** versions older than 365 days are removed.

**Manual**, **Restore**, and **Copy** versions are never removed by retention, regardless of age. A version
that a run executed against is also never removed while that run still exists, even if it is an Auto version
past its normal retention window.

<Note>Retention only ever removes Auto versions on the schedule above. If you want a version to be kept indefinitely, use **Create version** to mark it Manual.</Note>

## Which version a run used

Every run pins to the version of the workflow that was current when it started. The run detail page shows a
**Ran on v{n}** badge; click it to open that version on the Versions page, compared against the current
saved workflow. If the workflow has changed since the run started, the run detail page shows a hint that
newer changes exist so you know the run is not reflecting your latest edits.

### The resume rule

A run always executes the version it started on, for its entire lifetime, no matter how many saves happen
in the meantime. This holds whenever a run pauses and later continues, including a pause for a
[review task](/reviews/introduction), a Wait, or a [breakpoint](/workflows/editor#breakpoints): the run
resumes on the same version it started on, not whatever is currently saved.

To run your latest changes instead:

* From a paused run in the builder's [debugger toolbar](/workflows/editor#debugger-toolbar), or from the
  run detail page, use **Restart here on latest**. It starts a new run pinned to the latest saved version,
  picking up from the paused node.
* Re-run the workflow from the start on a new document or from the workflow detail page; a fresh run always
  picks up the latest version.

A **Re-run this step** retry of a failed step is the one exception: it always picks up the latest saved
version rather than the version the original run used, and the run detail page shows which version it ran
on.

### Saving during an in-progress run

Saving while a run is in progress is safe. The editor shows a small **Run in progress on v{n}** indicator
while a run started from the version currently open is still running, so you know one is in flight. Saving
creates a new version as usual; the running run keeps executing its own pinned version and is not affected.

### Concurrent saves

If two people save the same workflow at the same moment, only one save succeeds. The other is rejected with
"The workflow was saved by someone else at the same moment. Save again." Reload to see the version that won
and reapply your change on top of it.

## Related

<CardGroup cols={2}>
  <Card title="Workflow editor" icon="diagram-project" href="/workflows/editor">
    Save, restore, and open the versions drawer
  </Card>

  <Card title="Workflow environments" icon="layer-group" href="/workflows/stages">
    Copying a graph between environments records Copy versions
  </Card>

  <Card title="Monitoring runs" icon="list-check" href="/runs/monitoring">
    See which version a run used from its run detail page
  </Card>

  <Card title="Breakpoints" icon="bug" href="/workflows/editor#breakpoints">
    Pause a run and restart it on the latest version
  </Card>
</CardGroup>
