AutomationMart
Home/Browse/AI orchestrator: dynamically selects models based on input type
n8n

AI orchestrator: dynamically selects models based on input type

n8nn8n11 modulesv1.0
OpenAILinkedInGeminiPerplexity

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 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. --- Benefits Smart Model Routing: Reduces costs by u

At a glance

AI orchestrator: dynamically selects models based on input type is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects OpenAI, LinkedIn, Gemini, Perplexity. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
OpenAI, LinkedIn, Gemini, Perplexity
Modules
11
Price
Free
Version
v1.0
AI orchestrator: dynamically selects models based on input type workflow diagram

About this workflow

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 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. --- Benefits Smart Model Routing: Reduces costs by using lighter models for general tasks and reserving heavier models for complex needs. Scalability: Easily expandable by adding more request types or LLMs. Maintainability: Clear logic separation between classification, model routing, and execution. Personalization: Can be integrated with session IDs for per-user memory, enabling personalized conversations. Speed Optimization: Fast models like GPT-4.1 mini or Gemini Flash are chosen for tasks where speed is a priority. --- How It Works 1. Input Handling: - The workflow starts with the "When chat message received" node, which triggers the process when a chat message is received. The input includes the chat message (chatInput) and a session ID (sessionId). 2. Request Classification: - The "Request Type" node uses an OpenAI model (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. - The classification is structured using the "Structured Output Parser" node, which enforces a consistent output format. 3. Model Selection: - The "Model Selector" node routes the request to one of four AI models based on the classification: - Opus 4 (Claude 4 Sonnet): Used for coding requests. - Gemini Thinking Pro: Used for reasoning requests. - GPT 4.1 mini: Used for general requests. - Perplexity: Used for search (Google-related) requests. 4. AI Processing: - The selected model processes the request via the "AI Agent" node, which includes intermediate steps for complex tasks. - The "Simple Memory" node retains session context using the provided sessionId, enabling multi-turn conversations. 5. Output: - The final response is generated by the chosen model and returned to the user. --- Set Up Steps 1. Configure Trigger: - Ensure the "When chat message received" node is set up with the correct webhook ID to receive chat inputs. 2. Define Classification Logic: - Adjust the prompt in the "Request Type" node to refine classification accuracy. - Verify the output schema in the "Structured Output Parser" node matches expected categories (general, reasoning, coding, search). 3. Connect AI Models: - Link each model node (Opus 4, Gemini Thinking Pro, GPT 4.1 mini, Perplexity) to the "Model Selector" node. - Ensure credentials (API keys) for each model are correctly configured in their respective nodes. 4. Set Up Memory: - Configure the "Simple Memory" node to use the sessionId from the input for context retention. 5. Test Workflow: - Send test inputs to verify classification and model routing. - Check intermediate outputs (e.g., requesttype) to ensure correct model selection. 6. Activate Workflow: - Toggle the workflow to "Active" in n8n after testing. --- Need help customizing? Contact me for consulting and support or add me on Linkedin.

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Create a session-based Telegram chatbot with GPT-4o-mini and Google Sheets

How It Works This workflow creates an AI-powered Telegram chatbot with session management, allowing users to: - Start new conversations (/new). - Check current sessions (/current). - Resume past sessions (/resume). - Get summaries (/summary). - Ask questions (/question). Key Components: - Session Management: - Uses Google Sheets to track active/expired sessions (storing SESSION IDs and STATE). - /new creates

Free

LinkedIn Search Results or Employees Export & Data Enrichment

LinkedIn lead generation workflow using HARPA and Make.com that collects leads from searches or company employees and enriches your database with profile information. Complete guide: https://harpa.ai/grid/linkedin-lead-generation-and-data-enrichment All collected data is stored in a Google Sheet. You can connect it to your CRM, database, Airtable or other systems.

Free

Generate responses using Perplexity AI and ChatGPT and send them via Telegram

Automatically generate responses using Perplexity AI and ChatGPT then send them via Telegram. Enhance communication by integrating AI-driven replies directly into your Telegram chats.

Free

Create a transcription of new emails and add the details to Google Sheets

This template transcribes new emails and update Google Sheets. Triggered by Google Email, transcribed with ChatGPT and 2 more ChatGPT prompts, and recorded in Google Sheets.

Free

Update a row in Google Sheets for every ChatGPT completion from a custom webhook

Use this template to log every ChatGPT completion in Google Sheets from received custom webhook data. Streamline data tracking and analysis with this integration.

Free

Automated research report generation with AI, Wiki, Search & Gmail/Telegram

Automated Research Report Generation with OpenAI, Wikipedia, Google Search, Gmail/Telegram and PDF Output --- Description What Problem Does This Solve? 🛠️ This workflow automates the process of generating professional research reports for researchers, students, and professionals. It eliminates manual research and report formatting by aggregating data, generating content with AI, and delivering the report as a PDF via Gmail or Telegram. Target audience: Researchers, students, educators, and profe

Free

Slack AI ChatBot : context-aware, replies to mentions AND also DMs

Click here to access this Workflow for free. --- Get your own custom ChatGPT inside your Slack Workspace Description This n8n workflow enables a fully autonomous AI assistant within your Slack Workspace. It listens for both public mentions and direct messages (DMs), and replies in real-time using a large language model (OpenAI's GPT-4o by default). The assistant can dynamically fetch previous messages for better context, providing smart, coherent, and personalized responses. --- 🔧 Key Features

Free

Automate customer support issue resolution using AI text classifier

This n8n template is designed to assist and improve customer support team member capacity by automating the resolution of long-lived and forgotten JIRA issues. How it works Schedule Trigger runs daily to check for long-lived unresolved issues and imports them into the workflow. Each Issue is handled as a separate subworkflow by using an execute workflow node. This allows parallel processing. A report is generated from the issue using its comment history allowing the issue to be classified by

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free