# Help with \`delay\` node set to \`rate limit\`

**URL:** https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400
**Category:** General
**Created:** [3 July 2026 03:31 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400 "2026-07-03T03:31:12Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [3 July 2026 03:31 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/1 "2026-07-03T03:31:12Z")

</div>

Ok, so new problem.

I have a `delay` node set to `rate limit`.

Is there a way that if it has messages queued up (queueing up?) and the first one completes, can I send the node a signal to send the next message?  
As in: not _peek_ at it, but actually step to the next message.

Thanks.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [3 July 2026 04:57 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/2 "2026-07-03T04:57:24Z")

</div>

I recommend [node-red-contrib-queue-gate (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-queue-gate) when doing this sort of thing

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [3 July 2026 06:17 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/3 "2026-07-03T06:17:01Z")

</div>

I’ll throw my hat in this one 🙂

> **[@marcus-j-davies/node-red-semaphore-plus](https://flows.nodered.org/node/@marcus-j-davies/node-red-semaphore-plus)**
>
> An advanced set of semaphore Nodes for Node RED, with a dynamic fail-safe

May help you also, may not - but just in case

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [3 July 2026 06:30 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/4 "2026-07-03T06:30:16Z")

</div>

@cymplecy  
Thanks!

Forgot I had that.

Not to add more nodes, I'll use it.

Silly me for forgetting I had it.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [3 July 2026 06:54 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/5 "2026-07-03T06:54:59Z")

</div>

Does sending a message with no payload, and msg.flush = 1 not release the next message from the delay node?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [3 July 2026 06:55 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/6 "2026-07-03T06:55:46Z")

</div>

Sending in msg.flush set to a number will release that many right away. So msg.flush=1 will release the next message

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [3 July 2026 06:57 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/7 "2026-07-03T06:57:28Z")

</div>

That's a point of contention.

FLUSH.....

So that sends the next message or PEEKS at it?

I seem to remember the latter.

That causes all sorts of trouble.

OK, I was wrong.

Thanks. That maybe nicer to apply.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 July 2026 07:23 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/8 "2026-07-03T07:23:51Z")

</div>

Here is my standard flow, using a delay node, for handling messages sequentially. Open the comment node for full details of how to use it.

If you want to include a retry feature to retry messages that fail for some reason (for example sending email messages where the send may fail) then you can use [@colinl/node-red-guaranteed-delivery](https://flows.nodered.org/node/@colinl/node-red-guaranteed-delivery).

```flows
[{"id":"c8c6291649a49d8f","type":"group","z":"c558f696974f8e89","name":"Sequential Operation","style":{"label":true},"nodes":["b6630ded2db7d680","ed63ee4225312b40","a82c03c3d34f683c","2128a855234c1016","7c6253e5d34769ac","b23cea1074943d4d","d4d479e614e82a49","3a9faf0a95b4a9bb","7eb760e019b512dc","e35f37deeae94860"],"x":34,"y":79,"w":942,"h":282},{"id":"b6630ded2db7d680","type":"inject","z":"c558f696974f8e89","g":"c8c6291649a49d8f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":240,"wires":[["ed63ee4225312b40"]]},{"id":"ed63ee4225312b40","type":"delay","z":"c558f696974f8e89","g":"c8c6291649a49d8f","name":"Queue","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":350,"y":240,"wires":[["d4d479e614e82a49","7eb760e019b512dc"]]},{"id":"a82c03c3d34f683c","type":"delay","z":"c558f696974f8e89","g":"c8c6291649a49d8f","name":"Some more stuff to do","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":840,"y":240,"wires":[["7c6253e5d34769ac","b23cea1074943d4d"]]},{"id":"2128a855234c1016","type":"link in","z":"c558f696974f8e89","g":"c8c6291649a49d8f","name":"link in 1","links":["7c6253e5d34769ac"],"x":135,"y":320,"wires":[["3a9faf0a95b4a9bb"]]},{"id":"7c6253e5d34769ac","type":"link out","z":"c558f696974f8e89","g":"c8c6291649a49d8f","name":"link out 1","mode":"link","links":["2128a855234c1016"],"x":935,"y":320,"wires":[]},{"id":"b23cea1074943d4d","type":"debug","z":"c558f696974f8e89","g":"c8c6291649a49d8f","name":"OUT","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":710,"y":180,"wires":[]},{"id":"d4d479e614e82a49","type":"debug","z":"c558f696974f8e89","g":"c8c6291649a49d8f","name":"IN","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":490,"y":180,"wires":[]},{"id":"3a9faf0a95b4a9bb","type":"function","z":"c558f696974f8e89","g":"c8c6291649a49d8f","name":"Flush","func":"return {flush: 1}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":230,"y":320,"wires":[["ed63ee4225312b40"]]},{"id":"7eb760e019b512dc","type":"function","z":"c558f696974f8e89","g":"c8c6291649a49d8f","name":"Some functions to be performed","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":240,"wires":[["a82c03c3d34f683c"]]},{"id":"e35f37deeae94860","type":"comment","z":"c558f696974f8e89","g":"c8c6291649a49d8f","name":"Set the queue timeout to larger than you ever expect the process to take","info":"This is a simple flow which allows a sequence of nodes to be \nprotected so that only one message is allowed in at a time. \nIt uses a Delay node in Rate Limit mode to queue them, but \nreleases them, using the Flush mechanism, as soon as the \nprevious one is complete. Set the timeout in the delay node to \na value greater than the maximum time you expect it ever to take. \nIf for some reason the flow locks up (a message fails to indicate \ncompletion) then the next message will be released after that time.\n\nMake sure that you trap any errors and feed back to the Flush \nnode when you have handled the error. Also make sure only one \nmessage is fed back for each one in, even in the case of errors.","x":310,"y":120,"wires":[]}]

```

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [3 July 2026 07:25 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/9 "2026-07-03T07:25:53Z")

</div>

Thanks.

Just completed something just like that.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [3 July 2026 10:12 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/10 "2026-07-03T10:12:06Z")

</div>

You may already have this built-in but there should probably be some kind of limiter on the total number of messages queued? In theory, it would be possible to crash Node-RED without any limiter I think?

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [3 July 2026 19:36 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/11 "2026-07-03T19:36:50Z")

</div>

Yes - setting `nodeMessageBufferMaxLength` can set a max number of messages to store - default is "infinite" ie no limit. But you can set it if you are worried... of course what to set it to will depend on size of messages being held, rate of arrival, processing, and physical space etc....

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [4 July 2026 08:58 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/12 "2026-07-04T08:58:03Z")

</div>

> [@TotallyInformation](#):
>
> there should probably be some kind of limiter on the total number of messages queued? In theory, it would be possible to crash Node-RED

The same is true of a simple Delay node in rate limit mode, and queuing intermediate messages. If you send it messages at a rate greater than it can cope with then it will eventually crash node-red.

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [4 July 2026 09:18 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/13 "2026-07-04T09:18:43Z")

</div>

So as it has been mentioned here a couple of times in the latter posts.....

Where/how do I set a maximum queue size?

 ![Screenshot from 2026-07-04 19-17-02](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/e/9ecff94dd5515a134a271b7d285777462be050c8.png)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [4 July 2026 09:58 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/14 "2026-07-04T09:58:47Z")

</div>

> [@dceejay](#):
>
> nodeMessageBufferMaxLength

You can't set it specifically in the delay node. You can set it for all nodes in settings.js

```auto
    /** The maximum number of messages nodes will buffer internally as part of their
     * operation. This applies across a range of nodes that operate on message sequences.
     * defaults to no limit. A value of 0 also means no limit is applied.
     */
    //nodeMessageBufferMaxLength: 0,

```

If you want to specifically set it in a particular flow with a queue then use [@colinl/node-red-guaranteed-delivery](https://flows.nodered.org/node/@colinl/node-red-guaranteed-delivery) which does have a setting for that.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [4 July 2026 10:02 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/15 "2026-07-04T10:02:38Z")

</div>

> [@Colin](#):
>
> You can set it for all nodes in settings.js

Actually I am not sure which nodes this applies to, whether it is just a set of core nodes or all nodes. Also, I don't know what they do with additional messages when the count is exceeded. The guaranteed delivery node drops the oldest messages and queues new messages once the count is exceeded.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [4 July 2026 11:44 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/16 "2026-07-04T11:44:14Z")

</div>

It applies to the switch, delay, sort, batch and split nodes - ie the core ones that can potentially buffer up a load of messages. When exceeded it throws a "too many messages" error and drops any stored messages.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [18 July 2026 11:44 UTC](https://discourse.nodered.org/t/help-with-delay-node-set-to-rate-limit/101400/17 "2026-07-18T11:44:33Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
