> For the complete documentation index, see [llms.txt](https://docs.nected.ai/nected-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nected.ai/nected-docs/workflow/test-and-publish-workflows.md).

# Test & Publish Workflows

Nected lets you test workflows in a staging environment before deploying them to production. There are two ways to test a workflow:

1. **Quick Test** — a one-off, ad-hoc test with custom inputs. Best for exploring behavior during development and validating individual nodes.
2. **Test Suite** — a saved collection of test cases you can run all at once. Best for regression testing before every publish.

Both methods are accessible from the **Test Run** button in the top-right of the workflow editor.

### Before You Test

Before testing a workflow — by either method — make sure:

1. You've provided proper input data to all added nodes.
2. Each individual node has been configured and tested.

{% hint style="info" %}
Always test every node separately and run an end-to-end test before publishing your workflow.
{% endhint %}

***

### Method 1: Quick Test

Quick Test lets you fire a single set of inputs at your workflow and immediately see the full execution trace. Nothing is saved — it's designed for fast, exploratory testing during development.

#### How to Run a Quick Test

1. Open a workflow in the editor.
2. Click the **Test Run** button (in case **Run Quick Test** is selected) in the top-right header.

   * Alternatively, click the **▼** dropdown arrow next to Test Run and select **Run Quick Test**.

   <figure><img src="/files/1g5AH1vCheAjpELjjtxX" alt=""><figcaption></figcaption></figure>
3. The **Test Workflow** tab opens.
4. Enter values for each input parameter defined in your workflow's trigger node.
5. Click **Test Now**.
6. The execution result appears, showing three columns:

#### Understanding the Quick Test Result

| Column     | Description                                                                                                                                                                                                     |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Steps**  | Each node in the workflow. A ✅ mark next to a node name means it executed successfully.                                                                                                                         |
| **Input**  | The input attributes passed to that particular node.                                                                                                                                                            |
| **Result** | The execution output for that node — including output values, action name, and action status (if all conditions were met). Toggle between **Raw** (low-code JSON view) and **Pretty** (no-code formatted view). |

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

#### Testing Individual Nodes

You can also test each node in isolation before running the full workflow:

* Click on any node in the canvas to open its configuration panel.
* Use the node-level test option to run just that node with specific inputs.
* Once all nodes pass individually, run the end-to-end Quick Test.

{% hint style="info" %}
Quick Test always runs against the **Staging** environment, so there's no risk to Production.
{% endhint %}

***

### Method 2: Test Suite

Test Suite is a persistent library of test cases tied to your workflow. You define inputs and expected outputs once, save them, and re-run them with a single click whenever the workflow changes. This makes it the right tool for regression testing before every publish.

#### Accessing the Test Suite

1. Open any workflow in the editor.
2. Click the **▼** dropdown arrow to the right of the **Test Run** button.\
   ![](/files/DZFvrwgqjXB3AN8gvlmW)
3. Select **Run Test Suite** from the dropdown.
4. The **Test Suite** panel opens on the right.

#### The Test Suite Panel

The panel header contains the following controls:

| Control                   | Action                                     |
| ------------------------- | ------------------------------------------ |
| **Search on Name**        | Filter test cases by name                  |
| **Run All Tests**         | Execute all saved test cases at once       |
| **Save Test**             | Save new or edited test cases              |
| **View Last Test Result** | Jump to the results of the most recent run |
| **Download**              | Export all test cases as a CSV file        |

When no test cases exist yet, you'll see an empty state with two options: **+ Add test case manually** and **Import Test Cases**.

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

***

#### Adding Test Cases

**Option A: Add Manually**

1. Click **+ Add test case manually** (or the button in the empty state).
2. A new row appears in the table with these columns:

   **Input columns** — one per workflow input attribute (matching your trigger node's parameters):

   * Fill in the values to be sent to the workflow when this test runs.

     <figure><img src="/files/7hl8gp8dIdvTFvwISPCj" alt=""><figcaption></figcaption></figure>

   **Name & Group**:

   * **Name** — a label for this test case (used for search and for merge-on-import)
   * **Group Name** — optional; group related tests together (e.g., `payment scenarios`, `edge cases`)

   **Output / expectation columns**:

   * **Matching Row** — which output rows you expect the workflow to produce (e.g., `Row 1`, `Row 5`)
   * **Default Output** — `true` if you expect the default output path, `false` otherwise
   * **Output field columns** (e.g., `code`, `main`, `description`, `discount`) — the exact values you expect the workflow to return. Leave blank to skip assertion on that field.
3. Click **Save Test** (top-right) to persist the test cases.
4. A green toast confirms: **"X test cases saved."**

**Option B: Import via CSV**

For bulk test case creation, import a CSV file.

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

1. Click **Import Test Cases**.
2. The **Upload File** modal appears.
3. **Choose an Upload Policy:**

   | Policy                                     | What it does                                                                                 |
   | ------------------------------------------ | -------------------------------------------------------------------------------------------- |
   | **Merge rows (based on name)** *(default)* | Updates existing test cases with the same name; adds new ones for names that don't exist yet |
   | **Append rows**                            | Adds all rows from the CSV as new test cases, regardless of name duplicates                  |
   | **Replace all rows**                       | Deletes every existing test case and replaces with the CSV contents                          |
   | **Replace row, exclude manually created**  | Replaces previously imported test cases but preserves manually added ones                    |
4. Click **Download Template** to get a pre-formatted CSV with the correct column headers for your workflow.
5. Fill in the template:

   ```
   name, group, , <input_attr_1>, <input_attr_2>, ..., defaultOutputData, <output_key_1>, <output_key_2>, ..., <action_1>, <action_2>
   ```

   * `name` — the test case name (required; used for merge-by-name)
   * `group` — optional group name
   * Input attribute columns — one per workflow input parameter
   * `defaultOutputData` — `true` or `false`
   * Output key columns — expected output values (leave blank to skip assertion)
   * Action columns — expected action outcomes (if the workflow has post-execution actions)
6. Upload the filled CSV (`.csv`, max 2 MB).
7. The imported test cases appear in the panel.
8. Click **Save Test** to confirm.

{% hint style="info" %}
Use **Merge rows** when syncing test cases from a shared spreadsheet — it won't delete cases you've added manually or that aren't in the current CSV.
{% endhint %}

#### Running the Tests

**Run All Tests**

1. Click **Run All Tests** in the panel header.
2. Nected runs every saved test case against the workflow in Staging — each test case triggers a full end-to-end execution.
3. The **Test Result** view opens automatically, showing:

   | Column           | Description                                                              |
   | ---------------- | ------------------------------------------------------------------------ |
   | **Status**       | Icon indicating Pending, Passed ✅, or Failed ❌                           |
   | **Name**         | Test case name                                                           |
   | **Group Name**   | The group it belongs to                                                  |
   | **Input**        | The inputs sent to the workflow                                          |
   | **Matching Row** | Which output rows matched and whether default output was returned        |
   | **Output**       | Actual output values returned by the workflow, compared against expected |
4. The summary bar at the top shows **Total / Passed / Failed** counts.

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

**Run a Single Test**

* Click the **▶ play** icon on any test case row to run just that one test.

<figure><img src="/files/3ZDvFiMPhdSdrZ8uNSv1" alt=""><figcaption></figcaption></figure>

**Re-run After Changes**

* After editing the workflow, open Test Suite again and click **Run All Tests** to verify nothing regressed.
* From the Test Result view, click **Retest All** to re-run without going back to the suite panel.

#### Managing Test Cases

* **Search** — find test cases by name using the search bar
* **Delete** — use the row action menu (⋮) to remove individual test cases
* **Download** — export all test cases as CSV at any time (useful for sharing or version control)
* **View Last Test Result** — check the most recent run's output without triggering a new run

### Quick Test vs. Test Suite: When to Use Which

|                        | Quick Test                                          | Test Suite                              |
| ---------------------- | --------------------------------------------------- | --------------------------------------- |
| **Best for**           | Exploring behavior and debugging during development | Regression testing before every publish |
| **Saved**              | No — one-off only                                   | Yes — persists across sessions          |
| **Scope**              | Full workflow + per-node trace                      | Full end-to-end workflow output         |
| **Multiple inputs**    | One at a time                                       | All at once                             |
| **Pass/fail tracking** | No                                                  | Yes, with summary counts                |
| **Import/Export**      | No                                                  | Yes (CSV)                               |
| **Groups & naming**    | No                                                  | Yes                                     |

{% hint style="info" %}
Use Quick Test while building and debugging nodes. Use Test Suite as your final validation gate before every publish — it ensures existing scenarios still behave correctly after changes.
{% endhint %}

***

## Publish a Workflow

The publishing flow for workflows involves a structured process to ensure changes are properly documented, reviewed, and versioned. Here are the detailed steps:

The workflow starts in a draft state. You can make any necessary edits to ensure it meets your requirements. Once you've done with the editing, you now can do two things:

1. **Submit it for Review**: If you're working in a team, and there is a reviewer, then you can assign the reviewer and submit the workflow in review. Then it will go into the review flow, which you can read from [Approval Flow](/nected-docs/audit/approval-flow.md).<br>

   <figure><img src="/files/ur7tuHxSrPhhKIMpoKRn" alt=""><figcaption></figcaption></figure>
2. **Publish your workflow:** If you don't want to review your workflow by an approver, then you can also directly publish your workflow in production. Here is how you can do that:

   * When you are ready to publish, click the "Publish" button.
   * **Title and Description**: A prompt will appear asking for a title and description of the changes. This information helps maintain a clear version history.
   * **Confirm Publishing**: After providing the title and description, click the publish button to move the workflow to production. The workflow is now published and it will create a new published version that you can access from the Publish tab of the Version Control section. This version is live in the production environment.

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

For more details about version control, and rolling back to a previous version, read the [Version Control](/nected-docs/audit/version-control-and-rollback.md) doc.

By following these detailed steps, users can effectively manage the publishing and rollback processes for their rules and workflows, ensuring high-quality and reliable outputs.

{% hint style="info" %}
To make a Workflow in Production, You must test all the nodes separately or  run "Test in Staging", otherwise the Workflow won't be published.
{% endhint %}

## Versioning:

Every publish creates a new version of the workflow and you can always view the last published version along with the current draft. You can now control the version of a workflow, and rollback to its previous version using our Version Control& rollback feature. You can read more about it in [versioning & rollback](/nected-docs/audit/version-control-and-rollback.md).
