***

title: Multi-Agent System
subtitle: Create multiple conversation flows in one agent
slug: multi-agent-system
description: >-
Learn how to use the Multi-Agent System and Trigger Subflow node to build one
agent with multiple specialized conversation flows.
---------------------------------------------------

The **Multi-Agent System** allows you to create **multiple conversation flows within a single agent**. Instead of building one massive flow or separate agents for different scenarios, you can organize specialized sub-agents inside one unified agent.

Use the **Trigger Subflow node** to hand off from your main conversation to a specialized sub-agent. When the sub-agent finishes, **the conversation automatically continues from the Trigger Subflow node**—right where it left off.

## Why Use Multi-Agent Systems?

**Key benefit:** Keep your main flow clean and organized while handling complex scenarios in dedicated sub-agents.

**Benefits:**

* **One agent, multiple flows:** All flows share the same phone number, configuration, and analytics
* **Reusable logic:** Use the same sub-agent from multiple points in your conversation
* **Automatic return:** After a sub-agent completes, the main flow continues automatically
* **Easier maintenance:** Update pricing responses in one place instead of scattered throughout your flow
* **Modular organization:** Each sub-agent focuses on one specific task

**Example:** Create a "Pricing Questions" sub-agent. Whenever a user asks about pricing (from anywhere in your main flow), trigger that sub-agent. It answers their questions, then returns control to your main flow exactly where it left off.

## How It Works

### The Trigger Subflow Node

The **Trigger Subflow** node allows your main flow to hand off to a specialized sub-agent, then automatically return.

| Step | What Happens                                                  |
| ---- | ------------------------------------------------------------- |
| 1    | Main flow reaches a **Trigger Subflow** node                  |
| 2    | Main flow **pauses** and saves its position                   |
| 3    | Sub-agent **executes** (handles its specialized task)         |
| 4    | Sub-agent **completes** (reaches the end)                     |
| 5    | Control **automatically returns** to the Trigger Subflow node |
| 6    | Main flow **continues** with the next node                    |

## Setting Up Sub-Agents

### Step 1: Create Your Sub-Agents

In your agent settings, create separate sub-agents for different scenarios:

**Common sub-agents:**

* Pricing Questions
* Technical Support
* Appointment Scheduling
* FAQ Handler

Each sub-agent is a complete conversation flow with its own nodes (Conversation, Branch, Message, etc.).

### Step 2: Trigger Sub-Agents from Your Main Flow

Add **Trigger Subflow nodes** in your main conversation:

1. Click the Plus icon in your main flow
2. Select **"Trigger Subflow"**
3. Choose which sub-agent to trigger
4. Add nodes after it—these execute when the sub-agent returns

**Example:**

```mermaid
flowchart TD
    A["Conversation<br />What can I help with?"] -->|It is a pricing question| C["Trigger Subflow<br />Pricing Questions"]
    A -->|Not a pricing question| D["Continue main flow"]
    
    C --> E["Message<br />Anything else?"]
```

### Step 3: Pass Variables Between Flows

Variables automatically flow between your main flow and sub-agents.

**Main Flow → Sub-Agent:**

```mermaid
flowchart TD
    A["Conversation<br />Collect {user_name}"] -->
    B["Trigger Subflow<br />Support"]
    
    B --> C["Support sub-agent<br />Can use {user_name}"]
```

**Sub-Agent → Main Flow:**

```mermaid
flowchart TD
    A["Support sub-agent<br />Sets {issue_resolved} = true"] -->
    B["Return to main flow"]
    
    B --> C["Branch<br />Is {issue_resolved} true?"]
```

<Tip>
  You can view all available variables (from both your main flow and sub-agents) in the variable drawer. This makes it easy to see which variables are accessible at any point in your flow and helps you reference them correctly in nodes.
</Tip>

## Trigger Subflow vs Jump To

Both **Trigger Subflow** and **Jump To** nodes allow you to redirect your flow, but they serve different purposes. Understanding the difference helps you choose the right tool for your use case.

| Trigger Subflow                    | Jump To                                 |
| ---------------------------------- | --------------------------------------- |
| Jumps to a **different sub-agent** | Jumps to a **node in the same flow**    |
| **Returns automatically**          | **Doesn't return** (permanent redirect) |
| Use for reusable, modular logic    | Use for loops within same flow          |

**Key difference:** Trigger Subflow hands off to a separate sub-agent and automatically returns when done. Jump To redirects to a node within the same flow and doesn't return—it's a permanent redirect.

For more details on when and how to use Jump To nodes, see the [Jump To Node documentation](/configure-jump-nodes).

## FAQ

<AccordionGroup>
  <Accordion title="How many sub-agents can I have in one agent?">
    There's no hard limit, but we recommend keeping it manageable. Beyond that, consider whether you need multiple separate agents.
  </Accordion>

  <Accordion title="Can a sub-agent trigger another sub-agent?">
    Yes, but avoid going more than 2 levels deep. Deep nesting makes flows hard to debug and maintain.
  </Accordion>

  <Accordion title="What happens after a sub-agent completes?">
    It automatically returns to the Trigger Subflow node in your main flow, and the conversation continues with the next node. The user experiences a seamless transition.
  </Accordion>

  <Accordion title="What's the difference between Trigger Subflow and Jump To?">
    **Trigger Subflow** hands off to a separate sub-agent and **automatically returns**. **Jump To** redirects to a node within the same flow and **doesn't return**.

    Use Trigger Subflow for reusable logic. Use Jump To for loops within the same flow.
  </Accordion>

  <Accordion title="Can variables pass between main flow and sub-agents?">
    Yes! Variables collected in your main flow are accessible in sub-agents, and sub-agents can update variables that the main flow will see when it returns.
  </Accordion>
</AccordionGroup>

## Next Steps

* [Learn about Branch Nodes](/configure-branch-nodes) to decide when to trigger sub-agents
* [Understand the Conversation Node](/configure-step-nodes) for collecting variables
* [Review Global Settings](/configure-global-settings) to configure each sub-agent's personality
* [Return to Flow Designer Basics](/flow-designer)
