Question: How to avoid using sub-workflows for simple LLM tool calls in n8n?
Hi all — I’m working on an AI agent in n8n that routes incoming user queries to the appropriate tool based on intent. The architecture is pretty straightforward: the agent chooses between Tool A or Tool B, depending on the user’s input.
Each Tool has a focused LLM model with its own specific prompt and behavior — for example:
- Tool A identifies tone,
- Tool B summarizes text.
I noticed n8n supports calling LLMs or tools inside sub-workflows, which is great for complex logic. But in my use case, these are just lightweight prompt wrappers — breaking each one out into a full sub-workflow feels like unnecessary overhead, especially when each sub workflow is super specific to it’s parent workflow and only consists of a single node.
The problem:
I’d love to just pass inputs from the AI Agent directly to an in-line “LLM call” with its specific prompt (without forcing a sub-workflow structure). But from what I can tell, n8n doesn’t allow basic Message Model (LLM) nodes to be triggered conditionally from the main workflow, unless wrapped in a sub-workflow. These tools are also very not set in stone, so i’m constantly changing how they work in order to figure out the best setup. So having everything separated into separate workflows where changes need to be made from the parent and sub workflow constantly becomes hard to handle.
It seems n8n can route to tools that perform code or trigger complex chains via sub-workflows…
…but not simply route to lightweight LLM prompt templates without adding sub-workflow complexity.
My Question:
Is there a better way to structure this so I can keep these simple LLM prompt calls inline, without building separate sub-workflows for each one? Maybe, it’s not directly possible the way i’m thinking but is still possible via a workaround?
Here is an example workflow showing how i currently have it working with sub workflows. Which is not ideal.