The Rate Limit node is lying to you (a little)

Hi everyone,

I apologize for the slightly dramatic title :sweat_smile::person_bowing: . My goal is just to spark a conversation about the Rate Limit node.

The current Delay / Rate Limit node is very useful, but I've noticed a behavior that can be a bit confusing and might not fit all use cases.

When we configure the node to allow X messages per Y time unit (e.g., 5 messages per minute), it doesn't send the first X messages and then wait. Instead, it spaces out the messages evenly. For example, 5 messages per minute actually means one message is sent every 12 seconds, the node does the math for you: 60/5.

That what confused me for a while: I could not believe it was just doing the math for you, nothing else.. :sweat_smile:

This works great for smoothing out a stream of data, but not exactly what I wanted.

I'd like to suggest a new option for the Rate Limit node, a "burst" mode or similar. This mode would allow the first X messages to pass through immediately (or as fast or slow as they arrive), and then block any subsequent messages until the Y time unit has elapsed.

Example of the proposed "burst" mode:

  • Setup: The node is set to allow 5 messages per minute.

  • Input: A flow sends 1 message per second.

  • Output:

    1. The first 5 messages would pass through at a rate of 1 message per second (at the speed they arrive)

    2. The node would then block all messages for the next 55 seconds (to complete the minute).

    3. After the minute has passed, the counter would reset, and the node would be ready to accept another 5 messages.

I found an old discussion about a similar topic (Rate limiting with delay node), but it didn't seem to gain much traction. I hope this new proposal sparks a conversation and maybe even a new feature!

Note: some people built a function for this, but I think it would be great to have it in delay node.

I would also like to have this “Burst mode” option be available. Would save me from writing or copy/pasting function nodes for this common task.

1 Like

image

I usually put a feedback loop from the output of the delay node so when required i can 'flush' the number of messages from the buffer in a burst.
return {flush:5}; in a function node would release 5 messages in a burst.

Please ignore if you are already doing the same.