The idea is:
Add an option to the webhook trigger
node which sets a rate limit on accepted requests.
- Settings would include the maximum allowed request rate, an evaluation window duration, and a retry-after duration.
- Each workflow tracks its request rate (e.g. by holding a collection of request timestamps which expire from the list automatically after an “evaluation window”)
- n8n stops further requests when the request rate average within the evaluation-window exceeds a specified “maximum rate” (count of tracked request timestamps / evaluation window duration > specified maximum rate).
- When the maximum rate is exceeded, additional requests to the
webhook
endpoint are refused with an http 429 - too many requests / retry-after response - Webhook calls to a resume-workflow-from-wait endpoint would not be included in the rate/count, or could be tracked separately.
My use case:
Without requiring an external load-balancer or reverse-proxy “gatekeeper,” I would like a way to specify a simple, per-workflow limit to regulate how many requests-per-time-unit will be accepted by a webhook
trigger node.
I think it would be beneficial to add this because:
Workflows that are known to be resource-heavy could be “throttled” in a basic way, helping to prevent overloading an n8n server (and/or worker nodes).
Any resources to support this?
- Microservice Design Pattern: Rate Limit
- Semi-Answered Forum Question: Rate limit for webhook entry node
Are you willing to work on this?
If I have time.