Templates / 🤖 Build resilient AI workflows with automatic GPT and Gemini failover chain

🤖 Build resilient AI workflows with automatic GPT and Gemini failover chain

Needs changes

by Lucas Peyrin ✓ · 2,620 views · created 2025-06-23 · Engineering, AI Chatbot

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: LangChain Code (legacy). 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 6 nodes and runs manually, when you click “Execute workflow”. Along the way it connects OpenAI Chat Model and Google Gemini Chat Model.

How it runs

Trigger: Manually, when you click “Execute workflow”.

  1. Agent Variables (Edit Fields (Set)): sets 2 fields: models, fail_count
  2. AI Agent: runs an AI agent, with model: Fallback Models

Services it uses

OpenAI Chat ModelGoogle Gemini Chat Model

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • LangChain Code (legacy) in Fallback Models: no direct replacement.

Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).

Removed in 3.0Replace with
LangChain Code (legacy)
Fallback Models
No direct replacement

Nodes used (6)

From the author

This workflow contains community nodes that are only compatible with the self-hosted version of n8n. How it works This workflow demonstrates how to create a resilient AI Agent that automatically falls back to a different language model if the primary one…

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