{"product_id":"n8n-claude-llm-router-route-tasks-to-cheapest-capable-models","title":"n8n Claude LLM Router: Route Tasks to Cheapest Capable Models","description":"\u003ch3\u003eRoute Claude tasks to the cheapest capable model—then escalate only when quality demands it\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow is an \u003cstrong\u003en8n Claude LLM Router\u003c\/strong\u003e that receives an LLM task via webhook (or manual run), classifies what kind of response it needs, and automatically \u003cstrong\u003eroutes to the lowest-cost Anthropic Claude model that can handle it\u003c\/strong\u003e. If enabled, it can also \u003cstrong\u003ejudge response quality\u003c\/strong\u003e and escalate to higher tiers—returning the final answer with a full routing and cost breakdown.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives and validates input\u003c\/strong\u003e on \u003ccode\u003e\/webhook\/llm-router\u003c\/code\u003e, normalizing fields like task, context, budget, and minimum quality requirements. Requests with an empty task are rejected with a \u003cstrong\u003e400 validation error\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eClassifies task needs\u003c\/strong\u003e using \u003cstrong\u003eAnthropic Claude (Haiku)\u003c\/strong\u003e to estimate complexity, risk, and requirements such as code, long context, or web search. If classification fails, it falls back to a built-in heuristic.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSelects the cheapest capable model\u003c\/strong\u003e from a configurable \u003cstrong\u003eAnthropic Claude model catalog\u003c\/strong\u003e, enforcing tier, context window, web search capability, and optional max-cost constraints. It builds an escalation chain accordingly.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eExecutes with the selected model\u003c\/strong\u003e and records tokens, estimated cost, and execution errors.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOptionally judges quality\u003c\/strong\u003e with \u003cstrong\u003eClaude (Haiku)\u003c\/strong\u003e; if the score is below your threshold, it escalates to the next model with reviewer feedback.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReturns a JSON response\u003c\/strong\u003e containing the final answer, routing trace, and cost breakdown—plus savings versus a premium baseline model (when available).\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eReduce LLM spend in SaaS by routing each request to the most cost-efficient Claude model that meets requirements.\u003c\/li\u003e\n  \u003cli\u003eEnsure reliability for high-stakes prompts by enabling quality scoring and automatic escalation.\u003c\/li\u003e\n  \u003cli\u003eUse webhook-driven LLM routing for internal tools, customer support, or ops workflows.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eBuilt with n8n nodes including: \u003cstrong\u003ewebhook\u003c\/strong\u003e, \u003cstrong\u003eif\u003c\/strong\u003e, \u003cstrong\u003eset\u003c\/strong\u003e, \u003cstrong\u003ecode\u003c\/strong\u003e, \u003cstrong\u003eswitch\u003c\/strong\u003e, and \u003cstrong\u003esticky note\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eUses \u003cstrong\u003eAnthropic Claude (Haiku)\u003c\/strong\u003e for both classification and optional quality scoring.\u003c\/li\u003e\n  \u003cli\u003eImplements routing, escalation chains, token\/cost estimation, and structured JSON responses.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46146293170355,"sku":"N8N-20258","price":66.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/BHb9EsdJ-RZhqGAb6dyJU_HjC7GnMm.png?v=1790845763","url":"https:\/\/buyflowscripts.com\/products\/n8n-claude-llm-router-route-tasks-to-cheapest-capable-models","provider":"N8N Commerce","version":"1.0","type":"link"}