# Sub-Workflow Output

> Define what a callable workflow returns. Pair it with a Sub-Workflow Input, add typed output ports, and choose which result the caller shows as its preview.

Source: https://nodaro.ai/docs/nodes/automate/sub-workflow-output

The **Sub-Workflow Output** node defines what a callable workflow returns to the workflow that calls it. It pairs with a [Sub-Workflow Input](https://nodaro.ai/docs/nodes/automate/sub-workflow-input) through a shared route, and each of its ports becomes an output on the calling [Sub-Workflow](https://nodaro.ai/docs/nodes/automate/sub-workflow) node. You also choose which port's result the calling node shows as its preview.

- Found in: Automate › Workflows
- Output: none
- API type: `sub-workflow-output`

## When to use it
- A reusable composition workflow should return the finished video.
- One run should return several results, such as a video from [Generate Video](https://nodaro.ai/docs/nodes/video/generate-video) and a thumbnail from [Extract Frame](https://nodaro.ai/docs/nodes/image/extract-frame).
- You complete the route of a workflow that starts with a Sub-Workflow Input.

## Quick start
### Add the node

In the workflow that other workflows will call, press Tab and choose **Automate › Workflows › Sub-Workflow Output**.

### Pair it

Open the settings panel and choose the matching Sub-Workflow Input under **Paired Input Route**.

### Define the ports

Under **Ports**, name each result and choose its type. Click **Add** for more ports, such as "Rendered Video" and "Thumbnail".

### Connect the results and save

Connect the final nodes of the workflow to the matching ports on the left of the node. Choose the **Visible Output**, then save the workflow.

Workflow: A callable workflow returns two results: the video and a thumbnail taken from it, each on its own output port.

- Sub-Workflow Input → Generate Video (prompt)
- Generate Video → Extract Frame
- Generate Video → Sub-Workflow Output (Video)
- Extract Frame → Sub-Workflow Output (Thumbnail)

## Inputs
The node has one input per port on its left, colored by the port's type. Each input receives the final result for that port from the nodes inside the workflow. When the route runs, these results go back to the calling node.

## Settings
| Setting | What it does |
| --- | --- |
| **Label** | The node's name. |
| **Paired Input Route** | The Sub-Workflow Input that this output completes. The list shows the Sub-Workflow Input nodes of the same workflow, with their label and the start of their route ID. |
| **Ports** | The results the route returns. Each port has a name and a type: **Text**, **Image**, **Video**, **Audio** or **Any**. A new node has one port, "Output", of type **Any**. **Add** adds another port. The last port cannot be removed. |
| **Visible Output** | The port whose result the calling Sub-Workflow node shows as its preview. When you remove the chosen port, the first port takes its place. |

## Rules

When you save the workflow, Nodaro checks three rules:

- Every Sub-Workflow Output has at least one port.
- Every Sub-Workflow Input has a Sub-Workflow Output with the same route ID.
- No two Sub-Workflow Output nodes share a route ID.

A save that breaks a rule is refused, and each problem is listed.

## Credits
The Sub-Workflow Output node is free.

## Tips
- **Name results clearly.** "Rendered Video" or "Generated Audio" tells the caller what each output carries.
- **Match the types.** Give each port the type of the node that feeds it, so the caller connects it to the right inputs.
- **Preview the main result.** Set **Visible Output** to the result people look at first, usually the video or the final image.

## Frequently asked questions

### What does the Sub-Workflow Output node do?

It defines the results that a callable workflow returns. Each of its ports becomes an output on the Sub-Workflow node that calls the workflow.

### How do I pair a Sub-Workflow Output with its input?

Open the settings panel and choose the Sub-Workflow Input under Paired Input Route. The list shows the Sub-Workflow Input nodes of the same workflow.

### What does Visible Output do?

It chooses the port whose result the calling Sub-Workflow node shows as its preview on the canvas.

### Can a workflow return several results?

Yes. Add one port per result, for example a video port and an image port for a thumbnail. Each port becomes a separate output on the calling node.

### Does the Sub-Workflow Output node cost credits?

No. It only returns values to the caller and is free.
