# Manage versions and deployments

import { Steps } from "@astrojs/starlight/components"

A **version** is an immutable snapshot of a flow (steps, links, settings, and triggers at that moment). You create
snapshots before risky edits, browse history, and restore a past version into the designer. A **deployment** is the
runnable instance of a flow in an environment, pinned to **latest** (always follows new changes) or to a **named
version**. Screenshots on this page show creating a version, the versions list, restore confirmation, and the deploy
dialog.

## When to use

- You are about to change a production-critical flow and want a restore point.
- You need to see which snapshot an environment runs, or move a tested named version into production.
- Prefer keeping **latest** on development environments and named versions on production when stability matters more
  than continuous updates.

Before you begin, you need permission to edit the flow and to deploy it to the target environment. Creating the first
version usually happens when you deploy; you can also create named versions from the designer.

## Guide

### Browse versions and create a snapshot

**Browse versions** opens the versions explorer: a chronological list of snapshots (who created them and when). From
there you can **Create a new version** (modal title **Create a version**) to save the current flow configuration. After
you create a snapshot, you can change only its name and description—not the technical configuration.

<ol>
<li>

**Browse versions.** In the designer, open the overflow menu (⋯) and choose **Browse versions**.
<div class="docs-screenshot-compact">

![Designer overflow menu with Browse versions on a flow canvas](./assets/designer-overflow-menu-browse-versions-flow.png)

</div>

</li>
<li>

**Create a new version.** In the versions explorer, choose **Create a new version**, enter a name and optional
description, then confirm.
<div class="docs-screenshot-compact">

![Versions browser listing named snapshots with creator and timestamp](./assets/versions-browser-listing-named-snapshots-creator.png)

</div>

</li>
</ol>
### Restore a version

**Restore this version** replaces the current designer configuration with the selected snapshot.

<ol>
<li>

**Select a version.** In **Browse versions**, pick the snapshot you want.

</li>
<li>

**Restore this version.** Choose **Restore this version**. Confirm only after you accept that unsaved designer changes
will be overwritten.
<div class="docs-screenshot-compact">

![Restore confirmation that restoring a version overwrites unsaved workspace changes](./assets/restore-confirmation-restoring-version.png)

</div>

</li>
</ol>
### Deploy a flow to an environment

From **Flows**, **Deploy flow…** opens **Deploy your flow**. You pick the **Environment** and **Version**. Choosing
**latest** means each run uses the newest changes. Choosing a named version freezes that environment on that snapshot
until you deploy again.

<ol>
<li>

**Open Deploy flow.** On **Flows**, open the flow card menu (⋯) and choose **Deploy flow…**.
<div class="docs-screenshot-compact">

![Flows card menu with Deploy flow action](./assets/flows-card-menu-deploy-flow-action.png)

</div>

</li>
<li>

**Choose environment and version.** In **Deploy your flow**, select the **Environment** and **Version** (**latest** or
a named snapshot such as a release label), then **Deploy**. When you deploy to a new environment, re-assign credentials
used in the flow.
<div class="docs-screenshot-compact">

![Deploy your flow modal with Environment and Version set and Deploy button](./assets/deploy-your-flow-modal-environment-version.png)

</div>

</li>
</ol>
## Example

A builder opens **Browse versions** on **Enrich phishing URL**, creates **v1-prd**, then keeps development on
**latest**. After staging validation, they open **Deploy flow…**, select **Prod**, choose **v1-prd**, and deploy. If a
later edit misbehaves in the designer, they **Browse versions** again and **Restore this version** for **v1-prd**
instead of reconstructing the graph by hand.

## Keep in mind

- Restoring a version overwrites unsaved changes in the current designer session.
- **latest** is best when environments should follow continuous updates; named versions are better for production
  stability and auditability.
- If you cannot see versions or restore, check your permissions and that the flow has been deployed at least once.

## Related

- [Inspect flow logs](../logs/)
- [Operate](../)
