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

# Sub-workflow

> Reuse existing workflows as building blocks inside other workflows.

The **Sub-workflow** node calls another workflow as a step in the current workflow. This lets you break complex automations into reusable, modular pieces.

## When to use

* Reuse common logic across multiple workflows (e.g., "send notification" or "update CRM")
* Break a large workflow into smaller, testable components
* Share standard processes across your team

## Configuration

| Field        | Description                                     |
| ------------ | ----------------------------------------------- |
| **Workflow** | Select the workflow to call from your workspace |
| **Input**    | Data to pass as input to the sub-workflow       |

## How it works

<Steps>
  <Step title="Execution reaches the sub-workflow node">
    The current workflow pauses at this node.
  </Step>

  <Step title="The referenced workflow runs">
    The selected workflow executes with the provided input, running through its own trigger and all its nodes.
  </Step>

  <Step title="Results return">
    When the sub-workflow completes, its output is returned to the parent workflow, and execution continues.
  </Step>
</Steps>

## Output

The sub-workflow node produces the final output of the called workflow, which downstream nodes in the parent workflow can reference.

## Tips

* Sub-workflows run as independent executions; they appear in the execution history as separate entries.
* You can nest sub-workflows (a sub-workflow can call another sub-workflow), but avoid deep nesting to keep things manageable.
* Test sub-workflows independently before using them in a parent workflow.
* Changes to a sub-workflow take effect immediately; all parent workflows that call it will use the latest version.
