# Environments

## What do environments do?

In Formsort, **environments** are spaces you can deploy your variants to for different purposes, and the variant environment it is deployed to will correspond to the environment set up in [integrations](/integrations/integration-reference.md).

For example, you want to test the changes your team is making to a variant in a mocked "live" environment, but also do not want these changes available to your users. In this case you'll want to set up a **staging** environment to run testing. First, you'd configure the staging environment endpoints (see **editing environments** below) to make sure you can receive test answers; then, you'll deploy your variant to the staging environment.&#x20;

{% hint style="info" %}
Non-production environments are only available to clients that are on the [Enterprise](https://formsort.com/pricing/) plan. Enerprise clients will by default have access to two environments: **production** and **staging**, plus the option to create as many as are necessar&#x79;**.**
{% endhint %}

* **Production** should always be used for the "live" version of a flow. [Flowstarts](/flow-variant-management.md#flow-starts) are counted when users *load and interact with* flows deployed to the **production** environment.&#x20;
* **Staging** can be used to integrate with mock or test versions of your integrations, to create a production-like version of a flow that only talks to non-production systems. This is ideal for preventing production data contamination. It is optional to use staging, but for complex forms it is useful to have. **Flowstarts** do not count in this environment.
* You can [create new environments](/publishing-and-deployment/environments.md#creating-new-environments) if you need them. **Flowstarts** do not count in any new environments created. Test away!&#x20;

## Editing environments

Environments are defined per flow, and are shared across all [variants](/flow-variant-management.md#variants) of that flow, to ensure data integrity between variants.

From the flow index page, the **Integrations** tab will show the environments editor for your integrations.

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

Here it is possible to edit all aspects of integrations:&#x20;

* create a new integration environment (e.g. create a "dev" environment)&#x20;
* configure setup for a new integration target
* make updates to existing integration targets

Since adjustments are made on a per-environment basis, your production environment will likely have a different integration configuration than your staging environment.&#x20;

### Creating new environments

Clicking **Edit...** on the top right of the environment editor shows a list of the current environments and allows the addition of new environments. You will see that a **production** and **staging** environment are added by default.&#x20;

Click **+Add environment** if you'd like to create a new environment. You can also **delete** environments in this menu.&#x20;

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

Once you've added a new environment, you will see it's availability in the dropdown list of environments.&#x20;

<figure><img src="/files/G7gdssglEvsNCFVopgAE" alt=""><figcaption><p>Newly-created dev environment is available. </p></figcaption></figure>

### Saving and propagating changes

When changes have been made to any of the integrations, you will be prompted to save them, regardless of which environment you are in.

<figure><img src="/files/wbovxV9Q0IPtkhVLsgFG" alt=""><figcaption><p>Save your changes</p></figcaption></figure>

### Deploying your variants to different environments

After saving the changes you've made to your integrations, your live variants need to be **redeployed** to the matching environment so that the changes can be propagated to your flow.&#x20;

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

For instance, if integration changes have been made in your **staging** environment, make sure to deploy or redeploy any variants you are using to **staging**. &#x20;

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

When you're ready to test, proceed to [Loading different environments](/publishing-and-deployment/environments/setting-the-environment.md). Happy testing!&#x20;


---

# 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://docs.formsort.com/publishing-and-deployment/environments.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.
