New Tool Radar

AI Agents & Automation

How to Let an n8n AI Agent Call a Sub-Workflow as a Tool

Expose a second n8n workflow to an AI agent through the Call n8n Workflow tool so the agent can run a fixed multi-step job on demand.

Schematic diagram with three steps: Build the sub-workflow, Expose it as a tool, then Test the agent call.

Some jobs are too fixed for an agent to invent and too variable to hard-code: look up an order, check a rule, then write the result somewhere. The Call n8n Workflow Tool lets the agent run a whole second workflow as one tool call, with the fixed steps inside the sub-workflow and the choice of when to run it left to the agent.

Before you start

You need a working n8n AI Agent node and a second workflow that does one job from start to finish. The sub-workflow needs a clear input, such as an order number, and a clear output, such as a status line. Test the sub-workflow on its own first.

Build the sub-workflow, then expose it as a tool

Build the sub-workflow with its own trigger and steps, and give it an Execute Workflow Trigger so another workflow can call it. In the agent workflow, attach the Call n8n Workflow Tool sub-node and select the sub-workflow. Write the tool description with the input it needs and the output it returns, because that description is what the model reads when it decides to call it.

Test the agent call and read the sub-workflow log

Ask the agent a question that needs the sub-workflow, then open the sub-workflow execution log and check it ran once with the right input. If the agent never calls it, the description is too vague about when it applies. If it calls it twice for one question, the system message needs a rule against repeat calls.

Worked example: A fictional order check split across two workflows

Northwind Orders is a fictional orders desk. The agent workflow answers questions; the sub-workflow checks an order and returns its status. The table shows one call.

Step Workflow What happens
1 Agent workflow User asks for the status of order 1042
2 Agent workflow Agent calls the order-check tool with 1042
3 Sub-workflow Looks up order 1042 and returns its status
4 Agent workflow Agent replies with the returned status

Expected result (UNTESTED): one question produces one sub-workflow execution for order 1042, and the reply quotes the returned status. We checked the n8n tutorial, which lists the Call n8n Workflow Tool among the agent tools, but we did not run the two workflows on a live n8n instance.

Limits

A sub-workflow call hides its steps from the agent, so a failure inside it looks like a tool failure to the agent. Keep the sub-workflow short, give it one job, and log its result so you can trace a bad answer back to the step that produced it.

Sources

See all