> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow.md).

# Call n8n Workflow Tool

The Call n8n Workflow Tool node is a tool[^1] that allows an agent[^2] to run another n8n workflow and fetch its output data.

On this page, you'll find the node parameters for the Call n8n Workflow Tool node, and links to more resources.

{% hint style="info" %}
**Parameter resolution in sub-nodes**

Sub-nodes behave differently to other nodes when processing multiple items using an expression.

Most nodes, including root nodes, take any number of items as input, process these items, and output the results. You can use expressions to refer to input items, and the node resolves the expression for each item in turn. For example, given an input of five `name` values, the expression `{{ $json.name }}` resolves to each name in turn.

In sub-nodes, the expression always resolves to the first item. For example, given an input of five `name` values, the expression `{{ $json.name }}` always resolves to the first name.
{% endhint %}

## Node parameters <a href="#node-parameters" id="node-parameters"></a>

### Description <a href="#description" id="description"></a>

Enter a custom code a description. This tells the agent when to use this tool. For example:

> Call this tool to get a random color. The input should be a string with comma separated names of colors to exclude.

### Source <a href="#source" id="source"></a>

Tell n8n which workflow to call. You can choose either:

* **Database** to select the workflow from a list or enter a workflow ID.
* **Define Below** and copy in a complete [workflow JSON](/build/manage-workflows/export-and-import.md).

### Workflow Inputs <a href="#workflow-inputs" id="workflow-inputs"></a>

When using **Database** as workflow source, once you choose a sub-workflow (and define the **Workflow Input Schema** in the sub-workflow), you can define the **Workflow Inputs**.

Select the **Refresh** button to pull in the input fields from the sub-workflow.

You can define the workflow input values using any combination of the following options:

* providing fixed values
* using expressions to reference data from the current workflow
* [letting the AI model specify the parameter](/build/integrate-ai/ai-examples/use-ai-for-parameters.md) by selecting the button AI button on the right side of the field
* using the [`$fromAI()` function](/build/integrate-ai/ai-examples/use-ai-for-parameters.md#use-the-fromai-function) in expressions to control the way the model fills in data and to mix AI generated input with other custom input

To reference data from the current workflow, drag fields from the input panel to the field with the Expressions mode selected.

To get started with the `$fromAI()` function, select the "Let the model define this parameter" button on the right side of the field and then use the **X** on the box to revert to user-defined values. The field will change to an expression field pre-populated with the `$fromAI()` expression. From here, you can customize the expression to add other static or dynamic content, or tweak the `$fromAI()` function parameters.

## Templates and examples <a href="#templates-and-examples" id="templates-and-examples"></a>

[Browse Call n8n Workflow Tool node documentation integration templates](https://n8n.io/integrations/workflow-tool) or [search all templates](https://n8n.io/workflows/)

## Related resources <a href="#related-resources" id="related-resources"></a>

Refer to [LangChain's documentation on tools](https://langchain-ai.github.io/langgraphjs/how-tos/tool-calling/) for more information about tools in LangChain.

View n8n's [Advanced AI](/build/integrate-ai.md) documentation.

[^1]: In an AI context, a tool is an add-on resource that the AI can refer to for specific information or functionality when responding to a request. The AI model can use a tool to interact with external systems or complete specific, focused tasks.

[^2]: AI agents are artificial intelligence systems capable of responding to requests, making decisions, and performing real-world tasks for users. They use large language models (LLMs) to interpret user input and make decisions about how to best process requests using the information and resources they have available.
