Templates / Route LLM prompts with Claude as primary and OpenAI as fallback

Route LLM prompts with Claude as primary and OpenAI as fallback

Ready for 3.0

by Invara ✓ · 2 views · created 2026-08-10 · Engineering, AI Summarization

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 workflow has 9 nodes and runs when another workflow calls it. It uses only n8n's built-in nodes. It also calls api.anthropic.com and api.openai.com over HTTP.

How it runs

Trigger: When another workflow calls it.

  1. Normalize Input Data (Code): runs custom JavaScript code
  2. Configure Models Settings (Edit Fields (Set)): sets 2 fields: primary_model, fallback_model
  3. Post to Claude API (HTTP Request): calls api.anthropic.com (POST)
  4. Check Claude Response Usability (Code): runs custom JavaScript code
  5. Decide on Fallback Requirement (If): checks a condition and branches into true / false
  6. Post to OpenAI API (HTTP Request): calls api.openai.com (POST)
  7. Return Merged Response (Merge): merges the data from its input branches
  8. Check OpenAI Response Usability (Code): runs custom JavaScript code

HTTP calls to: api.anthropic.com, api.openai.com

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.

Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (6)

From the author

Quick overview A reusable LLM router. Another workflow calls it with a prompt, it asks Claude first, and it falls back to OpenAI when the primary answer is empty. It checks the answer field itself, so an empty HTTP 200 also triggers the fallback. How it works…

Excerpt from Invara'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.