agent-fallback

AI Agent node for n8n with automatic multi-model failover and retry mechanisms

Package Information

Released: 1 mo ago
Downloads: 0 weeklyย /ย 0 monthly
Latest Version: 0.1.4

Documentation

n8n-nodes-agent-fallback

An AI Agent Community Node for n8n with built-in automatic multi-model failover and retry mechanics.

Connect your Primary Chat Model and up to 5 Fallback Chat Models (e.g., OpenAI GPT-4o, Anthropic Claude 3.5 Sonnet, Google Gemini 1.5 Pro, Groq Llama 3, DeepSeek, etc.). If the primary provider fails due to rate limits (429), timeouts, quotas, server downtime, or context length limits, the node automatically catches the error and seamlessly continues execution with your fallback models.


Features

  • ๐ŸŽฏ Primary Model + Up to 5 Fallbacks: Dedicated visual connectors in the canvas.
  • ๐Ÿ›ก๏ธ Catch-All Resilient Failover: Handles HTTP 429, timeouts, token limits, and 5xx API errors.
  • ๐Ÿ” Configurable Retries & Delay: Set max retries per model and delay between attempts.
  • ๐Ÿ› ๏ธ Full AI Agent Tool Calling: Connect multiple tools (ai_tool) shared seamlessly across all models.
  • ๐Ÿง  Memory & History: Supports ai_memory buffer across runs.
  • ๐Ÿ“ฆ Output Parsers: Structured JSON parsing with ai_outputParser.
  • โšก 100% Transparent Output: Compatible drop-in replacement for standard n8n AI Agent workflows.

Installation

In n8n Community Nodes (UI)

  1. Go to Settings > Community Nodes.
  2. Click Install a community node.
  3. Enter n8n-nodes-agent-fallback and click Install.

In Self-Hosted Docker / Custom Installation

npm install n8n-nodes-agent-fallback

Canvas Connectors

Connector Type Required Description
Primary Model ai_languageModel Yes Main LLM used for execution
Fallback Model 1 ai_languageModel No First failover model if primary fails
Fallback Model 2 ai_languageModel No Second failover model
Fallback Model 3 ai_languageModel No Third failover model
Fallback Model 4 ai_languageModel No Fourth failover model
Fallback Model 5 ai_languageModel No Fifth failover model
Tools ai_tool No Tools available to the agent
Memory ai_memory No Chat conversation history
Output Parser ai_outputParser No Structured output parser

Node Parameters & Options

  • Prompt Type:
    • Define Below: Write prompt directly or use expressions ={{ $json.chatInput }}.
    • Take From Previous Node: Automatically extracts chatInput, text, or prompt from incoming items.
  • Options:
    • System Message: Instructions defining agent persona and constraints.
    • Max Retries per Model: Number of attempts on the same model before falling back (0-5).
    • Delay Between Attempts (ms): Wait time in milliseconds before retry/fallback (default: 1000ms).
    • Max Iterations: Maximum tool-calling loop iterations (default: 10).

Development & Publishing

Build

npm install
npm run build

Run Tests

npm test

Publish to npm

npm publish --access public

License

MIT

Discussion