Templates / Route chat requests through tiered AI agents using OpenRouter and LangChain

Route chat requests through tiered AI agents using OpenRouter and LangChain

Ready for 3.0

by Cheng Siong Chin ✓ · 2 views · created 2026-10-28 · Support Chatbot, AI Chatbot

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This AI workflow has 23 nodes and runs when a chat message arrives. Along the way it connects OpenRouter Chat Model and Wikipedia.

How it runs

Trigger: When a chat message arrives.

  1. Validate and Normalize Payload (Edit Fields (Set)): sets 3 fields: userRequest, sessionId, receivedAt
  2. Score Cost, Risk and Latency (Code): runs custom JavaScript code
  3. Route Request by Tier (Switch): routes items into 4 branches
  4. Return Guardrail Message (Edit Fields (Set)): sets 1 field: output
  5. Small Reasoning Agent (AI Agent): runs an AI agent, with model: Small Model (Fast Tier); 1 tool (Inference Time Thinking); memory: Shared Session Memory
  6. Domain Specialist Agent (AI Agent): runs an AI agent, with model: Domain Model (Specialist Tier); memory: Shared Session Memory
  7. Agentic Orchestrator (AI Agent): runs an AI agent, with model: Orchestrator Model (Reasoning Tier); 6 tools (Calculator, Critic Agent, Wikipedia, Domain Specialist…); memory: Shared Session Memory
  8. Compose Reply and Telemetry (Edit Fields (Set)): sets 7 fields: output, route, domain…

Services it uses

OpenRouter Chat ModelWikipedia

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (11)

From the author

Quick Overview This workflow provides a tiered chat assistant that validates each request, scores it for domain, complexity, and risk, then routes it to a fast OpenRouter model, a domain-specialist OpenRouter model, or a multi-agent OpenRouter orchestrator…

Excerpt from Cheng Siong Chin's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.