Manage adaptive API rate limiting with a webhook proxy and Redis
Ready for 3.0What this workflow does
This workflow has 26 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects Redis.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Set - Limiter Config (Edit Fields (Set)): sets 12 fields: serviceName, requestPath, requestMethod…
- JS - Resolve Service (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
- Redis: get
- Respond - Unknown Service (404) (Respond to Webhook): sends the response back to the webhook caller
- JS - Compute Effective Limit (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
- Respond - Throttled (429) (Respond to Webhook): sends the response back to the webhook caller
- Redis: incr
- JS - Evaluate Quota (Code): runs custom JavaScript code
…plus 15 more steps. See the full node list below.
Services it uses
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 (8)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Respond to Webhook
n8n-nodes-base.respondToWebhook - Redis
n8n-nodes-base.redis - Wait
n8n-nodes-base.wait - HTTP Request
n8n-nodes-base.httpRequest
From the author
Quick overview This workflow exposes a webhook that proxies calls to approved upstream APIs and enforces per-service rate limits in Redis, dynamically adjusting limits based on 429/Retry-After and X-RateLimit- headers while optionally delaying over-budget…