# Two msg in delay with function node

**URL:** <https://discourse.nodered.org/t/two-msg-in-delay-with-function-node/30435>\
**Category:** General\
**Created:** [21 July 2020 02:28 UTC](https://discourse.nodered.org/t/two-msg-in-delay-with-function-node/30435 "2020-07-21T02:28:21Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Bobo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobo/32/8401_2.png) [@Bobo](https://discourse.nodered.org/u/Bobo)\
**Post date:** [21 July 2020 05:02 UTC](https://discourse.nodered.org/t/two-msg-in-delay-with-function-node/30435/3 "2020-07-21T05:02:13Z")

</div>

Aside from the delay issue (for which you should use something like the Delay node), your example won't work in a Function node because the first payload gets overwritten. I suggest you read up on using Functions ... [https://nodered.org/docs/user-guide/writing-functions](https://nodered.org/docs/user-guide/writing-functions).

An uncomplicated flow would be: Inject -\>Function -\>Delay -\>Function -\> Delay -\> Debug

Alternatively,have a read of [Can I have a delay / sleep inside Function node](https://discourse.nodered.org/t/can-i-have-a-delay-sleep-inside-function-node/3101)

---

_[View the full topic](https://discourse.nodered.org/t/two-msg-in-delay-with-function-node/30435)._
