Check several msg.payload inputs in one function node?

is it possible to check/combine more than one inputs (all of them msg.payload) in one funktion node ?

msg.payload = input1.msg.payload + input2.msg.payload + input3.msg.payload


Not directly. Each message arrives as a separate call to the function node.

One approach is to use the Join node to combine the separate messages into one, which you can then pass to the Function node.

Another would be to store each message in the Functions local context and only do the processing once you know you're received all of them.

There is an example of using the Join node for this in the node red cookbook.

1 Like