# Just First message delay only

**URL:** <https://discourse.nodered.org/t/just-first-message-delay-only/51677>\
**Category:** General\
**Created:** [29 September 2021 18:44 UTC](https://discourse.nodered.org/t/just-first-message-delay-only/51677 "2021-09-29T18:44:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [29 September 2021 18:44 UTC](https://discourse.nodered.org/t/just-first-message-delay-only/51677/1 "2021-09-29T18:44:41Z")

</div>

Hi,  
I just want to delay the first message for a certain amount of time. How can I do it?

Subsequent messages should arrive without delay.

Thanks for your help.

---

<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:** [29 September 2021 19:15 UTC](https://discourse.nodered.org/t/just-first-message-delay-only/51677/2 "2021-09-29T19:15:02Z")

</div>

So, in theory, the second message could arrive before the first (delayed) one is released?

---

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [29 September 2021 19:18 UTC](https://discourse.nodered.org/t/just-first-message-delay-only/51677/3 "2021-09-29T19:18:00Z")

</div>

First of all, my answer is no.

If you need to go step by step.

my delay=100 seconds

No messages will be delivered within 100 seconds.

New messages received after 100 seconds will be forwarded.

---

<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:** [29 September 2021 19:25 UTC](https://discourse.nodered.org/t/just-first-message-delay-only/51677/4 "2021-09-29T19:25:26Z")

</div>

Right, so you want all messages delayed by 100 seconds. So if the first message is sent at time 0 and the second is sent at time 10 seconds, then the first will arrive at time 100 seconds and the second will arrive at time 110 (so it also has been delayed from time 10 to time 110, 100 seconds delay).  
A delay node will do exactly that. Try it.

---

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [29 September 2021 19:31 UTC](https://discourse.nodered.org/t/just-first-message-delay-only/51677/5 "2021-09-29T19:31:00Z")

</div>

Please let me put it this way.

I will send a message and the counter will start. (100 seconds). No incoming messages within 100 seconds will be forwarded.

However, when the counter is reset, new messages will be forwarded instantly. without delay.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [29 September 2021 20:12 UTC](https://discourse.nodered.org/t/just-first-message-delay-only/51677/6 "2021-09-29T20:12:24Z")

</div>

try something like this

```auto
[{"id":"ae4ef9b4.4bd328","type":"debug","z":"b779de97.b1b46","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":870,"y":4260,"wires":[]},{"id":"e6b2b1f0.ada2b8","type":"change","z":"b779de97.b1b46","name":"","rules":[{"t":"set","p":"stop_delay","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":4220,"wires":[["ae4ef9b4.4bd328"]]},{"id":"998e2ee1.065bc8","type":"switch","z":"b779de97.b1b46","name":"","property":"stop_delay","propertyType":"flow","rules":[{"t":"false"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":240,"y":4220,"wires":[["493b5acc.71c19c"],["ae4ef9b4.4bd328"]]},{"id":"493b5acc.71c19c","type":"trigger","z":"b779de97.b1b46","name":"","op1":"","op2":"","op1type":"nul","op2type":"pay","duration":"100","extend":false,"overrideDelay":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":400,"y":4200,"wires":[["e6b2b1f0.ada2b8"]]},{"id":"b6aca93.d3504d8","type":"inject","z":"b779de97.b1b46","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":70,"y":4220,"wires":[["998e2ee1.065bc8"]]}]

```

---

<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 November 2021 20:13 UTC](https://discourse.nodered.org/t/just-first-message-delay-only/51677/7 "2021-11-28T20:13:03Z")

</div>

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