Templates / Route AI prompts between Anthropic, Google Gemini, Mistral and OpenAI

Route AI prompts between Anthropic, Google Gemini, Mistral and OpenAI

Ready for 3.0

by Triple 8 Labs ✓ · 77 views · created 2026-06-13 · 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-10-19.

What this workflow does

This workflow has 12 nodes and runs when another workflow calls it. It uses only n8n's built-in nodes. It also calls api.anthropic.com, api.mistral.ai and api.openai.com over HTTP.

How it runs

Trigger: When another workflow calls it.

  1. CONFIG (Edit Fields (Set)): sets 8 fields: DEFAULT_PROVIDER, DEFAULT_ANTHROPIC_MODEL, DEFAULT_GOOGLE_MODEL…
  2. Normalize Input (Code): runs custom JavaScript code
  3. Validate Token Budget (Code): runs custom JavaScript code
  4. Which Provider? (Switch): routes items into 4 branches
  5. Anthropic Chat (HTTP Request): calls api.anthropic.com (POST)
  6. Google Chat (HTTP Request): calls an HTTP API (POST)
  7. Mistral Chat (HTTP Request): calls api.mistral.ai (POST)
  8. OpenAI Chat (HTTP Request): calls api.openai.com (POST)
  9. Merge Provider Response (Code): runs custom JavaScript code
  10. Cost Tracking (Code): runs custom JavaScript code

…plus 1 more step. See the full node list below.

HTTP calls to: api.anthropic.com, api.mistral.ai, 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.

Nodes used (5)

From the author

Quick overview A reusable sub-workflow that routes text prompts to Anthropic Claude, Google Gemini, Mistral, or OpenAI and returns a normalised response - including estimated token usage and cost - regardless of the provider. Drop it into any workflow via…

Excerpt from Triple 8 Labs'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.