AI Intent Router for Dynamic Sub-Workflow Execution - n8n Workflow

Use this advanced n8n workflow template featuring GPT-4o Mini to intelligently route incoming user requests to specialized sub-agents for tasks like reminders, emails, or meetings, leveraging multiple n8n nodes for scalable automation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Automation Architects: Users looking to build scalable, modular n8n workflows based on LLM intent routing.
SaaS Developers: Teams needing a centralized webhook n8n trigger to dispatch diverse customer requests to micro-service workflows.
AI Integrators: Individuals wanting a practical example of combining LangChain agents, chat memory, and structured output parsing within a robust n8n framework.
Technical Experts: Users who want to utilize the full power of the n8n node ecosystem for complex decision trees.

Overview

Managing diverse user requests through a single entry point typically requires complex conditional logic. This advanced n8n workflow solves this by utilizing a powerful AI Agent powered by GPT-4o Mini as the primary intent router. This n8n template provides a highly scalable and maintainable structure where specialized tasks (like setting reminders, sending emails, or scheduling meetings) are delegated to separate, external n8n workflows. The main n8n workflow listens for input via a webhook n8n trigger, uses the AI to determine the user's goal, and ensures the AI's output is strictly formatted using the auto-fixing output parser n8n node, guaranteeing reliable routing via a switch node.

How it Works

This powerful n8n workflow begins with the Webhook n8n trigger, which initiates the process upon receiving a POST request containing user input. This input is immediately passed to the AI Agent n8n node. This agent, configured as a 'Router Agent' and utilizing GPT 4o Mini (via OpenRouter) along with Postgres Chat Memory for context, determines the user's intent (e.g., 'Reminder Agent', 'Email Agent').

The agent's decision is rigorously enforced by the Auto-fixing Output Parser and Structured Output Parser n8n nodes, ensuring the output adheres to a strict JSON format containing the target 'Agent Name' and the original 'user input'.

Next, the Agent Route Switch n8n node reads the determined 'Agent Name'. Based on this value, the workflow branches:


  1. If the intent is 'Reminder Agent', the workflow executes the external Reminder Agent n8n workflow.

  2. If the intent is 'Email Agent', it executes the external Email Agent n8n workflow.

  3. If the intent is 'Meeting Agent', it executes the external Meeting Agent n8n workflow.

  4. If the intent is 'Document Agent', it executes the external Document Agent n8n workflow.

Finally, after the specialized sub-workflow completes its task, the result is captured by a Respond to Webhook n8n node, sending the final, specialized response back to the original caller, completing the end-to-end routing process defined by this comprehensive n8n workflow.

Installation Guide

To deploy this routing n8n workflow template, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON and import it into your n8n instance.

  2. Setup Credentials: Configure the required credentials:

OpenRouter API: Credentials for the GPT 4o Mini n8n node (used for the LLM). Note that this is linked to 'OpenRouter account - sentiimenta.ai' in the provided JSON.
Postgres Database: Credentials for the Postgres Chat Memory n8n node, essential for session management and context.

  1. Configure Webhook: Activate the Webhook n8n trigger. Copy the generated test or production URL, as this will be your centralized API endpoint.

  2. Link Sub-Workflows: The Execute Workflow n8n nodes require pre-existing external n8n workflows (Reminder Agent, Email Agent, Meeting Agent, Document Agent) to be defined in your n8n instance. Ensure the Workflow IDs (fdd9O6hbUriHv64J, zo5FcA7Jq1Vx2FuJ, etc.) match your setup, or update the node parameters to reference the correct workflows.

  3. Testing: Execute the workflow by sending a POST request to the Webhook URL with a message key in the JSON body containing your user query.

Node Details

This n8n workflow relies on several specialized n8n nodes to achieve its dynamic routing functionality:

Webhook (n8n trigger): The entry point, listening for incoming POST requests. It immediately forwards the message body for analysis.
AI Agent (n8n node): The core intelligence. It uses a detailed prompt instructing it to act as a Router Agent and select the appropriate sub-workflow from a predefined list (Reminder, Email, Meeting, Document).
GPT 4o Mini (Language Model): Provides the LLM capabilities to the AI Agent via OpenRouter, making the crucial intent routing decision.
Postgres Chat Memory (n8n node): Used to maintain conversation history for context-aware routing decisions, identifying the user based on the message content itself (sessionIdType: customKey).
Structured Output Parser / Auto-fixing Output Parser: These LangChain n8n nodes ensure the AI output is a predictable JSON structure (Agent Name, user input), which is crucial for the subsequent Switch logic. The Auto-fixing layer increases the reliability of this advanced n8n node configuration.
Agent Route (Switch n8n node): This critical flow control n8n node reads the Agent Name output by the AI and directs the execution path to the corresponding specialized sub-workflow.
Execute Workflow (n8n node): Used multiple times (Reminder Agent, Email Agent, Meeting Agent, Document Agent) to call external, modular n8n templates, passing the extracted user input as a parameter.
Respond to Webhook (n8n node): Sends the final output back to the system that initiated the original webhook n8n trigger.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

🚀 Automation Enthusiast | n8n Creator | SaaS & AI Innovator. I'm Dhrumil Patel, founder of SentIIMenta AI. I build smart solutions using n8n to automate workflows, connect data, and boost efficiency. Passionate about AI, SaaS, and no-code tools. Let’s simplify work and create impact together! 🌐 https://sentiimenta-ai.com | 📩 [email protected]

Featured*