Problem
I’m using an n8n workflow that features an AI agent capable of breaking a complex query into multiple smaller sub-queries. Each sub-query is then sent to a “tool,” which is essentially another n8n workflow. Here’s the issue I’m running into:
- When the agent splits the main query into three sub-queries, it calls the tool workflow three times (one for each sub-query). However, all three tool instances end up receiving only the first sub-query.
- After realizing that two sub-queries went unanswered, the agent calls the tool again for those two. This time, two instances of the tool are spun up—but they both receive only the second sub-query.
- Finally, once the agent is satisfied with the second query’s output, it calls the tool once more for the last sub-query.
My questions and concerns are:
- Why does the n8n agent generate multiple tool instances yet pass only the first sub-query (or the second, in subsequent calls) to all of them, instead of distributing each sub-query to its own instance?
- How can I configure my workflow so that each sub-query is processed correctly without creating redundant calls/instances?
- Given that the tool workflows themselves contain a few agents, what is the best way to optimize so the overall number of agent calls—and thus complexity—is reduced?
Any suggestions or insights into how to properly structure or synchronize these calls would be greatly appreciated!
n8n information setup
n8n version - 1.78.1
Running via docker
Operating system - Mac OS