# Exec node send an output payload on more than one message

**URL:** <https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590>\
**Category:** General\
**Tags:** exec\
**Created:** [2 February 2023 08:09 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590 "2023-02-02T08:09:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [2 February 2023 08:09 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/1 "2023-02-02T08:09:04Z")

</div>

Hi,following this suggestion I'm using the template node to create aand save a python script, than the exec node to run it  
[https://flows.nodered.org/flow/0a6e073bcd6bda364fafd32699837cc7](https://flows.nodered.org/flow/0a6e073bcd6bda364fafd32699837cc7)  
this is my exec node

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/0/c02ce338aa2563851ad3c52b1d3e2759f606a775.png)  
My python script has just one print command (in a while loop). Now the problem is that the message payload (which is the print command in python) is sent on multiple consecutive messages on the output 1 of the exec node. How can I deal with it and have just one output messages for each print command?  
Thanks

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [2 February 2023 09:26 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/2 "2023-02-02T09:26:24Z")

</div>

It will be hard to help you with just the information you have provided. There could be a bug in your python code or an issue with your flow. Please export your flow and attach it to a reply.

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<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:** [2 February 2023 09:32 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/3 "2023-02-02T09:32:12Z")

</div>

Your combination of spawn mode and the -u flag _should_ give you one message per print statement.

What operating system are you using?  
What version of python?  
What version of Node-red?

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [2 February 2023 15:08 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/4 "2023-02-02T15:08:29Z")

</div>

Here the flow example

```auto
[{"id":"b52450baec0df3d5","type":"inject","z":"0700cf57765c88b3","name":"","props":[{"p":"filename","v":"/home/pi/testing.py","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":155.1999969482422,"y":2338.39990234375,"wires":[["5bf43326848a329d"]]},{"id":"5bf43326848a329d","type":"template","z":"0700cf57765c88b3","name":"Progress","field":"payload","fieldType":"msg","format":"python","syntax":"plain","template":"#!/usr/bin/env python2.7\nimport time\nwhile True:\n a=[402.17, 10.16, 17.2, 3482.43, 138.55, 27.76, 27.64, 0.29, 27.76, 3.52, 3.51, 3.68, 2.7, 4.15, 0.0, 8.98, 349.0, 592, 73, 189.77, 642.05, 8895.82, 7.19, 0, 0, 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 0.0, 0.0, 0, 2.83, 0, 0, 402.17, 10.16, 17.2, 402.17, 10.16, 0.34, 'null', 0.0, 0.0, 0.34, 0.0, 0.0, 0.0, 85.8, -4.2, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0, 67, 0, 0.0, 3.48, 0, 3.48, 56.8, 'null', 0.0, 0, 0, 41, 0, 0.0, 0.0, 0.0, 0.0, 5.75, 0.0, 85.51, 0.0, 0.0, 41, 0, 793, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0, 711, 3, -5, 3.48, 'null', 'null', 'null', 'null', 27.59, 27.59, 0.0, 0.0, 0, 0, 27.77, 27.75, 27.62, 0.0, 16.3, 16.3, 16.8, 16.8, 14.9, 7.9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 555.37, 1406.65, 26.61, 26.61, 0.0, 'null', 'null', 'null', 'null', 0.0, 555.37, 0.0, 0.0, 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 0.0, 0.0, 7.9, 0.0, 0.0, 0.0, 8.66, 3482.43, 26.61, 325.98, 10.18, 27.56, 27.53, 27.76, 27.64, 396.96, 0.0, 0.0, 454.56, 'null', 0, 0, 0, 0, 0, 0, 'null', 0, 0, 0, 0, 0, 0, 'null', 0.0, 0.0, 3, -5, 711, 3, -5, 711, 0.0, 555.35, 3276, 0, 0, 0, 675.0]\n print (a)\n time.sleep(5)\n","output":"str","x":315.1999969482422,"y":2338.39990234375,"wires":[["e9a947dd9527f56c"]]},{"id":"e9a947dd9527f56c","type":"file","z":"0700cf57765c88b3","name":"","filename":"filename","filenameType":"msg","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":475.1999969482422,"y":2338.39990234375,"wires":[["615935d164ef5ad7"]]},{"id":"fb34d0c2bb89fcef","type":"debug","z":"0700cf57765c88b3","name":"msg1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":850,"y":2320,"wires":[]},{"id":"e14263190fa389b6","type":"debug","z":"0700cf57765c88b3","name":"msg2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":850,"y":2360,"wires":[]},{"id":"659f0ca4e541a56f","type":"debug","z":"0700cf57765c88b3","name":"msg3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":850,"y":2400,"wires":[]},{"id":"615935d164ef5ad7","type":"exec","z":"0700cf57765c88b3","command":"python -u","addpay":"filename","append":"","useSpawn":"true","timer":"","winHide":false,"oldrc":false,"name":"","x":630,"y":2340,"wires":[["fb34d0c2bb89fcef"],["e14263190fa389b6"],["659f0ca4e541a56f"]]},{"id":"ac2eaf636142aa5b","type":"inject","z":"0700cf57765c88b3","name":"Stop","props":[{"p":"kill","v":"SIGTERM","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":490,"y":2380,"wires":[["615935d164ef5ad7"]]}]

```

I have the same problem on a raspberry with raspbian and on Windows 11 as well. Node-red V3.0.2

---

<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:** [2 February 2023 17:04 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/5 "2023-02-02T17:04:07Z")

</div>

Can you show us the python and what you see in a debug node on the exec node please.

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [2 February 2023 17:51 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/6 "2023-02-02T17:51:56Z")

</div>

Aall the code you can test is in the code shared above. The python code is in the template node

---

<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:** [2 February 2023 18:13 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/7 "2023-02-02T18:13:14Z")

</div>

I am on my phone so can't see the flow.  
Show us what you see in a debug node.

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [2 February 2023 19:07 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/8 "2023-02-02T19:07:38Z")

</div>

The print code, that becames the message payload, is split into several messages, till even 5-6 messages, because the split point, so the payload message, has every time a different length, even if the print code is always the same.  
Here the python code

```auto
#!/usr/bin/env python2.7
import time
while True:
    a=[402.17, 10.16, 17.2, 3482.43, 138.55, 27.76, 27.64, 0.29, 27.76, 3.52, 3.51, 3.68, 2.7, 4.15, 0.0, 8.98, 349.0, 592, 73, 189.77, 642.05, 8895.82, 7.19, 0, 0, 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 0.0, 0.0, 0, 2.83, 0, 0, 402.17, 10.16, 17.2, 402.17, 10.16, 0.34, 'null', 0.0, 0.0, 0.34, 0.0, 0.0, 0.0, 85.8, -4.2, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0, 67, 0, 0.0, 3.48, 0, 3.48, 56.8, 'null', 0.0, 0, 0, 41, 0, 0.0, 0.0, 0.0, 0.0, 5.75, 0.0, 85.51, 0.0, 0.0, 41, 0, 793, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0, 711, 3, -5, 3.48, 'null', 'null', 'null', 'null', 27.59, 27.59, 0.0, 0.0, 0, 0, 27.77, 27.75, 27.62, 0.0, 16.3, 16.3, 16.8, 16.8, 14.9, 7.9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 555.37, 1406.65, 26.61, 26.61, 0.0, 'null', 'null', 'null', 'null', 0.0, 555.37, 0.0, 0.0, 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 0.0, 0.0, 7.9, 0.0, 0.0, 0.0, 8.66, 3482.43, 26.61, 325.98, 10.18, 27.56, 27.53, 27.76, 27.64, 396.96, 0.0, 0.0, 454.56, 'null', 0, 0, 0, 0, 0, 0, 'null', 0, 0, 0, 0, 0, 0, 'null', 0.0, 0.0, 3, -5, 711, 3, -5, 711, 0.0, 555.35, 3276, 0, 0, 0, 675.0]
    print (a)
    time.sleep(5)

```

Here you can see the debug nodes. This time the print code has been split into 4 separate messages, but its number varies, till 7 messages.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/d/9d7c8de95916fd7ed7df0dadf5fa6d4b04e4ad84.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/d/edee9db7e36d6becb013ef4e41bfebb60c5c5951.png)

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [2 February 2023 19:40 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/9 "2023-02-02T19:40:41Z")

