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

# Subflows

> Learn how to create and use subflows to build modular and reusable components in your workflows

<Callout type="info">
  Subflows are like building blocks that you can use to create larger, more complex workflows. They help you organize your work and make it easier to manage.
</Callout>

## What are Subflows?

Subflows are smaller workflows that you can use within larger workflows. Think of them as mini-processes that you can reuse in different parts of your main workflow.

<Card title="Main Flow" icon="diagram-project">
  Every workflow must have a main flow. This is the primary process that orchestrates all the other parts of your workflow.
</Card>

## How Subflows Work

<Frame>
  <img src="https://mintcdn.com/odella/8q0Jmq22MJVvZ-1d/assets/block_create_subflow_light.gif?s=e5a9c09cb62729213ceeff4c9359dd19" alt="Creating a subflow (Light Mode)" className="block dark:hidden" width="906" height="528" data-path="assets/block_create_subflow_light.gif" />

  <img src="https://mintcdn.com/odella/8q0Jmq22MJVvZ-1d/assets/block_create_subflow_dark.gif?s=d6e1a56b51d67e1ad6a9339c762da99d" alt="Creating a subflow (Dark Mode)" className="hidden dark:block" width="1010" height="858" data-path="assets/block_create_subflow_dark.gif" />
</Frame>

1. You create a subflow as a separate, smaller workflow.
2. You can then use this subflow in your main workflow or other larger workflows.
3. When a subflow is used, it receives information (inputs) from the main workflow.
4. After the subflow completes its task, it sends back results (outputs) to the main workflow.

<CardGroup cols={2}>
  <Card title="Inputs" icon="arrow-right-to-bracket">
    Information that the subflow needs to do its job, provided by the main workflow.
  </Card>

  <Card title="Outputs" icon="arrow-right-from-bracket">
    Results or processed information that the subflow sends back to the main workflow.
  </Card>
</CardGroup>

## Benefits of Using Subflows

<Card title="Reusability" icon="recycle">
  Create a subflow once and use it in multiple places across your workflows.
</Card>

<Card title="Simplicity" icon="wand-magic-sparkles">
  Break down complex processes into smaller, more manageable parts.
</Card>

<Card title="Organization" icon="folder-tree">
  Keep your workflows neat and tidy by grouping related tasks into subflows.
</Card>

By using subflows, you can build more efficient and organized workflows, making your legal processes smoother and easier to manage.
