> For the complete documentation index, see [llms.txt](https://docs.diaflow.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.diaflow.io/workflow-builder/nodes/built-in-tools/run-another-flow.md).

# Run another flow

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

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

## I. Description <a href="#description" id="description"></a>

*<mark style="color:red;">\*\*Just apply with flow, have type = App</mark>*

#### What it does

* Calls a **sub-flow** synchronously during the parent flow’s execution.
* Passes selected inputs (files, text, objects) from the **parent** to the **sub-flow**.
* Waits for the sub-flow to complete, then **exposes the sub-flow’s outputs** on the **Run another flow** node.

#### When to use

* You want to **reuse** a standardized mini-workflow (e.g., “Extract text from PDF”, “Normalize entities”, “Post to CRM”).
* You want to **decompose** a large flow into smaller maintainable units.
* Multiple teams/flows should **share** the same logic with one change point.

#### Concepts

* **Parent flow (Main flow):** the flow you’re currently building; it contains the **Run another flow** node.
* **Sub-flow:** a separate, reusable flow referenced by the parent. Its outputs are returned to the parent.

## II. How to use <a href="#description" id="description"></a>

### Step 1: Create Sub-flow

*<mark style="color:red;">\*\*Just apply with flow, have type = App</mark>*

Please follow step - by - step

Create a flow with type = **App**

(1) At "Trigger node":

* Switch toggle "Use this as a sub-flow" to Enable

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

(2) Add another node to the flow\
\
(3) Publish the Sub-fllow

**Rule**

<table><thead><tr><th width="151.0390625">Case</th><th>Rule</th></tr></thead><tbody><tr><td>(1) Sub-flow compatibility with restricted nodes</td><td><p>A flow that is marked as a <strong>sub-flow</strong> must not use the following nodes:</p><ul><li><strong>“Branch”</strong></li><li><strong>“Loop”</strong></li><li><strong>“Delay”</strong></li><li><strong>“Run another flow”</strong>.</li></ul></td></tr><tr><td>(2) Flow is already marked as sub-flow, user adds a restricted node</td><td><p></p><ul><li><strong>Trigger:</strong> User tries to add any of the restricted nodes to a flow that has <strong>Sub-flow</strong> enabled.</li><li><strong>Behavior:</strong> Block the action and show an inline error toast/banner on the canvas.</li><li><strong>Error message (exact):</strong><br><strong><code>This node is not available in sub-flow</code></strong></li></ul></td></tr><tr><td>(3) Flow already contains a restricted node, user turns on Sub-flow</td><td><p></p><ul><li><strong>Trigger:</strong> User toggles <strong>Sub-flow</strong> on in a flow that currently contains at least one restricted node.</li><li><strong>Behavior:</strong> Do not allow enabling. Keep the toggle <strong>off/disabled</strong>.</li><li><strong>Hover tooltip over the disabled toggle (exact text):</strong><br><strong><code>This flow cannot be marked as a sub-flow if nodes "Run another flow", "Branch", "Delay", "Loop" are being used</code></strong></li></ul></td></tr><tr><td>(4) Unmarking a published sub-flow</td><td><p><strong>Rule:</strong> If a flow is <strong>already marked as sub-flow</strong> and has been <strong>published</strong>, unmarking it must require explicit confirmation.</p><p><br></p><h4>Behavior</h4><ul><li><strong>Trigger:</strong> User turns <strong>off</strong> the <strong>Sub-flow</strong> toggle on a <strong>published</strong> sub-flow.</li><li><strong>Action:</strong> Show a <strong>Confirm</strong> modal.</li><li><strong>Modal copy (exact):</strong><br><strong><code>Do you want to disable this sub-flow. It might be used as a sub-flow in another flow</code></strong></li><li><p><strong>Options:</strong></p><ul><li><strong>Confirm</strong> → proceed to unmark; downstream flows that reference this sub-flow should surface a warning on next open/run.</li><li><strong>Cancel</strong> → keep Sub-flow enabled; no changes applied.</li></ul></li></ul></td></tr></tbody></table>

### Step 2: Create Parent flow (Main flow) and refer to the sub-flow

*<mark style="color:red;">\*\*Just apply with flow, have type = App</mark>*

Please follow step - by - step

Create a flow with type = **App**

(1) Build new flow

(2) Add "Run another flow" node

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

\ <br>

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

Component settings

<table><thead><tr><th width="236.3203125">Parameter Name</th><th>Description</th></tr></thead><tbody><tr><td>Select a flow</td><td><p>Select a sub-flow<br><br>Rule:<br></p><ul><li>Must be in the same workspace<br><strong>AND</strong></li><li>The sub-flow must be set to <strong>public</strong></li></ul></td></tr><tr><td>Field Input</td><td>Show the fields input of the Sub - Flow</td></tr><tr><td><strong>Advance configurations</strong></td><td></td></tr><tr><td>On Error when running Run another flow</td><td>Single - select:<br>- Stop workflow (default value)<br>- Skip and record error</td></tr></tbody></table>

### Step 3: Run Parent flow (Main flow)

When finish setup the Parent flow (main flow) -> Click button **"Execute"** to run the flow

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

After run the flow, at the output of "Run another flow" node will response the data of Sub-flow

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

## III. History <a href="#description" id="description"></a>

### View from the Parent flow (Main-flow)

When run success the parent flow, user can view the history

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

The history list, the user can click to view the details

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

At Tab "Workflow", the user clicks details of the  "Run another flow" node

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

Will display the **"Sub-flow name"** and **"Sub-flow ID"**

User can click on the "Sub-flow name" -> The system will open a new tab and redirect to the workflow builder of the Sub-flow

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

<figure><img src="/files/89cO1J2iRCAsI8NvJ5zQ" alt=""><figcaption></figcaption></figure>

### View from the Subflow

When run success the parent flow, user can view the history of the subflow

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

At the History list, with the record run via Parent-flow, at the column **VIA** will show the value **"Parent flow"**

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

User can click to view the details

<figure><img src="/files/2voduv9sraQmBYNZtivw" alt=""><figcaption></figcaption></figure>

At detail page

Will display the **"Parent-flow name"** and **"Parent-flow ID"**

User can click on the "Parent-flow name" -> The system will open a new tab and redirect to the workflow builder of the Parent flow

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

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