</div>

I have even noticed that the more times I use it, the more messages I gett for each print command. At the beginning they where just 3 messages, now they are more than 20

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [2 February 2023 20:06 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/10 "2023-02-02T20:06:00Z")

</div>

Is there any particular reason why you do this in python and not directly within node-red ?

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [2 February 2023 20:12 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/11 "2023-02-02T20:12:10Z")

</div>

Unfortunatly yes, I have to use python lenguage ☹  
I simply reproduced the final result that I can later on handle in node-red without problem, but I cannot avoid to use python

---

<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:** [2 February 2023 20:19 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/12 "2023-02-02T20:19:21Z")

</div>

You could add a newline character on the end of each print, then put the buffers back together in node red.

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [2 February 2023 20:24 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/13 "2023-02-02T20:24:35Z")

</div>

Yes, at the end this is what I'm doing but it shouldn't work like this, should it. Even because, as I wrote, I don't know why but the number of messages returned is incresing considerably

---

<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:** [2 February 2023 20:29 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/14 "2023-02-02T20:29:13Z")

</div>

Has anyone else got any issues running the test flow, the OP's test flow runs fine on my debian and android node-red. 3.0.2, nodejs 14, no Docker

---

<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:** [2 February 2023 20:52 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/15 "2023-02-02T20:52:24Z")

