# Route chat requests through tiered AI agents using OpenRouter and LangChain

> 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 with critic and scenario simulation tools. How it works 1. Receives a chat request via an n8n Chat Trigger webhook. 2. Normalizes the incoming payload, extracting the user request text and session ID and adding a timestamp. 3. Scores the request for domain hints, complexity, and guardrail risks (empty, oversized, or prompt-injection markers) and assigns a routing tier. 4. If the request is blocked, returns a guardrail message without calling any language model. 5. If the request is simple, uses OpenRouter with shared session memory to generate a concise response. 6. If the request matches a domain (code, legal, finance, bio, or science), uses an OpenRouter domain-specialist agent with shared session memory to produce a structured ans

- **Domain**: `n8n-workflow-21915.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/21915
- Page (HTML): https://agenstry.com/agents/n8n-workflow-21915.n8n.io
- Documentation: https://n8n.io/workflows/21915
