n8n Webhook LLM Fallback: Anthropic, OpenAI, Gemini + Postgres & Slack
n8n Webhook LLM Fallback: Anthropic, OpenAI, Gemini + Postgres & Slack
Regular price
£36.99
Regular price
£36.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
âš¡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
n8n Webhook LLM Fallback: Anthropic, OpenAI, Gemini + Postgres & Slack
Regular price
£36.99
Regular price
£36.99
Sale price
Unit price
/
per
Resilient LLM answers via an n8n Webhook—Anthropic → OpenAI → Gemini with Postgres logging and Slack alerts
This n8n workflow exposes a POST webhook that sends your prompt through a fallback LLM chain: it tries Anthropic, then OpenAI, and finally Google Gemini. It validates outputs deterministically, logs attempts to Postgres with a circuit breaker, and posts a Slack alert when fallback or degraded responses occur.
What this workflow does
- Receives requests on an n8n Webhook (or runs manually for testing) with an LLM prompt and optional validation settings.
- Normalizes and safeguards inputs: applies defaults, coerces types, and generates a prompt hash for stale-cache fallback.
- Builds an ordered provider chain using provider health stored in Postgres, optionally honoring a preferred provider and skipping providers with an open circuit.
- Calls providers via HTTP, then normalizes and validates the response using deterministic rules (status codes, empty/truncated/blocked/refusal output, length/keyword rules, and optional JSON + schema checks).
- Logs every attempt to Postgres and updates the circuit-breaker state; if needed, it retries with backoff and repair hints, or switches providers.
- Handles total failure gracefully: if all providers fail, it returns a recent successful response for the same prompt hash from Postgres; otherwise it returns an HTTP 503 degraded message.
- Slack notification only when needed: posts an alert when fallback/degraded mode is used.
Use cases
- Mission-critical SaaS automation that must keep working even when an LLM provider is degraded.
- Webhook-driven customer support or internal tools needing consistent JSON-formatted outputs.
- Teams managing reliability with provider health checks, circuit breaking, and audit trails in Postgres.
Technical details
- Integrations: Webhook (POST), Postgres, Slack.
- n8n node types used: if, set, code, wait, slack, switch.
- Core reliability features: LLM failover chain (Anthropic → OpenAI → Google Gemini), deterministic validation, prompt-hash stale fallback, Postgres circuit breaker logging, and Slack alerts.
