I'm trying to manage an alarm system using Node-RED.
Giving a function node that sends out multiple messages using node.send() method or giving a split node, I need to check if each value exists in a PostgreSQL database (SELECT statement), so after the postgres node I wish to get the input msg.payload in order to perform some actions using the payload values.
[function node] -> [postgres node] -> [switch node] -> [...]
How can I get the msg.payload generated in the output of the funciton node in the switch node?
I tried using a change node after the function node setting the payload as flow var, but it does not work. In the switch node I always see the last message sent out from the function node.