</div>

It runs fine as it is on Ubuntu, but on the pi it does produce random buffer sizes for some reason. It must be something to do with python on the pi, or the buffering in the OS. @Lupin_III try this in your template

```auto
#!/usr/bin/env python2.7
import time
import sys
while True:
    a=[402.17, 10.16, 17.2, 3482.43, 138.55, 27.76, 27.64, 0.29, 27.76, 3.52, 3.51, 3.68, 2.7, 4.15, 0.0, 8.98, 349.0, 592, 73, 189.77, 642.05, 8895.82, 7.19, 0, 0, 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 0.0, 0.0, 0, 2.83, 0, 0, 402.17, 10.16, 17.2, 402.17, 10.16, 0.34, 'null', 0.0, 0.0, 0.34, 0.0, 0.0, 0.0, 85.8, -4.2, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0, 67, 0, 0.0, 3.48, 0, 3.48, 56.8, 'null', 0.0, 0, 0, 41, 0, 0.0, 0.0, 0.0, 0.0, 5.75, 0.0, 85.51, 0.0, 0.0, 41, 0, 793, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0, 711, 3, -5, 3.48, 'null', 'null', 'null', 'null', 27.59, 27.59, 0.0, 0.0, 0, 0, 27.77, 27.75, 27.62, 0.0, 16.3, 16.3, 16.8, 16.8, 14.9, 7.9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 555.37, 1406.65, 26.61, 26.61, 0.0, 'null', 'null', 'null', 'null', 0.0, 555.37, 0.0, 0.0, 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 0.0, 0.0, 7.9, 0.0, 0.0, 0.0, 8.66, 3482.43, 26.61, 325.98, 10.18, 27.56, 27.53, 27.76, 27.64, 396.96, 0.0, 0.0, 454.56, 'null', 0, 0, 0, 0, 0, 0, 'null', 0, 0, 0, 0, 0, 0, 'null', 0.0, 0.0, 3, -5, 711, 3, -5, 711, 0.0, 555.35, 3276, 0, 0, 0, 675.0]
    print (a)
    sys.stdout.flush()
    time.sleep(5)

```

I have added `import sys` at the front, and a buffer flush after the print. Also, In the exec node, remove the -u.

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [2 February 2023 20:55 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/16 "2023-02-02T20:55:45Z")

</div>

No, nothing. It's the same. Not only on the pi, even on Windows

---

<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:** [2 February 2023 21:00 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/17 "2023-02-02T21:00:05Z")

</div>

Did you remember to remove the -u in the exec node?  
If you did, can you post your new non-working flow please?

---

<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:** [2 February 2023 23:18 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/18 "2023-02-02T23:18:21Z")

</div>

Python2.7 ??? Really ?

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [3 February 2023 01:50 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/19 "2023-02-03T01:50:04Z")

</div>

THis is with the exec node without -u

