{"product_id":"n8n-webhook-circuit-breaker-for-external-apis-with-redis","title":"n8n Webhook Circuit Breaker for External APIs with Redis","description":"\u003ch3\u003eProtect your external APIs with a Redis-backed circuit breaker (n8n Webhook)\u003c\/h3\u003e\n\u003cp\u003eThis n8n automation workflow exposes a \u003cstrong\u003ewebhook-based circuit breaker\u003c\/strong\u003e that routes requests only to \u003cem\u003eapproved external APIs\u003c\/em\u003e, monitors failures in \u003cstrong\u003eRedis\u003c\/strong\u003e, and temporarily blocks calls when error thresholds are exceeded—optionally alerting you via a \u003cstrong\u003eSlack-compatible webhook\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives a POST webhook\u003c\/strong\u003e containing a \u003cem\u003eservice name\u003c\/em\u003e, plus the target \u003cem\u003epath\u003c\/em\u003e, \u003cem\u003emethod\u003c\/em\u003e, and \u003cem\u003epayload\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eValidates inputs\u003c\/strong\u003e by checking the service against a configured \u003cstrong\u003eallowlist\u003c\/strong\u003e, then builds the target URL. Unknown services or unsafe paths are rejected with \u003cstrong\u003e404\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eChecks circuit state in Redis\u003c\/strong\u003e to decide whether to:\n    \u003cul\u003e\n      \u003cli\u003eAllow the call\u003c\/li\u003e\n      \u003cli\u003eImmediately reject with \u003cstrong\u003e503\u003c\/strong\u003e and a \u003cstrong\u003eRetry-After\u003c\/strong\u003e header\u003c\/li\u003e\n      \u003cli\u003eMove into a \u003cstrong\u003ehalf-open\u003c\/strong\u003e state after the cool-down\u003c\/li\u003e\n    \u003c\/ul\u003e\n  \u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eHalf-open probing\u003c\/strong\u003e: in half-open, it \u003cem\u003eclaims a single probe slot\u003c\/em\u003e in Redis so only one request tests recovery; others receive \u003cstrong\u003e503\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCalls the external API\u003c\/strong\u003e with a configured timeout and classifies failures as:\n    \u003cul\u003e\n      \u003cli\u003eNetwork\/timeout errors\u003c\/li\u003e\n      \u003cli\u003e\u003cstrong\u003eHTTP 5xx\u003c\/strong\u003e\u003c\/li\u003e\n      \u003cli\u003e\u003cstrong\u003eHTTP 408\u003c\/strong\u003e\u003c\/li\u003e\n    \u003c\/ul\u003e\n    (Other \u003cstrong\u003e4xx\u003c\/strong\u003e responses do \u003cstrong\u003enot\u003c\/strong\u003e count as service failures.)\n  \u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUpdates Redis + responds\u003c\/strong\u003e: on success, it returns the upstream response (and closes the circuit if it was a probe). On failure, it increments a Redis failure counter, opens the circuit when the threshold is reached, optionally sends an alert via an HTTP webhook, and returns a \u003cstrong\u003e502\u003c\/strong\u003e describing the failure and circuit status.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eReduce outages by preventing repeated calls to failing third-party services.\u003c\/li\u003e\n  \u003cli\u003eEnforce allowlisted routing for external API access via a single n8n webhook.\u003c\/li\u003e\n  \u003cli\u003eProtect SaaS reliability with automated backoff and Slack-style incident alerts.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eNodes\/logic: \u003cstrong\u003ewebhook\u003c\/strong\u003e, \u003cstrong\u003eredis\u003c\/strong\u003e, \u003cstrong\u003eif\u003c\/strong\u003e, \u003cstrong\u003eset\u003c\/strong\u003e, \u003cstrong\u003ecode\u003c\/strong\u003e, and \u003cstrong\u003esticky note\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eRequires Redis credentials on every Redis step and a reachable Redis instance from n8n.\u003c\/li\u003e\n  \u003cli\u003eSupports optional alerting through a \u003cstrong\u003eSlack-compatible HTTP webhook\u003c\/strong\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46157928726707,"sku":"N8N-20355","price":49.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/e_yN1Y9f6wqIowzjQDrFT_roti2dwJ.png?v=1791018633","url":"https:\/\/buyflowscripts.com\/products\/n8n-webhook-circuit-breaker-for-external-apis-with-redis","provider":"N8N Commerce","version":"1.0","type":"link"}