# Move from exec node to daemon node has caused an unusual problem

**URL:** <https://discourse.nodered.org/t/move-from-exec-node-to-daemon-node-has-caused-an-unusual-problem/28566>\
**Category:** General\
**Created:** [18 June 2020 19:04 UTC](https://discourse.nodered.org/t/move-from-exec-node-to-daemon-node-has-caused-an-unusual-problem/28566 "2020-06-18T19:04:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dclear](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dclear/32/9107_2.png) [@dclear](https://discourse.nodered.org/u/dclear)\
**Post date:** [18 June 2020 19:04 UTC](https://discourse.nodered.org/t/move-from-exec-node-to-daemon-node-has-caused-an-unusual-problem/28566/1 "2020-06-18T19:04:24Z")

</div>

So I've moved from the `exec` node to the `daemon` node for increased reliability of my PHP script which the `daemon` node is certainly providing. Only problem is for some reason, running the PHP script from the `daemon` node is resulting in some merged/blended messages which wasn't happening with the `exec` node. And like all good problems this one's intermittent.

I've attached a screenshot to show what is happening. See that 19:59 final message? That one is a blended message and plays havoc with my system. All the others are nicely split. Any way to deal with this situation. I don't want to miss messages so splitting them up when this happens is probably preferable before feeding them into the switch node? I'm guessing it happens when the messages come very close together in time.

I'd like to be able to use the split node and split on the carriage return but I don't think I can. I attempted to use a `function` node and

`var values = msg.payload.trim().split('\t');` but the messages are still sometimes blended.

Thank you!

 ![Screenshot 2020-06-18 at 20.00.35](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/3/c35ca9ec12f5f367c2df8f45231253f2f0d5c7a6.png)

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [18 June 2020 19:32 UTC](https://discourse.nodered.org/t/move-from-exec-node-to-daemon-node-has-caused-an-unusual-problem/28566/2 "2020-06-18T19:32:54Z")

</div>

you should be able split on a carriage return in a function node with something like this:

```auto
if (msg.payload.match(/\r/g)) {
    const msgArr = msg.payload.trim().split('\r');
    msgArr.forEach(item => node.send({payload:item}));
    return;
} else {
    return msg;
}

```

Not tested so  
Johannes

Edit just tested and should work

---

<div class="post-metadata">

**Author:** ![dclear](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dclear/32/9107_2.png) [@dclear](https://discourse.nodered.org/u/dclear)\
**Post date:** [18 June 2020 19:37 UTC](https://discourse.nodered.org/t/move-from-exec-node-to-daemon-node-has-caused-an-unusual-problem/28566/3 "2020-06-18T19:37:45Z")

</div>

Seems to work brilliantly! Thank you!

---

<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:** [2 July 2020 19:37 UTC](https://discourse.nodered.org/t/move-from-exec-node-to-daemon-node-has-caused-an-unusual-problem/28566/4 "2020-07-02T19:37:47Z")

</div>

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