> For the complete documentation index, see [llms.txt](https://docs.ixhello.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ixhello.com/ixhc2/flows/flow-editor/flow-versioning-branch-based-history.md).

# Flow Versioning – Branch-Based History

### Overview

Flow Versioning – Branch-Based History keeps a structured version history of a flow. Every save and every import is recorded as a version in the format X.Y.Z. Versions are grouped into branches in the format X.Y. The active working copy of the flow is the tip of one branch, called the Current Working Version (CWV).&#x20;

Users can:&#x20;

* compare a historical version with the current working copy&#x20;
* restore a previous version&#x20;
* export a version to a portable **`yflow`** file&#x20;
* import a **`yflow`**  file into version history&#x20;

***

### What problem it solves

**1. Protects Work During Iteration**

* Flow designers can make changes with confidence, knowing that previous working states are preserved.
* Every save automatically creates a recoverable version, allowing users to revert if needed.

**2. Supports Parallel Development**

* Branches enable teams to maintain and develop multiple versions of a flow independently.
* This makes it easier to experiment with new changes while preserving existing work.

**3. Eliminates the Need for Manual Backups**

* Version history reduces the need to create duplicate flows for backup purposes.
* All changes are automatically tracked and stored within the versioning system.

**4. Enhances Recovery and Traceability**

* A complete version history provides visibility into the evolution of a flow.
* Users can review:
  * Who made changes
  * When changes were made
  * What changes were introduced
  * Which versions can be restored

This improves accountability, simplifies troubleshooting, and makes recovery from unintended changes much easier.

***

### Why use Flow Versioning

Flow Versioning helps teams manage flow changes safely and efficiently by maintaining a complete history of versions and branches.

#### Key Benefits

* **Protect Changes**\
  Every save creates a version, ensuring previous working states can be recovered if needed.
* **Restore with Confidence**\
  Easily roll back to an earlier version when a change causes issues or an older state needs to be revisited.
* **Compare Versions**\
  Review differences between historical versions and the Current Working Version (CWV) to understand what has changed.
* **Support Parallel Development**\
  Use branches to maintain multiple lines of development, such as testing new ideas while preserving a stable version.
* **Reduce Manual Backups**\
  Eliminate the need to create duplicate flows for backup purposes, as version history automatically preserves changes.
* **Improve Traceability**\
  Maintain a clear record of when changes were made, who made them, and which versions can be restored.
* **Enable Easy Sharing and Migration**\
  Export versions as **`.yflow`** files and import them into version history when needed.

Overall, Flow Versioning provides a safer, more organized way to manage flow development, track changes, and recover from mistakes.

***

### Core Concepts

#### 1. Version Format

Every saved or imported flow state is captured as a version using the X.Y.Z format.

* Example: 2.1.3
* Versions are grouped under a branch, identified by the X.Y format.
  * Example: 2.1
* The Final number (Z) represents a specific saved state or revision within that branch.

#### 2. Current Working Version (CWV)

The Current Working Version (CWV) is the active, editable version of a flow.

* Represents the latest version at the tip of the active branch.
* Serves as the primary working copy for ongoing development.
* The runtime executes the current working copy directly.

#### 3. Branches

Branches organize versions into separate lines of development.

* Enable teams to iterate and experiment without losing previous work.
* Preserve historical versions while allowing ongoing changes.
* Function as logical version paths rather than separate copies of a flow.

#### 4. Version Descriptions

Each version can include an optional description to provide additional context.

* Descriptions are free-text and intended for documentation purposes.
* They help users understand the purpose of a change or version.
* Descriptions do not affect flow behavior or versioning logic.
* Flow Versioning does not support named versions; versions are identified solely by their version number.

***

### How the feature works&#x20;

**1. Save behavior**&#x20;

* Every time a flow is saved, a new version is created.&#x20;
* The new version becomes the latest patch on the current branch.&#x20;

**2. Import behavior**&#x20;

* A '.yflow' file can be imported into a flow’s version history.&#x20;
* Importing creates a new version record.&#x20;
* Importing does not automatically replace the current working copy.&#x20;
* The imported version must be restored before it becomes active.&#x20;

**3. Compare behavior**&#x20;

* Users can compare any stored version against the current working copy.&#x20;
* This helps review differences before restoring a version.&#x20;
* Compare is part of the current feature scope.&#x20;

**4. Restore behavior**&#x20;

* Restoring a version does not switch the flow to that historical record directly.&#x20;
* Instead, the restored content is applied as a new patch on the current branch.&#x20;
* The working copy is replaced in place.&#x20;
* The system:&#x20;
  * Reuses the existing flowId&#x20;
  * Preserves node IDs&#x20;
  * Preserves integration IDs&#x20;
  * Does not remap those objects&#x20;

**5. Export behavior**&#x20;

* Any version can be exported to a portable '.yflow' file.&#x20;
* This allows movement, backup, or later import of a version snapshot.&#x20;

***

### User workflow&#x20;

**1. View version history**&#x20;

* Open the flow and access its version history.&#x20;
* Review versions organized by branch.&#x20;

**2. Review the current working version**&#x20;

* Identify the Current Working Version (CWV).&#x20;
* This is the active working copy currently being served by runtime.&#x20;

**3. Save changes**&#x20;

* Make edits to the flow and save.&#x20;
* Each save creates a new patch version on the active branch.&#x20;

**4. Compare a prior version**&#x20;

* Select a historical version and compare it against the current working copy.&#x20;
* Review differences before deciding whether to restore.&#x20;

**5. Export a version**&#x20;

* Select a version and export it as a '.yflow' file.&#x20;
* Store the file for backup, transfer, or future reuse.&#x20;

**6. Import a '.yflow' file**&#x20;

* Import a '.yflow' file into the flow’s version history.&#x20;
* The imported file becomes a version in history but does not replace the working copy immediately.&#x20;

**7. Restore a version**&#x20;

* Choose a version to restore.&#x20;
* The system restores that content as a new live patch on the current branch.&#x20;
* The working copy is updated in place.&#x20;

**8. Re-validate after restoring**&#x20;

* After restore, the flow is re-validated before continued use.&#x20;

***

### Restore Behavior

The Restore action allows you to revert a flow to the content of a previous version while keeping the flow's identity and configuration intact.

**What Restore Does**

When a version is restored:

* The content from the selected historical version is retrieved.
* That content is applied as a new patch version on the current branch.
* The current working copy is updated and replaced with the restored content.

This approach preserves version history while making the selected version's content the active working copy.

**What Restore Does Not Do**

Restore updates the flow's content only. It does not:

* Create a new flow
* Generate a new `flowId`
* Remap node IDs
* Remap integration IDs

The restored version remains associated with the same flow and existing resources.

**What Is Preserved**

During a restore operation, the following identifiers remain unchanged:

* Flow ID (`flowId`)
* Node IDs
* Integration IDs

Maintaining these identifiers ensures continuity across integrations, references, and runtime operations.

**Runtime Impact**

Because runtime execution uses the current working copy directly, a restore takes effect immediately after it is completed. Any new traffic routed to the flow will use the restored version.

For flows that are actively receiving live traffic, users should be notified before completing a restore operation.

{% hint style="info" %}
**Warning:** Restoring a version on a live-routed flow can immediately impact active traffic. Review the selected version carefully and ensure stakeholders are aware of the change before proceeding.
{% endhint %}

***

### Integration handling during restore

**1. If an integration definition has changed**&#x20;

* When a restored flow references an integration, whose definition has changed, the user chooses for each affected integration whether to:&#x20;
  * keep the current definition (default)&#x20;
  * or \*revert to the restored definition&#x20;

**2. Default behavior**&#x20;

* The default option is to keep the current integration definition.&#x20;

**3. Important warning**&#x20;

* Reverting an integration definition may affect other flows that use the same integration.&#x20;

**4. Missing references**&#x20;

* If references are missing, they are flagged during the restore process.&#x20;

**5. Validation step**&#x20;

* After restore, the flow is re-validated to detect any remaining issues.&#x20;

***

### Example use cases&#x20;

**1. Recover from a bad release**&#x20;

* A change introduces an issue into the working copy.&#x20;
* The team compares the current version with a prior stable version.&#x20;
* They restore the stable version.&#x20;
* The restore creates a new patch on the current branch and becomes active immediately.&#x20;

**2. Maintain separate lines of work**&#x20;

* One branch holds the current production-ready line.&#x20;
* Another branch can hold a new release path or design direction.&#x20;
* Teams can compare versions without duplicating the entire flow.&#x20;

**3. Import and activate a shared flow version**&#x20;

* A designer receives a '.yflow' file.&#x20;
* They import it into version history.&#x20;
* They review it and compare it to the working copy.&#x20;
* They restore it only when ready to make it active.&#x20;

***

### Example from the demo&#x20;

Complete flow of the Demo refer to this [document](/ixhc2/flows/flow-editor/set-variable-node.md)

1\. Save creates versions&#x20;

<figure><img src="/files/Olw2EjvCGlYtV2Km6Dlo" alt="" width="285"><figcaption></figcaption></figure>

* Each save creates a new version.&#x20;

<figure><img src="/files/pOr7H6lYNkHEUsFdehM0" alt="" width="289"><figcaption></figcaption></figure>

<figure><img src="/files/NCgiW4nmaUkUVYX1BpMr" alt="" width="370"><figcaption></figcaption></figure>

2\. Compare versions&#x20;

* Users can compare a historical version with the live/current version.&#x20;

<figure><img src="/files/GxnqGWy24r2UTImEm1Gq" alt="" width="283"><figcaption></figcaption></figure>

* The comparison highlights flow changes while hiding unchanged groups for readability.

<figure><img src="/files/H6mXzdWAMICZfLyVQ0du" alt=""><figcaption></figcaption></figure>

3\. Restore and staging behavior&#x20;

* The demo showed that older versions can be restored or staged through import before being made active.

<figure><img src="/files/mWR9MaAq7821N7Dgu2HP" alt="" width="375"><figcaption></figcaption></figure>

4\. Based on the current implementation:

* Only one version can be live at any given time.
* A version cannot be tested directly in isolation without first making it the active version.
* For isolated testing scenarios, users can export a flow as a **`.yflow`** file and import it into a separate environment or flow instance for validation and experimentation.

{% hint style="info" %}
**Note:** Exporting and importing a flow is currently the recommended approach when you need to evaluate a version without affecting the live flow.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ixhello.com/ixhc2/flows/flow-editor/flow-versioning-branch-based-history.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
