# Creating a virtual environment

## Introduction

A virtual environment is the container for associated configuration and process flows. You should create one virtual environment for each required context - for example:

* Test and live
* Different regions
* Different stores
* etc.

There's no right or wrong way to define virtual environments. If you're creating multiple process flows that essentially do the same thing but have elements of variation for different contexts, you can likely benefit from creating virtual environments for each of those contexts.&#x20;

## Need to know

* A virtual environment isn't tied to a single process flow - you can run one process flow in a virtual environment, or multiple process flows.
* You can't deploy multiple versions of the *same* process flow to a given virtual environment. If a deployed process flow changes, you should delete the existing version from virtual environments and then deploy the updated version. For more information, please see: [Updating the process flow version for a virtual environment](/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.md).&#x20;
* For a virtual environment to be available for selection when [testing process flows against a virtual environment](/product-documentation/virtual-environments/implementing-virtual-environments/testing-a-process-flow-against-a-virtual-environment.md) or when [deploying process flows](/product-documentation/virtual-environments/implementing-virtual-environments/deploying-a-single-process-flow-to-a-virtual-environment.md), it must contain a [deployed version](/product-documentation/virtual-environments/implementing-virtual-environments/deploying-the-configuration-for-a-virtual-environment.md).&#x20;
* If you [delete](/product-documentation/virtual-environments/managing-virtual-environments-versions-and-flows/managing-virtual-environments/deleting-a-virtual-environment.md) a virtual environment, the name cannot be used again.&#x20;

## The steps

{% stepper %}
{% step %}
**Access virtual environments**

[Log in to the dashboard](https://app.wearepatchworks.com/virtual-environments) and select `virtual environments` | `overview` from the left-hand navigation menu.
{% endstep %}

{% step %}
**Create a new virtual environment**

Click the `create` button in the top-right corner (if this is your first virtual environment, you could also use the `create one here` link in the middle of the page):

<figure><img src="/files/C1UtWhLsvj75Mw7lejJk" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Provide basic details**

Enter a `name` and `description` for this environment, then select a `type` (`test` or `live`):

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

Fields to be completed are summarised below:

<table><thead><tr><th width="252.3359375">Field</th><th>Summary</th></tr></thead><tbody><tr><td>Name</td><td>The name to be displayed for this virtual environment, wherever it's used in the dashboard. </td></tr><tr><td>Description</td><td>Optional information to help others understand the purpose of this virtual environment.</td></tr><tr><td>Type</td><td>Choose from <code>test</code> or <code>live</code>. This setting has no functional impact, but it can be used for filtering.</td></tr><tr><td>Labels</td><td><p>If you need to create and manage lots of virtual environments, it can be useful to apply labels for filtering the display. Any existing labels (defined for <a href="/pages/F7IIExkRhzFpFPBsGVpE">process flows</a> or other virtual environments) are available for selection, or you can use the <code>create label</code> option to add new ones.</p><p></p><p>For general information about working with labels, please see our <a href="/pages/wF8XKKUntRSCwSX5LnJd">Label management</a> page.<br></p></td></tr></tbody></table>
{% endstep %}

{% step %}
**Configure the virtual environment**

Configuration options are displayed over a series of panels:

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

{% hint style="info" %}
For information about these panels, please refer to [The anatomy of a virtual environment](/product-documentation/virtual-environments/accessing-virtual-environments/the-anatomy-of-a-virtual-environment.md#available-information-and-options).
{% endhint %}
{% endstep %}

{% step %}
You can now go on to [configure the draft virtual environment version with required component replacements](/product-documentation/virtual-environments/implementing-virtual-environments/configuring-a-virtual-environment-version.md).
{% 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/creating-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.