```auto
[{"id":"8e82ee5ca7530af0","type":"tab","label":"Flow 4","disabled":false,"info":"","env":[]},{"id":"f24ff63822df1036","type":"inject","z":"8e82ee5ca7530af0","name":"","props":[{"p":"filename","v":"/home/pi/testing.py","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":150,"y":140,"wires":[["d09fec707e868aef"]]},{"id":"d09fec707e868aef","type":"template","z":"8e82ee5ca7530af0","name":"Progress","field":"payload","fieldType":"msg","format":"python","syntax":"plain","template":"#!/usr/bin/env python2.7\nimport time\nwhile True:\n a=[402.17, 10.16, 17.2, 3482.43, 138.55, 27.76, 27.64, 0.29, 27.76, 3.52, 3.51, 3.68, 2.7, 4.15, 0.0, 8.98, 349.0, 592, 73, 189.77, 642.05, 8895.82, 7.19, 0, 0, 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 0.0, 0.0, 0, 2.83, 0, 0, 402.17, 10.16, 17.2, 402.17, 10.16, 0.34, 'null', 0.0, 0.0, 0.34, 0.0, 0.0, 0.0, 85.8, -4.2, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0, 0, 0, 67, 0, 0.0, 3.48, 0, 3.48, 56.8, 'null', 0.0, 0, 0, 41, 0, 0.0, 0.0, 0.0, 0.0, 5.75, 0.0, 85.51, 0.0, 0.0, 41, 0, 793, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0, 711, 3, -5, 3.48, 'null', 'null', 'null', 'null', 27.59, 27.59, 0.0, 0.0, 0, 0, 27.77, 27.75, 27.62, 0.0, 16.3, 16.3, 16.8, 16.8, 14.9, 7.9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 555.37, 1406.65, 26.61, 26.61, 0.0, 'null', 'null', 'null', 'null', 0.0, 555.37, 0.0, 0.0, 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 'null', 0.0, 0.0, 7.9, 0.0, 0.0, 0.0, 8.66, 3482.43, 26.61, 325.98, 10.18, 27.56, 27.53, 27.76, 27.64, 396.96, 0.0, 0.0, 454.56, 'null', 0, 0, 0, 0, 0, 0, 'null', 0, 0, 0, 0, 0, 0, 'null', 0.0, 0.0, 3, -5, 711, 3, -5, 711, 0.0, 555.35, 3276, 0, 0, 0, 675.0]\n print (a)\n time.sleep(5)\n","output":"str","x":310,"y":140,"wires":[["cca84906dfbc8f07"]]},{"id":"cca84906dfbc8f07","type":"file","z":"8e82ee5ca7530af0","name":"","filename":"filename","filenameType":"msg","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":470,"y":140,"wires":[["29959d933f062396"]]},{"id":"b564fa4a9c52c23f","type":"debug","z":"8e82ee5ca7530af0","name":"msg1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":844.8000030517578,"y":121.60009765625,"wires":[]},{"id":"c68ddaf00c486ef6","type":"debug","z":"8e82ee5ca7530af0","name":"msg2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":844.8000030517578,"y":161.60009765625,"wires":[]},{"id":"7a269500967ee829","type":"debug","z":"8e82ee5ca7530af0","name":"msg3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":844.8000030517578,"y":201.60009765625,"wires":[]},{"id":"29959d933f062396","type":"exec","z":"8e82ee5ca7530af0","command":"python","addpay":"filename","append":"","useSpawn":"true","timer":"","winHide":false,"oldrc":false,"name":"","x":614.8000030517578,"y":141.60009765625,"wires":[["b564fa4a9c52c23f"],["c68ddaf00c486ef6"],["7a269500967ee829"]]},{"id":"1cc06124eff8be96","type":"inject","z":"8e82ee5ca7530af0","name":"Stop","props":[{"p":"kill","v":"SIGTERM","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":484.8000030517578,"y":181.60009765625,"wires":[["29959d933f062396"]]}]

```

This time I get a single message per print command, but it is not complete. It is truncated at the end, and each message is truncated in a different way  
And yes, unfortunatly it's a python 2

---

<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 February 2023 07:16 UTC](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590/20 "2023-02-03T07:16:46Z")

</div>

> [@Lupin\_III](#):
>
> it is not complete

I suspect it is just that the debug node output is truncated in order to limit the load on the browser. Click the box in the node to send it to the console and check in the node red log, I think you will find it is all there.

On the python version, I think that the fact that you call it with the python command means that the `#!` line is ignored.

[Next page](https://discourse.nodered.org/t/exec-node-send-an-output-payload-on-more-than-one-message/74590.md?page=2)
