Skip to product information

n8n LLM Router: Claude Primary with OpenAI Fallback Webhook

n8n LLM Router: Claude Primary with OpenAI Fallback Webhook

 (200+Reviews)
Regular price £18.99
Regular price £18.99 Sale price
SAVE Sold out
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
🔥
128+ Sold
Popular with n8n builders
âš¡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
n8n LLM Router: Claude Primary with OpenAI Fallback Webhook

n8n LLM Router: Claude Primary with OpenAI Fallback Webhook

Regular price £18.99
Regular price £18.99 Sale price
SAVE Sold out

Route LLM requests through Claude—with automatic OpenAI fallback

This n8n LLM Router workflow sends your prompt to Anthropic Claude first, then seamlessly falls back to OpenAI Chat Completions whenever Claude doesn’t return usable text. Ideal for n8n automation engineers who want reliability, not guesswork.

What this workflow does

  • Receives input via an Execute Workflow trigger or a POST request to the test webhook (endpoint: /model-router-test).
  • Normalizes your payload into prompt, system, mode, and max_tokens using sensible defaults.
  • Calls Anthropic Claude using the Anthropic Messages API to generate a response.
  • Validates output by checking whether Claude returned usable text content (not just a successful HTTP response).
  • Falls back to OpenAI by sending the same prompt to OpenAI Chat Completions (using gpt-4o-mini) when no usable content is found.
  • Returns the first usable result, including:
    • text
    • the responding model
    • fallback_used (true/false)

Use cases

  • Building a production-ready LLM routing layer inside n8n for customer-facing chat features.
  • Protecting automations from occasional provider failures by automatically switching from Claude to OpenAI.
  • Testing prompts quickly via webhook before wiring the router as a sub-workflow.
  • Standardizing prompt handling across multiple n8n projects with consistent max_tokens and system context.

Technical details

  • Nodes / building blocks: if, code, merge, webhook, sticky note, http request
  • Integrations:
    • Anthropic (Claude HTTP request via Anthropic Messages API)
    • OpenAI (fallback via Chat Completions using gpt-4o-mini)

To set up, add your Anthropic and OpenAI API credentials, then use the test webhook to POST prompt (optionally system, mode, max_tokens). When integrating as a sub-workflow, call it with an Execute Workflow node and pass the expected fields.

View full details