Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Data Sync & ETL

Data Sync & ETL

Route LLM requests with Anthropic, OpenAI, Gemini, Postgres, and Slack

When you run it, it moves and syncs data with Claude and OpenAI / ChatGPT using Postgres, Slack.

What it does

## 🔀 LLM Fallback Chain Sends one prompt through an ordered chain of LLM providers (Anthropic → OpenAI → Gemini). Every response is validated in code. On failure the workflow retries, switches provider, or falls back to a stale cached answer / static degraded message. Every attempt is logged to Postgres. ### Pipeline Request → Config → Normalize → Circuit breaker → Provider loop → Call → Validate → Log + update health → valid? → success | retry / switch / degrade → Save result → Slack (only on fallback) → Respond ### Resilience features 1. Ordered provider chain + optional preferredProvider 2. Circuit breaker (skip after N failures, cooldown, half-open probe) 3. Error classification (429 / 5xx / timeout = retryable; 4xx = switch) 4. Deterministic response validation (empty, truncation, safety, refusal, length, keywords, JSON schema) 5. Repair retry (invalid output → validation issues added to prompt) 6. Degraded modes: stale cache → static 503 message 7. Full audit trail in Postgres ### Setup checklist 1. Import workflow 2. Run llm_fallback_schema.sql 3. Create 3 Header Auth credentials and attach to the matching HTTP nodes: - Anthropic (x-api-key) - OpenAI (Authorization: Bearer …) - Gemini (x-goog-api-key) 4. Attach Postgres + Slack credentials 5. Edit Set - Fallback Config (order, models, limits, channel) 6. Test with Manual Trigger, then activate for the webhook ### Webhook payload (all optional) json { "requestId": "…", "prompt": "…", "systemPrompt": "…", "expectJson": true, "schema": { "key": "string|number|boolean|array|object|enum:a|b" }, "maxTokens": 1024, "temperature": 0.2, "preferredProvider": "anthropic", "minChars": 2, "maxChars": 8000, "mustContain": [], "mustNotContain": [] } ### Response shape json { "requestId": "…", "status": "success | success_after_fallback | degraded_cached | degraded_static", "provider": "…", "model": "…", "text": "…", "parsed": {}, "stale": false, "fallbackUsed": false, "attemptCount": 1, "totalLatencyMs": 0, "skippedProviders": [], "trace": [] }

The steps

  1. Manual Trigger - Start Request
  2. Webhook - LLM Request
  3. Set - Fallback Config
  4. JS - Normalize Request
  5. Postgres - Read Provider Health
  6. JS - Build Provider Chain
  7. JS - Select Provider
  8. Switch - Provider Router
  9. HTTP Request - Anthropic
  10. HTTP Request - OpenAI
  11. HTTP Request - Gemini
  12. JS - Normalize & Validate
  13. Postgres - Log Attempt & Health
  14. JS - Restore Attempt State

27 steps in total.

Similar automations