Deploy a sophisticated n8n workflow to route user queries dynamically to the best LLM (GPT, Claude, Gemini, Perplexity) based on request type (coding, reasoning, general). Perfect n8n template for AI orchestration.
Download this n8n workflow template and start using it instantly.
Users building advanced, multi-model AI chatbots.
Developers needing robust n8n templates for AI model management.
Engineers focused on optimizing LLM usage and minimizing costs.
Anyone seeking to deploy complex AI orchestration using the n8n node ecosystem.
This advanced n8n workflow solves the common problem of relying on a single Large Language Model (LLM) for diverse conversational tasks. By implementing a smart classification layer, the n8n automation first determines the intent of the user's message (e.g., coding, complex reasoning, or general query). It then uses the powerful Model Selector n8n node to dynamically dispatch the query to the specific LLM best suited for that task. For instance, coding questions are routed to a top-tier code model like Claude Opus 4, while reasoning tasks go to a highly capable GPT n8n node. This approach maximizes response quality, ensures speed, and significantly improves cost efficiency, making this one of the most practical n8n templates for building scalable AI solutions.
This intelligent n8n workflow operates entirely based on dynamic routing decisions:
When chat message received n8n trigger, which activates the n8n workflow upon receiving a new user input from the configured chat application.Request Type Chain LLM. This step uses a primary OpenAI Chat Model alongside a Structured Output Parser n8n node to classify the user's intent into categories like 'coding', 'reasoning', 'general', or 'search'.AI Agent n8n node. This agent maintains conversation context using the Simple Memory n8n node, ensuring the LLM response is relevant to the history.Model Selector n8n node reads the request_type output from the classification step. It contains preset rules that match the intent to a specific LLM.To install this robust n8n workflow, follow these steps:
When chat message received n8n trigger. You may need to specify the chat platform or configure the webhook ID depending on your environment.The core intelligence of this n8n workflow is built upon specialized Langchain n8n node types:
When chat message received (n8n trigger):
Function: Starts the n8n workflow immediately upon receiving a chat message input.
Key Configuration: Uses a specific webhook ID to listen for incoming chat data.
Request Type (Chain LLM) & OpenAI Chat Model:
Function: Classifies the incoming text using an initial LLM model (GPT 4.1 mini) based on a defined prompt that outputs the request type (coding, reasoning, general, search).
Key Configuration: Input prompt explicitly defines the classification criteria.
Structured Output Parser (n8n node):
Function: Enforces a rigid JSON schema {"requesttype": "string"} on the LLM's classification output, ensuring reliable data for the Model Selector.
Key Configuration: Defines a simple object schema to capture the classification.
AI Agent (n8n node):
Function: Acts as the execution orchestrator, tying together the input, memory, and the dynamically selected LLM for the final task.
Key Configuration: Input text is mapped from the original chatInput of the n8n trigger.
Simple Memory (n8n node):
Function: Manages conversation history, using the chat sessionId to maintain context for multi-turn conversations.
Model Selector (n8n node):
Function: The central routing decision point. It checks the requesttype output and directs the query to one of the four connected specialized LLM n8n nodes.
* Key Configuration: Contains conditional logic (e.g., If request_type equals 'coding', use Anthropic's Opus 4).
Automate instant and conversational responses in Slack Direct Messages and @mentions using this robust n8n workflow. Integrate OpenAI memory and generate context-aware replies.

Use this powerful n8n workflow to create a dynamic AI chatbot directly inside Slack. It uses a Webhook n8n trigger to accept slash commands, processes queries via the OpenAI n8n node (gpt-4o-mini), and posts the response back instantly.

Use this powerful n8n workflow to dynamically execute multiple n8n automations from a single Slack mention. Features AI-powered routing and centralized workflow management using the n8n Data Table node.

Use this advanced n8n workflow to build a smart Telegram bot powered by Google Gemini AI. It classifies user queries, scrapes Amazon product data, and delivers personalized recommendations, making it a perfect example of effective n8n templates.

Use this sophisticated n8n workflow to automatically calculate time gaps between meetings, check local weather, and use GPT-4 to generate personalized, context-aware break spot recommendations delivered straight to Slack.

Full-stack Web Developer based in Italy specialising in Marketing & AI-powered automations. For business enquiries, send me an email at [email protected] or add me on Linkedin.com/in/davideboizza







































