# Subflow Tools

While [Tools](/workflow-builder/core-nodes/ai-agent-node/tools.md#llms-with-tools) enable the Large Language Models (LLMs) to access data and perform actions, Subflow Tools enables orchestrations across a fleet of AI agents. &#x20;

### Adding Subflow Tools to the Workflow

You can add Subflow Tools in the AI Agent node by giving your tool a name and an optional description. Think of each subflow flow as a specialist agent that you would like the main agent to command.&#x20;

<figure><img src="/files/85bw5yGDsD7IDXokNztz" alt=""><figcaption><p>Example: Contact Enrichment</p></figcaption></figure>

Subflow Tools can work **independently**. In the contact enrichment example above, these tools check various systems without needing input from each other.

Subflow Tools can also work **collaboratively**. In the report writing example below, the AI Agent node (LLM) can first call the `research website` to cast a wide net. Then, the AI Agent node can call the `article deep dive` to only analyze a subset of articles based on selection criteria.

<figure><img src="/files/tJgX7LRu0SOBEWjuuXs5" alt=""><figcaption><p>Example: Report Writing</p></figcaption></figure>

### Setting up Subflow Tools

Each Subflow Tool can be as simple or complex as required by the business use case.

<figure><img src="/files/ZJXQlyiU4NbA8FplHHr3" alt=""><figcaption></figcaption></figure>

Each Subflow Tool needs to connect to an output node be complete (e.g. Deep Dive Output in the above example). The output node connected with the main orchestrator (e.g. Final Output in the above example) is what end users see.

Prompting for Subflow Tools is easy. In the **Instructions** of the AI Agent node, you can describe

* **The purpose of each Subflow Tool**
* **The logical sequence**: Some tools can be used in parallel (e.g. contact enrichment), while other tools are dependent on each other (e.g. report writing).&#x20;
* **The usage**: Some Subflow Tools are expected to be called multiple times. For example, you may indicate in the Instructions *"use `article deep dive` as many times as needed to analyze every article."*

{% hint style="info" %}
For best results, try to keep the name of the Subflow Tools consistent between the **Instructions** in LLM and the **Subflow Tool** configuration.
{% endhint %}

<figure><img src="/files/bxOelongkjGKKVVAW89d" alt=""><figcaption></figcaption></figure>

### A note on Subflow Tool Input

Input into Subflow Tools may be different from input into the orchestrating LLM (AI Agent node).&#x20;

<figure><img src="/files/Opkoy5iIX3J6kBcoKNkc" alt=""><figcaption><p>Input vs Subflow Tool Input</p></figcaption></figure>

In the report writing example, the **Text Input** may be *"research the list of websites"*, whereas the **Subflow Tool Input** to the `article deep dive` Subflow Tool will be the content of articles found on the websites.&#x20;

You can use these two variables to pass intermediary information to other parts of the workflow based on your needs.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stackai.com/workflow-builder/core-nodes/ai-agent-node/subflow-tools.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
