> For the complete documentation index, see [llms.txt](https://docs.middle.app/middle-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.middle.app/middle-docs/faqs/how-do-i-test-workflows.md).

# How do I test workflows?

Start by finding one record, manually running the workflow on it, and reviewing the execution report. Once the result is correct, test a small set of records that covers the workflow's different paths.

## Manually run and review a workflow

Manual runs execute real actions using the workflow's configured connections. Check those connections before running. See [Test with a sandbox destination](#test-with-a-sandbox-destination) below for sandbox setup.

### How do I find a record to test?

1. Open the account, then select the **source app connection** under **App Connections**.
2. Click **Records** beside the relevant record type, such as members, contacts, or purchases.
3. Enter a known identifier in the search panel. A member ID, email address, or another distinctive field is a useful starting point. The available fields depend on the record type.
4. Click **Search** to apply the filters.
5. Review the returned record's ID and values. Open the record or use **View Raw JSON** if you need more detail.

{% hint style="info" icon="magnifying-glass" %}
If the record is missing, confirm the account, connection, and record type, then clear unrelated search filters and try again.

**Re-index**

The table may not yet be index or needs re-indexing. Click to re-index the table. This will queue up a task to re-index the table.

**Sync missing data**\
Search results show [records stored in Middle](https://docs.middle.app/middle-docs/product/accounts/sync/stored-records.md), so a record must be synced before you can select it. If needed, use an [ad-hoc sync](https://docs.middle.app/middle-docs/faqs/how-do-i-back-sync-data.md) on the source connection.
{% endhint %}

### How do I manually run the workflow?

1. Check the box beside **one** record in the results. You can also open that record and use its **Run workflow** menu.
2. Click **Run workflow**, then **Choose workflow**.
3. Select the workflow and read its description. **Run for selected** uses the selected records.
4. For a module workflow, select the appropriate **module connection** if prompted. Check the displayed connection when only one is available, and fill in any additional input fields.
5. Confirm the selected records, workflow, and destination connections, then click **Run workflow** in the menu.

Middle queues the executions and opens **Workflow History** for that execution set. The record-page menu runs the workflow's **active version**.

### How do I review the results?

1. Open the run in **Workflow History**.
2. Confirm the input record and workflow version in the execution report.
3. Inspect the steps that ran, the decisions taken, and the evaluated inputs and outputs. Check whether the workflow followed the path you expected.
4. Investigate failures or unexpected skipped steps.
5. Open the destination app and confirm the expected record or update arrived with the correct field values.

{% hint style="warning" %}
Before rerunning, consider whether an action could create a duplicate or repeat a notification.
{% endhint %}

### How do I test a changed workflow version?

The **Run workflow** menu on record pages uses the active version. Saving a draft does not make those changes available through this menu.

For a new test workflow, finish configuring it, resolve its errors and warnings, and click **Lock this version and make active**. If you are changing an integration already in production, use a separate test workflow or test account to validate the changes before replacing the production version. See [Create or copy a workflow](https://docs.middle.app/middle-docs/product/accounts/create-or-copy-a-workflow.md) and [Edit an existing workflow](https://docs.middle.app/middle-docs/product/accounts/edit-an-existing-workflow.md).

### Why isn't my workflow in the list?

Check that it has an active version and accepts the record type you are viewing. The record browser expects a Begin input named `input_record`, configured as a Foreign Key to the relevant record type. Workflows with other input structures may need a different testing method.

For module workflows, also check that the account's module connection uses the source app connection you opened.

### Does a manual run also test my trigger?

A manual run tests the workflow with the selected inputs. It does not prove that an automatic trigger will select the same records or pass its discard, requeue, and input-mapping conditions.

Test the [trigger](https://docs.middle.app/middle-docs/product/accounts/workflow-triggers.md) separately using a controlled source record change and the intended test workflow or module connection. Review the record's **Timeline** and the resulting workflow execution reports.

## Test with a sandbox destination

We recommend connecting the workflow's **destination actions to a sandbox** while testing. This lets you check how source data is transformed and delivered before sending it to the production destination.

### How do I connect a sandbox destination?

1. Open the Middle account that contains your source records.
2. Under **App Connections**, click **New App Connection**, select the destination app, and click **Add Connection**.
3. Authenticate using the destination app's sandbox or test account. Give the connection a clear name, such as **CRM — Sandbox**.
4. Repeat for any other destinations the workflow writes to.

You can keep the existing source connection and its synced records. See [Connect or edit an app connection](https://docs.middle.app/middle-docs/product/accounts/connect-or-edit-an-app-connection.md) for authentication details. If the destination app does not offer a sandbox, use a dedicated test account where available.

### How do I select the sandbox in an account workflow?

If the workflow is already used in production, [copy it into a separate test workflow](https://docs.middle.app/middle-docs/product/accounts/create-or-copy-a-workflow.md) before changing its destination.

1. Open the test workflow for editing.
2. Open an **Action** step that sends data to the destination.
3. In **Selected Action**, open the chooser and select the required action under the **sandbox connection's name**. The same action can appear under several connections, so check both names.
4. Repeat for every destination Action step.

Keep source lookups pointed at the connection holding your input data. Use the sandbox for destination lookups and writes, and review any other steps that explicitly select a connection.

### How do I select the sandbox for a module workflow?

Use a test module connection with these mappings:

* **Source:** the existing app connection containing the records you want to test.
* **Destination:** the sandbox connection that should receive the results.

Check these mappings on the account's module connection. In the manual execution menu, select this test connection under **Choose module connection** when prompted. If only one connection is available, check the displayed **Module connection** and its mappings before running.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.middle.app/middle-docs/faqs/how-do-i-test-workflows.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
