Skip to content
Mostafa Mahmoud

All work

Free LLM failover for n8n

An open-source n8n community node that sends each request to a free-tier LLM and moves to the next provider when one hits a rate limit or quota.

Role
Author and maintainer.
Period
2026
Status
Open source on npm
Stack
TypeScript, n8n community node API, LangChain (BaseChatModel), OpenAI-compatible endpoints
  • 5providers
  • v0.4.1published

Architecture

System steps in order

  1. Request
    1. n8n AI Agent (Input)
    2. Panda LLM sub-node (Logic). Feeds: Groq
    3. Response (Output)
  2. Providers
    1. Groq (AI). 429 or quota. Feeds: Response
    2. Cerebras (AI). 429 or quota. Feeds: Response
    3. Gemini (AI). 429 or quota. Feeds: Response
    4. OpenRouter free models (AI). 429 or quota. Feeds: Response
    5. Mistral (AI). Feeds: Response

The problem

Free LLM tiers have rate limits and daily quotas, so an n8n workflow built on one free provider stops working when that provider's quota runs out.

What I built

A main node with provider and model dropdowns and a sortable fallback list, plus a Chat Model sub-node that plugs into the n8n AI Agent and supports tool calling and JSON mode.

Key decisions

  1. One request format for every provider: all five expose OpenAI-compatible endpoints, so only the base URL, key and model change.
  2. The primary provider uses separate Provider and Model dropdowns, because n8n does not support dependent dropdowns inside multi-row collections; fallback rows use one combined "Provider — Model" dropdown loaded across all configured providers.
  3. OpenRouter fallbacks are filtered to free models only.
  4. LangChain is a peer dependency, so the sub-node shares n8n's bundled copy.

Results

Published on npm and maintained through v0.4.1.

All work