# Deploying a process flow (without virtual environments)

## Introduction

When a process flow is deployed and [enabled](https://doc.wearepatchworks.com/product-documentation/process-flows/managing-process-flows/enabling-and-disabling-a-process-flow/enabling-and-disabling-a-process-flow-without-virtual-enviroments), it runs automatically, according to defined [trigger shape](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/trigger-shape) settings (or [API requests](https://doc.wearepatchworks.com/product-documentation/developer-hub/patchworks-core-api)).&#x20;

Typically, you would build your required flow and then deploy the `draft` version however, it is possible to deploy an older, `inactive` version if needed.

{% hint style="info" %}
For detailed information about the different process flow versions that you may encounter, please see [Process flow versioning](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-versioning).&#x20;
{% endhint %}

{% hint style="warning" %}
If the [virtual environments](https://doc.wearepatchworks.com/product-documentation/virtual-environments/about-virtual-environments) feature is enabled for your company profile, the steps detailed on this page are different - please refer to [Deploying a single process flow to a virtual environment](https://doc.wearepatchworks.com/product-documentation/virtual-environments/implementing-virtual-environments/deploying-a-single-process-flow-to-a-virtual-environment).&#x20;
{% endhint %}

## Need to know

* A process flow can be deployed once. Each time you deploy a `draft` version, the current `deployed` version becomes `inactive`, making way for the new deployment.
* For a process flow to run automatically (based on any defined [trigger settings](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/trigger-shape)), it must be both deployed and [enabled](https://doc.wearepatchworks.com/product-documentation/process-flows/managing-process-flows/enabling-and-disabling-a-process-flow/enabling-and-disabling-a-process-flow-without-virtual-enviroments). If the [virtual environments feature is not enabled for your company profile](https://doc.wearepatchworks.com/product-documentation/process-flows/managing-process-flows/flow-deployment/..#how-do-i-know-if-virtual-environments-are-enabled), you must decide whether a deployed flow is enabled - this doesn't happen as part of the deployment process.&#x20;

## The steps

{% stepper %}
{% step %}
**Access version details for the required process flow**&#x20;

Open [settings](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-settings) for your process flow and scroll down to the `versions` panel.

{% hint style="info" %}
For detailed instructions, please refer to [Accessing process flow versions](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-versioning/accessing-process-flow-versions).
{% endhint %}
{% endstep %}

{% step %}
**Select the required version**

The currently selected version (i.e. the version displayed on the canvas) is shown with an 'eye' icon in the `selected` column. For example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FsMgE8sAj0nsEicvy7R78%2Fdeploy%20flow%20no%20ve%200.png?alt=media&#x26;token=2fb27dc9-57ee-4876-9855-ba6ce63438e0" alt=""><figcaption></figcaption></figure>

Click anywhere on the `draft` or `inactive` version you want to deploy and check that the canvas updates with the expected content. For example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FnC7PjPmlCsw7G3vLJb7n%2Fdeploy%20flow%20no%20ve%200%20b.png?alt=media&#x26;token=958b0053-14ce-4e32-832a-eb7b598ffbc2" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Deploy this version**

Click the `deploy` button (just above the `variables` section). For example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FjY7q54678NaVdYcvNi7C%2Fdeploy%20from%20button.png?alt=media&#x26;token=5a608c96-a88d-42b4-9a97-18473fd5fca1" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Alternatively, you can click the ellipses associated with your selected version. For example:

<img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FU6niuzZKlGqNQE7K1shZ%2Fdeploy%20flow%20no%20ve%201.png?alt=media&#x26;token=7ff77704-986b-4670-b649-c67ecb62552a" alt="" data-size="original">

Then select the `deploy` option. For example:

<img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FG2eGBhfhfZWL6wVoU584%2Fdeploy%20from%20ellipses.png?alt=media&#x26;token=a9165423-40bc-4516-b61b-29f0e8829d47" alt="" data-size="original">
{% endhint %}

The `draft` version transitions to `deployed` and the previously `deployed` version transitions to a new `inactive` version.&#x20;
{% endstep %}

{% step %}
**Check the enabled/disabled status**

Scroll up to the top of the settings panel and check how the `enabled` toggle option is set. For example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FXv2YhOPghK1eLx4OUKWK%2Fdeploy%20-%20check%20enabled.png?alt=media&#x26;token=7f8a989d-38bb-45bc-924c-ddf64d350790" alt=""><figcaption></figcaption></figure>

Set this option as required, bearing in mind:

* If this option is toggled `off`, the flow will NOT run according to any defined [trigger settings](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/trigger-shape) - it only runs if you choose to do so [manually](https://doc.wearepatchworks.com/product-documentation/process-flows/managing-process-flows/initialising-a-process-flow-manually) (useful if you are testing a flow).  &#x20;
* If this option is toggled `on`, the flow will run according to any defined [trigger settings](https://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/trigger-shape) immediately. &#x20;
  {% endstep %}
  {% endstepper %}
