Block 1 - When chat message received
- Type / Role
- @n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
- Config choices
- Version 1.1
This workflow is provided as-is. Please review and test before using in production.
This workflow is designed to intelligently route user queries to the most suitable large language model (LLM) based on the type of request received in a chat environment. It uses structured classif...
@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.modelselector, @n8n/n8n-nodes-langchain.outputparserstructured, @n8n/n8n-nodes-langchain.memorybufferwindow, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.lmchatanthropic, @n8n/n8n-nodes-langchain.lmchatgooglegemini
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Davide.
Original n8n.io sourceThis workflow is designed to intelligently route user queries to the most suitable large language model (LLM) based on the type of request received in a chat environment. It uses structured classification and model selection to optimize both performance and cost-efficiency in AI-driven conversations.
It dynamically routes requests to specialized AI models based on content type, optimizing response quality and efficiency.
GPT-4.1 mini or Gemini Flash are chosen for tasks where speed is a priority.Input Handling:
chatInput) and a session ID (sessionId).Request Classification:
gpt-4.1-mini) to classify the incoming request into one of four categories: general: For general queries. reasoning: For reasoning-based questions. coding: For code-related requests. search: For queries requiring search tools.Model Selection:
coding requests. reasoning requests. general requests. search (Google-related) requests.AI Processing:
sessionId, enabling multi-turn conversations.Output:
Configure Trigger:
Define Classification Logic:
general, reasoning, coding, search).Connect AI Models:
Set Up Memory:
sessionId from the input for context retention.Test Workflow:
request_type) to ensure correct model selection.Activate Workflow:
Contact me for consulting and support or add me on Linkedin.
This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | AI orchestrator: dynamically selects models based on input type |
|---|---|
| Complexity | intermediate |
| Nodes | 12 |
| Categories | Engineering, AI Chatbot |
| Author | Davide |
| Published | 05 Aug 2025 |
Use the JSON export at /data/workflows/7004/7004.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
This workflow is designed to intelligently route user queries to the most suitable large language model (LLM) based on the type of request received in a chat environment. It uses structured classif...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI Chatbot use case.