> ## Documentation Index
> Fetch the complete documentation index at: https://docs.morf.health/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Morf Form Environments & Form Promotion

> Understand form types and how to use promotable forms to safely test changes before deploying to production.

## Form Types

| Form type | Published? | Webhooks sent to |
| - | - | - |
| **Live form** | Yes | Morf production (live URL) |
| **Test form** | Yes | Morf staging (test URL) |
| **Preview draft** | No | No webhooks sent |

## Set Up Webhooks

1. Navigate to **Integrations > Webhooks**.
2. Set the **URL** to your Morf production webhook URL. You can find this in a Feathery production workflow trigger under **Connect**. It will start with `https://api.morf.healthcare/webhooks/`
3. Set the **Test URL** to your Morf staging webhook URL. You can find this in a Feathery staging workflow trigger under **Connect**. It will also start with `https://api.morf.healthcare/webhooks/`

> [!TIP]
>
> Make sure your Feathery API keys are added on the Morf dashboard **Integrations** page.

## Working with Promotable Forms

### 1. Create an Environment logic rule

This logic rule lets you dynamically set variables and field options based on whether the form is running in test or live mode. Configure the rule to trigger when the first step is loaded.

> [accordion] View code
>
> ```jsx theme={null}
> if (feathery.isTestForm()) {
>   // staging logic
> } else {
>   // production logic
> }
> ```

### 2. Create a promotable copy

Go to **Settings > Form Promotion > Create Promotable Copy**.

> [!WARNING]
>
> All changes must be published before you can create a promotable copy.

### 3. Configure the new promotable form

A new form will be created with a `(staging)` suffix. This is your promotable form.

* Update the trigger in your **staging Morf workflow** to execute for events from the promotable form.
* In most cases, only use the **test form** in your promotable form. Test form webhooks are sent to Morf staging; live form webhooks are sent to Morf production.

### 4. Make changes in your promotable form

Use the Environment logic rule to dynamically update field options. Use `Field.options` to specify which values appear in staging vs. production.

> [!WARNING]
>
> Hardcoding changes to field options in a promotable form will deploy those values to production when the form is promoted.

*Example: Testing a new option for the `symptoms` field*

> [accordion] View code
>
> ```jsx theme={null}
> if (feathery.isTestForm()) {
>   env_form_id.value = "<test form id>";
>   symptoms.options = ['headache', 'cough', 'fatigue', 'dizziness'];
> } else {
>   env_form_id.value = "<live form id>";
>   symptoms.options = ['headache', 'cough', 'fatigue'];
> }
> ```

Stylistic changes and updates to logic rules will only deploy to production when the form is promoted.

### 5. Promote your changes

When you're ready and all changes have been published, click the dropdown next to **Publish > Promote Form**.

Before promoting, you'll see all linked fields — changes to these fields will be pushed to your original live form.

### 6. After promoting

You'll have three forms:

* **Live form** — with recently promoted changes
* **Promotable form** — your staging version
* **Rollback copy** — a snapshot of your live form prior to the promotion (suffix `Rollback`)

### 7. Rolling back

To revert the promotion, open the rollback form and select **Rollback** in the Publish dropdown. This reverts your live form, and the rollback copy is deprecated.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.