# Replacement instances

## Introduction

Having [chosen to configure instance replacements for a virtual environment](/product-documentation/virtual-environments/implementing-virtual-environments/configuring-a-virtual-environment-version/configuring-virtual-environment-replacements.md#configuring-replacements-for-a-virtual-environment-version), a new replacement rule is displayed, ready for you to configure:

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

Having defined the first rule, you can add more - you must create one replacement rule for every instance that you need to replace in every process flow that will run in this environment.&#x20;

## Defining replacement rules for an instance

{% stepper %}
{% step %}
**Select the required connector**

Use the `connector` dropdown list and choose a connector that's included in any process flows that you'll be running in this virtual environment:

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

{% hint style="info" %}
As you work through your replacement configuration, it's helpful to view related ['master' process flows](/product-documentation/virtual-environments/implementing-virtual-environments/creating-a-master-process-flow.md) in another browser tab. You can duplicate a Patchworks browser tab and navigate to a different page whenever needed.
{% endhint %}
{% endstep %}

{% step %}
**Select the required ORIGINAL connector instance**

Use the `original` dropdown list to select an instance in a 'master' process flow that must be replaced when this process flow runs in the given virtual environment - for example:

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

{% step %}
**Select the required REPLACEMENT connector instance**

Use the `replacement` dropdown list to select the replacement instance that must be used when this process flow runs in the given virtual environment - for example:

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

{% step %}
**Confirm your selections**

Click the `create` button (associated with this replacement rule) to confirm your selections:

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

The rule is added:

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

{% hint style="info" %}
Once a rule is confirmed, it can't be edited. If you need to change a replacement rule, use the 'trash' icon to remove it and add a new one.
{% endhint %}
{% endstep %}

{% step %}
**Add more replacement rules for connector instances**

To add another replacement rule for a connector instance, click the top-right `create` button:

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

Update the new rule as required, then click the associated `create` button to confirm your selections:

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

Repeat as many times as needed to define all required instance replacements for all process flows that will be running in this virtual environment.

{% hint style="info" %}
If you don't want to define ALL instance replacements now, that's OK. For example, you might choose to add the minimum number of replacements needed for [testing](/product-documentation/virtual-environments/implementing-virtual-environments/testing-a-process-flow-against-a-virtual-environment.md), then define remaining rules (in a [new draft](/product-documentation/virtual-environments/implementing-virtual-environments/configuring-a-virtual-environment-version/understanding-virtual-environment-versions.md)) later, after initial testing is complete.
{% endhint %}
{% 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/configuring-a-virtual-environment-version/configuring-virtual-environment-replacements/replacement-instances.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.
