Protect downstream APIs with a circuit breaker using Data Tables
Ready for 3.0What this workflow does
This workflow has 16 nodes and runs when an HTTP POST request hits its webhook URL (plus 1 other trigger). It uses only n8n's built-in nodes.
How it runs
Trigger: When an HTTP POST request hits its webhook URL (plus 1 other trigger).
- Normalize Check (Code): runs custom JavaScript code
- Normalize Result (Code): runs custom JavaScript code
- Configure Circuit Breaker (Code): runs custom JavaScript code
- Route Circuit Request (Switch): routes items into 2 branches
- Get Circuit for Check (Data table): get
- Get Circuit for Result (Data table): get
- Evaluate Circuit (Code): runs custom JavaScript code
- Apply Service Result (Code): runs custom JavaScript code
- Route Check Decision (Switch): routes items into 3 branches
- Update Circuit State (Data table): update
…plus 4 more steps. See the full node list below.
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (4)
- Webhook
n8n-nodes-base.webhook - Code
n8n-nodes-base.code - Switch
n8n-nodes-base.switch - Data table
n8n-nodes-base.dataTable
From the author
Quick overview Stop n8n workflows from repeatedly calling an unavailable API by opening a circuit after consecutive failures, enforcing a cooldown, and allowing a controlled half-open recovery trial. How it works 1. Receives a POST request on the…