# Sub-flow

Run another workflow as a step and use its output.

## Do things in Sub-flow

Add a **Sub-flow** step. Choose the row to see all its fields.

- [Execute Workflow](https://docs.gorunner.io/apps/sub-flow#fields-f-execute): Run another workflow with the given input and return its output.

Later steps read a step’s output by its name: see [Use data from earlier steps](https://docs.gorunner.io/build/use-data-from-earlier-steps).

For a step-by-step guide, see [Run another workflow](https://docs.gorunner.io/build/run-another-workflow).

Not in your list? See [When an app isn’t here](https://docs.gorunner.io/apps/when-an-app-isnt-here#q-not-in-list).

## For developers

In the API, which calls apps pieces, Sub-flow is `pieceId: "subflow"` with `actionId: "execute"`. [Get an app](https://docs.gorunner.io/api/apps/get-app) returns every field.

It can change something outside the run (`writes_external`). See [How versions and side effects work](https://docs.gorunner.io/apps#q-versions).

### Sub-flow › Execute Workflow

Run another workflow with the given input and return its output. Error handling's Timeout, when set, bounds the whole called workflow (a Delay in it included); without one it goes on until its own workflow timeout.

- **Workflow · Required**: The workflow to run as a sub-flow.
- **Input · Optional**: Data passed to the sub-flow as its trigger; reference it inside the sub-flow as {{trigger.field}}.

Source: https://docs.gorunner.io/apps/sub-flow
