Route API traffic with Stripe RBAC and Redis rate limiting
Ready for 3.0What this workflow does
This workflow has 17 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects Redis. It also calls api.stripe.com over HTTP.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Set - Gateway Config (Edit Fields (Set)): sets 8 fields: apiKey, targetRoute, method…
- HTTP Request: calls api.stripe.com
- JS - Resolve Role (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
- JS - Check Route Permission (Code): runs custom JavaScript code
- Respond - Unauthorized (401) (Respond to Webhook): sends the response back to the webhook caller
- If: checks a condition and branches into true / false
- Redis: incr
- Respond - Forbidden (403) (Respond to Webhook): sends the response back to the webhook caller
- JS - Evaluate Rate Limit (Code): runs custom JavaScript code
…plus 6 more steps. See the full node list below.
Services it uses
HTTP calls to: api.stripe.com
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 (7)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Redis
n8n-nodes-base.redis - Respond to Webhook
n8n-nodes-base.respondToWebhook
From the author
Quick overview This workflow exposes a single n8n webhook as an API gateway that authenticates requests against Stripe customer metadata, authorizes access with role-based permissions, enforces per-role rate limits using Redis, and forwards allowed requests…