For future reference, I think the join
node can be configured to do what you want. Here, it is set to wait for 3 messages, rather than 10, to simplify testing.
[{"id":"efcf54024f5b1558","type":"inject","z":"c3b4e23e95193f6b","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":110,"y":360,"wires":[["898355a08940da70"]]},{"id":"898355a08940da70","type":"join","z":"c3b4e23e95193f6b","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":430,"y":400,"wires":[["4c8f73321c998977"]]},{"id":"b42c3dc9636fa253","type":"inject","z":"c3b4e23e95193f6b","name":"complete ","props":[{"p":"complete","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":120,"y":440,"wires":[["898355a08940da70"]]},{"id":"2b9b9c11733cec31","type":"change","z":"c3b4e23e95193f6b","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":400,"wires":[["898355a08940da70"]]},{"id":"4c8f73321c998977","type":"change","z":"c3b4e23e95193f6b","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":400,"wires":[["c6ae5dd7cfd03d2e"]]},{"id":"886e094a462d70ef","type":"inject","z":"c3b4e23e95193f6b","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":110,"y":400,"wires":[["2b9b9c11733cec31"]]},{"id":"c6ae5dd7cfd03d2e","type":"debug","z":"c3b4e23e95193f6b","name":"output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":400,"wires":[]}]
The two change
nodes do housekeeping that could be done in other ways, but the join
node is key. The inject
node with msg.complete
has also been added for testing purposes.