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

# Subagent Node

> Use a subagent node for dialogue that can call tools during the conversation

Subagent node is used to have a conversation with the user while allowing the agent to call tools / functions during the conversation. Use it when the agent should decide whether and when to use a tool / function based on the conversation context.

If you only need dialogue without tool calling, use a [Conversation Node](/build/conversation-flow/conversation-node).

## How It Works

When a subagent node has tools / functions attached, the LLM receives both the node instruction and the list of available tools / functions. During the conversation, the LLM determines when a tool / function should be called based on context, extracts the required parameters, and invokes it while maintaining the dialogue with the user.

* Multiple tools / functions can be added to a single subagent node
* The agent can continue talking while a tool / function executes
* Tool / function results are available to the LLM for generating follow-up responses

## Write Instruction

Subagent nodes only support `Prompt` instructions. Unlike a conversation node, `Static Sentence` is not supported.

Write the instruction to define the task, what information the agent should gather, and when it should use the available tools / functions.

For example:

```text theme={null}
Help the user check their order status. If the user provides an order number,
use the available order lookup tool to retrieve the latest status.
```

## Subagent Node vs Function Node

Subagent nodes and [function nodes](/build/conversation-flow/function-node) serve different purposes:

|                    | Function Node                                                  | Subagent Node                                                                           |
| ------------------ | -------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| **Execution**      | Deterministic — executes on node entry                         | LLM-driven — called when the LLM decides it's appropriate                               |
| **Tools per node** | One                                                            | Multiple                                                                                |
| **Conversation**   | Not intended for dialogue                                      | Full dialogue with tools available                                                      |
| **Best for**       | Always-execute actions (e.g. always look up an order on entry) | Context-dependent actions during dialogue (e.g. look up an order only if the user asks) |

**Use function nodes** when you want guaranteed execution every time the flow reaches that step.

**Use subagent nodes** when the agent should decide whether and when to call a tool / function based on what the user says.

## Add Tools / Functions

<Steps>
  <Step title="Select a subagent node">
    Click on a subagent node to open its settings panel on the right side.
  </Step>

  <Step title="Add a tool / function">
    In the settings panel, find the **Tools** section and click **+ Add**.

    Select the tool / function type from the dropdown menu.
  </Step>

  <Step title="Configure the tool / function">
    Configure the tool / function based on its type. See the **Available Tool / Function Types** table below for configuration details for each type.
  </Step>

  <Step title="Update the node instruction">
    Update the node prompt to guide the LLM on when to use the tool / function.
  </Step>
</Steps>

## Available Tool / Function Types

| Tool Type                   | Description                                             | Configuration Guide                                               |
| --------------------------- | ------------------------------------------------------- | ----------------------------------------------------------------- |
| Custom Function             | Make HTTP requests to your external APIs                | [Custom Function](/build/conversation-flow/custom-function)       |
| Code Tool                   | Run JavaScript code directly without an external server | [Code Tool](/build/single-multi-prompt/code-tool)                 |
| Check Calendar Availability | Query available time slots via Cal.com                  | [Check Availability](/build/check-availability)                   |
| Book Appointment            | Book calendar events via Cal.com                        | [Book Calendar](/build/book-calendar)                             |
| End Call                    | Terminate the call                                      | [End Call](/build/single-multi-prompt/end-call)                   |
| Transfer Call               | Transfer to a phone number                              | [Transfer Call](/build/single-multi-prompt/transfer-call)         |
| Transfer Agent              | Transfer to another Retell agent                        | [Transfer Agent](/build/single-multi-prompt/transfer-agent)       |
| Press Digit                 | Send DTMF tones                                         | [Press Digit](/build/single-multi-prompt/press-digit)             |
| Send SMS                    | Send a text message                                     | [Send SMS](/build/single-multi-prompt/send-sms)                   |
| Extract Dynamic Variable    | Extract variables from the conversation                 | [Extract Dynamic Variable](/build/single-multi-prompt/extract-dv) |
| MCP Tool                    | Call tools on your MCP server                           | [MCP Node](/build/conversation-flow/mcp-node)                     |

## Execution Speech Settings

Each tool / function has settings that control what the agent says while it is running and after it completes.

### Speak During Execution

When enabled, the agent says a message while the tool / function is executing, for example `One moment, let me check that for you.` This is recommended when the tool / function takes over 1 second, including network latency, so the agent remains responsive.

You can configure how the message is generated:

* **Prompt**: The LLM dynamically generates what to say based on a description you provide.
* **Static Sentence**: The agent speaks the exact text you provide.

### Speak After Execution

When enabled, the agent calls the LLM after the tool / function returns a result so it can speak about the outcome to the user. Turn this off if you want to run it silently.

<Note>
  * **Speak During Execution** is available on: Custom Function, Code Tool, End Call, Transfer Call, Transfer Agent, and MCP Tool.
  * **Speak After Execution** is available on: Custom Function, Code Tool, and MCP Tool.
</Note>

## When Can Transition Happen

* when user is done speaking
* when `Skip Response` is enabled and agent finishes speaking

Tool / function execution happens within the subagent node, so the node can stay active across multiple turns and tool / function calls before it transitions.

## Node Settings

* **Tools**: attach the tools / functions this subagent can use during the conversation.
* **Skip Response**: when enabled, the transition will only have one edge that you can connect, and when agent is done talking, it will transition to the next node via that specific edge.
* **Knowledge Base**: configure node-level knowledge bases to combine topic-specific knowledge with the agent-level knowledge base. Read more at [Knowledge Base](/build/knowledge-base).
* **Global Node**: read more at [Global Node](/build/conversation-flow/global-node)
* **Block Interruptions**: when enabled, the agent will not be interrupted by user when speaking.
* **LLM**: choose a different model for this particular node. Will be used for response generation, tool / function selection, and tool / function argument generation.
* **Fine-tuning Examples**: Can finetune conversation response, and transition. Read more at [Finetune Examples](/build/conversation-flow/finetune-examples)

## Best Practices

* **Be explicit in your node instruction.** Tell the agent when each tool / function should be used.
* **Use function nodes for guaranteed execution.** If a tool / function must always run at a certain point in the flow, use a function node instead.
* **Avoid adding too many tools / functions to one subagent node.** If you have many tools / functions, consider splitting them across multiple subagent nodes.
