> ## Documentation Index
> Fetch the complete documentation index at: https://learn.workflow.dog/llms.txt
> Use this file to discover all available pages before exploring further.

# Sub-Workflow

> Run this workflow when another workflow calls it.

The **Sub-Workflow** trigger turns a workflow into a reusable operation. Call
it with **Run Workflow**, **Loop Workflow**, **Schedule Workflow**, or an action
that accepts a callable workflow.

## Quick start

<Steps>
  <Step title="Choose the Sub-Workflow trigger">
    Select **When another workflow calls this one** as the trigger.
  </Step>

  <Step title="Read the incoming value">
    Add **Data from Trigger**. Its **Data In** output contains the caller's
    payload.
  </Step>

  <Step title="Return a result">
    Add **Return Data** and connect the value the caller should receive.
  </Step>

  <Step title="Call it">
    In another workflow, add **Run Workflow**, select this workflow, and connect
    a payload.
  </Step>
</Steps>

## Trigger data

| Output      | Type | Description                         |
| ----------- | ---- | ----------------------------------- |
| **Data In** | Any  | The payload supplied by the caller. |

If the workflow does not use **Return Data**, a waiting caller receives
`null`. Scheduled callers do not wait for a response.

<Note>
  Sub-workflow runs do not accrue usage costs. Recursive calls are rate-limited
  to 10 calls per second to prevent infinite recursion.
</Note>

<Warning>
  A failure in this workflow propagates to callers that wait for completion,
  such as **Run Workflow** and **Loop Workflow**.
</Warning>
