# Split node with delay of each message

**URL:** https://discourse.nodered.org/t/split-node-with-delay-of-each-message/49680
**Category:** General
**Tags:** split, delay
**Created:** [13 August 2021 10:25 UTC](https://discourse.nodered.org/t/split-node-with-delay-of-each-message/49680 "2021-08-13T10:25:11Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![khfischbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/khfischbach/32/16627_2.png) [@khfischbach](https://discourse.nodered.org/u/khfischbach)
#### Post date: [13 August 2021 10:25 UTC](https://discourse.nodered.org/t/split-node-with-delay-of-each-message/49680/1 "2021-08-13T10:25:11Z")

</div>

Hi,  
I have used split node successfully to split a message into several messages.

Is there a way to delay each single message e.g. by 5 seconds. A delay node does not do the trick.

Help appreciated!

Regards  
Kallewirsch

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [13 August 2021 10:41 UTC](https://discourse.nodered.org/t/split-node-with-delay-of-each-message/49680/2 "2021-08-13T10:41:33Z")

</div>

How have you configured the Delay node ?  
Have you tried setting it to

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f12ad3ef9f295e17c23ea570763f0f6705104ba4.png)

Indeed it is unclear from the Help tab of the node why when set to " **Delay each message**" it sends all the messages at once. Possibly because they have the same Topic ?

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [13 August 2021 10:48 UTC](https://discourse.nodered.org/t/split-node-with-delay-of-each-message/49680/3 "2021-08-13T10:48:38Z")

</div>

> [@UnborN](#):
>
> Indeed it is unclear from the Help tab of the node why when set to " **Delay each message**" it sends all the messages at once. Possibly because they have the same Topic ?

The 'delay' message option applies to each message individually. The delay is applied from the moment the message arrives at the node.

If 10 messages arrive at the node at time X, they will each get delayed for N seconds then all get released at time X+N.

If you want to add a delay _between_ each message, then you are changing the rate they pass through the node- hence the 'rate limit' mode is needed here.

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [13 August 2021 15:28 UTC](https://discourse.nodered.org/t/split-node-with-delay-of-each-message/49680/4 "2021-08-13T15:28:38Z")

</div>

@knolleary thanks for the detailed explanation .. ofcourse, it makes sense

since we are on the subject of Delay .. what happens if, lets says, we inject a msg to the Delay node every 1 second and the Delay is set to "Rate limit" the msgs for 5 seconds ? what happens to the queue of msgs after a long time ?

---

<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: [13 August 2021 15:40 UTC](https://discourse.nodered.org/t/split-node-with-delay-of-each-message/49680/5 "2021-08-13T15:40:55Z")

</div>

Eventually you would run out of memory.

---

<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: [13 August 2021 19:59 UTC](https://discourse.nodered.org/t/split-node-with-delay-of-each-message/49680/6 "2021-08-13T19:59:19Z")

</div>

You can set a limit, which when hit will create an error and flush out the queue

---

<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: [13 August 2021 20:10 UTC](https://discourse.nodered.org/t/split-node-with-delay-of-each-message/49680/7 "2021-08-13T20:10:32Z")

</div>

I don't see that documented in the help text. Or do you mean to use a Status node to pick up the queue size and use that to trigger the flush?

---

<div class="post-metadata">

### Author: ![khfischbach](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/khfischbach/32/16627_2.png) [@khfischbach](https://discourse.nodered.org/u/khfischbach)
#### Post date: [14 August 2021 06:42 UTC](https://discourse.nodered.org/t/split-node-with-delay-of-each-message/49680/8 "2021-08-14T06:42:28Z")

</div>

Hi UnborN,  
this setting works for me!!!

Thanks for your hint!

Regards  
Karl-Heinz

---

<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: [28 August 2021 06:43 UTC](https://discourse.nodered.org/t/split-node-with-delay-of-each-message/49680/9 "2021-08-28T06:43:00Z")

</div>

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