# Deploying the configuration for a virtual environment

Having configured all required [replacements](https://doc.wearepatchworks.com/product-documentation/virtual-environments/implementing-virtual-environments/configuring-a-virtual-environment-version/configuring-virtual-environment-replacements) in your `draft` virtual environment version, it should be deployed. Deploying a `draft` virtual environment means that its [configured replacements](https://doc.wearepatchworks.com/product-documentation/virtual-environments/implementing-virtual-environments/configuring-a-virtual-environment-version/configuring-virtual-environment-replacements) are applied when associated process flows run.

{% hint style="info" %}
The steps detailed on this page show how to deploy a single process flow. If you need to deploy multiple process flows, consider using [packages](https://doc.wearepatchworks.com/product-documentation/virtual-environments/virtual-environment-packages) for greater efficiency.
{% endhint %}

## Need to know

* When process flows run in a virtual environment, [configured replacements](https://doc.wearepatchworks.com/product-documentation/virtual-environments/implementing-virtual-environments/configuring-a-virtual-environment-version/configuring-virtual-environment-replacements) are applied from the current `deployed` virtual environment version.
* When a `draft` virtual environment version is deployed, a new `draft` version is created (based on the previous one), ready for [future updates](https://doc.wearepatchworks.com/product-documentation/virtual-environments/managing-virtual-environments-versions-and-flows/managing-virtual-environment-flow-deployments/updating-the-process-flow-version-deployed-in-a-virtual-environment).
* When a `draft` virtual environment version is deployed, it becomes available for selection when [testing a process flow against virtual environments](https://doc.wearepatchworks.com/product-documentation/virtual-environments/implementing-virtual-environments/testing-a-process-flow-against-a-virtual-environment).
* When a `draft` virtual environment version is deployed, it becomes available for selection when [deploying process flows to virtual environments](https://doc.wearepatchworks.com/product-documentation/virtual-environments/implementing-virtual-environments/deploying-a-single-process-flow-to-a-virtual-environment).

## The steps

{% stepper %}
{% step %}
**Access the required virtual environment**

If you're not already working in the required virtual environment, [log in to the dashboard](https://app.wearepatchworks.com/virtual-environments) and select `virtual environments` | `overview` from the left-hand navigation menu, then select the environment to update.
{% endstep %}

{% step %}
**Access options for the required version**

Move down to the [configuration versions](https://doc.wearepatchworks.com/product-documentation/accessing-virtual-environments/the-anatomy-of-a-virtual-environment#available-information-and-options) panel and select the ellipsis associated with the `draft` version - for example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FJuf831lNyVIAR5rlsc8Q%2Fdeploy%20ve%20version%200.png?alt=media&#x26;token=6963f49a-729b-4829-8a09-dc4f4630d7f0" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Over time, the number of virtual environment versions displayed here will change. Typically, you will deploy the current `draft` version, but if required, you can deploy an `inactive` version using the same steps detailed here. For more information about virtual environment versions please refer to [Understanding virtual environment versions](https://doc.wearepatchworks.com/product-documentation/virtual-environments/implementing-virtual-environments/configuring-a-virtual-environment-version/understanding-virtual-environment-versions).
{% endhint %}
{% endstep %}

{% step %}
**Deploy the selected version**

Select the `deploy` option - for example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F1SPxvjVc94EO1EuJdf4x%2Fdeploy%20ve%20version%201.png?alt=media&#x26;token=196f6ebf-c8e4-4746-84bf-0df50e7e9c13" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Test process flows against this environment**

The `draft` version becomes deployed and a new `draft` is created - for example:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FwwFd9OJF4CNjEE396nGl%2Fdeploy%20ve%20version%202.png?alt=media&#x26;token=f5a74a1c-eec4-46b9-aa8b-bac45be352bd" alt=""><figcaption></figcaption></figure>

You can now go on to test your master process flows(s) against this environment.
{% endstep %}
{% endstepper %}


---

# Agent Instructions: 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:

```
GET https://doc.wearepatchworks.com/product-documentation/virtual-environments/implementing-virtual-environments/deploying-the-configuration-for-a-virtual-environment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
