# Process flow versioning

## Introduction

With our process flow versioning system, you can be sure that a process flow that's currently deployed will never be edited while it's in use:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F5gASA62VmMmZboDTh2kz%2Fversions%20panel.png?alt=media&#x26;token=952f8e07-1e34-42cc-91ef-00b58ae75925" alt=""><figcaption></figcaption></figure>

To edit a deployed process flow, you take a copy as a [draft](#draft) and work on that. When you're ready, you can then [deploy your draft](https://doc.wearepatchworks.com/product-documentation/process-flows/managing-process-flows/flow-deployment/deploying-a-process-flow-with-virtual-environments). Each time you deploy a process flow, the previously deployed version is saved as an [inactive](#inactive) version. You can [view all versions associated with a process flow in process flow settings](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-versioning/accessing-process-flow-versions).

{% hint style="info" %}
For any process flow, there's always one [draft version](#draft), one [deployed version](#deployed), and any number of [inactive versions](#inactive).
{% endhint %}

{% hint style="warning" %}
If [virtual environments](https://doc.wearepatchworks.com/product-documentation/virtual-environments) are in use for your organisation, process flow versioning works differently. Please refer to [Understanding flow versioning for virtual environments](https://doc.wearepatchworks.com/product-documentation/virtual-environments/implementing-virtual-environments/deploying-a-single-process-flow-to-a-virtual-environment/understanding-flow-versioning-for-virtual-environments).
{% endhint %}

## Version types summary

At any given time, a process flow can be associated with one of the following version types:

<table data-full-width="false"><thead><tr><th width="153.6171875">Version</th><th width="344.38671875">Is set when...</th><th>Can edit?<select><option value="3pI5LpsxEQxa" label="yes" color="blue"></option><option value="gS2TmLOUkvxc" label="no" color="blue"></option></select></th><th>Can delete?<select><option value="nW3mF1SdBZBt" label="no" color="blue"></option><option value="HKa4OZjvHzML" label="yes" color="blue"></option></select></th></tr></thead><tbody><tr><td><a href="#draft">Draft</a></td><td><ul><li>A new process flow is added</li><li>A <code>deployed</code> version is copied to draft</li><li>An <code>inactive</code> version is copied to draft</li></ul></td><td><span data-option="3pI5LpsxEQxa">yes</span></td><td><span data-option="nW3mF1SdBZBt">no</span></td></tr><tr><td><a href="#deployed">Deployed</a> </td><td><ul><li>A <code>draft</code> version is deployed</li><li>An <code>inactive</code> version is deployed</li></ul></td><td><span data-option="gS2TmLOUkvxc">no</span></td><td><span data-option="nW3mF1SdBZBt">no</span></td></tr><tr><td><a href="#inactive">Inactive</a> <br></td><td><ul><li>A <code>draft</code> process flow is deployed, replacing an existing deployment </li><li>An <code>inactive</code> process flow is deployed, replacing an existing deployment </li></ul></td><td><span data-option="gS2TmLOUkvxc">no</span></td><td><span data-option="HKa4OZjvHzML">yes</span></td></tr></tbody></table>

## More about version types

* [Draft](#draft)
* [Deployed](#deployed)
* [Inactive](#inactive)

### Draft&#x20;

There is always one `draft` version of a process flow. The `draft` version can be edited freely without any possibility of changing or breaking the version that's currently [deployed](#deployed). With a `draft` version, you can add/update [shapes](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes) and [process flow settings](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-settings). &#x20;

{% hint style="info" %}
Any [trigger shape](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/trigger-shape) settings defined for a `draft` version are ignored.  A `draft` version is never triggered to run automatically.
{% endhint %}

#### Available actions

You can take the following actions with a `draft` version of a process flow:

<table><thead><tr><th width="248.6953125">Action</th><th>Summary</th></tr></thead><tbody><tr><td><a href="../managing-process-flows/duplicating-a-process-flow">Duplicate</a></td><td>Create a new process flow from the selected <code>draft</code> version. There is no impact on the <code>draft</code> version.</td></tr></tbody></table>

### Deployed&#x20;

The `deployed` version of a process flow is the one that's currently in use (if `enabled`) or ready for use (if it's `disabled`).

The `deployed` version of a process flow cannot be edited - [shapes](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes) can't be added/updated, and you can't change [process flow settings](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-settings).&#x20;

#### Available actions

You can take the following actions with a `deployed` version of a process flow:

<table><thead><tr><th width="248.6953125">Action</th><th>Summary</th></tr></thead><tbody><tr><td><a href="../managing-process-flows/duplicating-a-process-flow">Duplicate</a></td><td>Create a new process flow from the selected <code>deployed</code> version. There is no impact on the <code>deployed</code> version.</td></tr><tr><td><a href="process-flow-versioning/copying-an-existing-process-flow-version-to-draft">Copy to draft</a></td><td>The process flow remains <code>deployed</code> and the content is copied to the existing <a href="#draft">draft</a> version (existing <code>draft</code> content is discarded). This is a good solution if you're editing a <code>draft</code> but reach the point where you need to restart from a known, sound point.</td></tr><tr><td><a href="../../marketplace/private-marketplaces/uploading-private-marketplace-resources/uploading-process-flows-to-your-private-marketplace">Upload to marketplace</a></td><td>Upload the selected version to your <a href="../../marketplace/private-marketplaces">private marketplace</a> (only applicable if the <a href="../../../getting-started/core-subscription-tiers#about-the-partner-features-bolt-on">partner features bolt-on</a> is enabled for your company profile).</td></tr></tbody></table>

### Inactive&#x20;

Each time a `draft` version of a process flow is [deployed](#deploying-a-draft-version), the previously deployed version becomes an `inactive` version, so you have a full version history for all deployed versions of a process flow.

An `inactive` version of a process cannot be edited - [shapes](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes) can't be added/updated, and you can't change [process flow settings](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-settings).&#x20;

#### Available actions

You can take the following actions with an `inactive` version of a process flow:

<table><thead><tr><th width="248.6953125">Action</th><th>Summary</th></tr></thead><tbody><tr><td><a href="../managing-process-flows/duplicating-a-process-flow">Duplicate</a></td><td>Create a new process flow from the selected <code>deployed</code> version. There is no impact on the <code>deployed</code> version.</td></tr><tr><td><a href="process-flow-versioning/copying-an-existing-process-flow-version-to-draft">Copy to draft</a></td><td>The process flow remains <code>inactive</code> and the content is copied to the existing <a href="#draft">draft</a> version (existing <code>draft</code> content is discarded). This is a good solution if you need to revert to an old way of working.</td></tr><tr><td><a href="process-flow-versioning/deleting-an-inactive-process-flow-version">Delete</a></td><td>Whilst it's often useful to refer back to an <code>inactive</code> version of a flow for a reminder of how things used to be set up, retaining lots of process flows with multiple <code>inactive</code> versions can be detrimental to system performance. In this case, deleting older <code>inactive</code> versions is a useful housekeeping task.</td></tr></tbody></table>
