Hi @lourdes98 and welcome to Node-RED community, as @craigcurtin said, you can use variables to store your values, I share you a flow with a little example:
[{"id":"54e35e363e1805cc","type":"tab","label":"Flow 9","disabled":false,"info":"","env":[]},{"id":"1f83928af45a3962","type":"group","z":"54e35e363e1805cc","name":"Simulation same node (different/equal payload)","style":{"label":true},"nodes":["9a5efdaae27e09b9","ed7d0f6563825d7d"],"x":54,"y":259,"w":301,"h":122},{"id":"9a5efdaae27e09b9","type":"inject","z":"54e35e363e1805cc","g":"1f83928af45a3962","name":"payload = 1","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":170,"y":300,"wires":[["ca5884a7a3cdb668"]]},{"id":"ca5884a7a3cdb668","type":"switch","z":"54e35e363e1805cc","name":"","property":"flag","propertyType":"flow","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":320,"wires":[["b170d284034311a3"],["73b4643553a5727e"]]},{"id":"a7ae19ed29879601","type":"function","z":"54e35e363e1805cc","name":"Set flow.flag","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\nflow.set(\"flag\", true);","finalize":"","libs":[],"x":190,"y":200,"wires":[[]]},{"id":"b170d284034311a3","type":"change","z":"54e35e363e1805cc","name":"set val1 (Payload 1)","rules":[{"t":"set","p":"var1","pt":"flow","to":"payload","tot":"msg"},{"t":"set","p":"flag","pt":"flow","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":300,"wires":[[]]},{"id":"73b4643553a5727e","type":"change","z":"54e35e363e1805cc","name":"set val2 (Payload 2)","rules":[{"t":"set","p":"var2","pt":"flow","to":"payload","tot":"msg"},{"t":"set","p":"flag","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":340,"wires":[["cb8110b5f8154455"]]},{"id":"cb8110b5f8154455","type":"switch","z":"54e35e363e1805cc","name":"Comparation","property":"var1","propertyType":"flow","rules":[{"t":"eq","v":"var2","vt":"flow"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":830,"y":340,"wires":[["ad025ba930cef847"],["c96a04c9dda328e4"]]},{"id":"ed7d0f6563825d7d","type":"inject","z":"54e35e363e1805cc","g":"1f83928af45a3962","name":"Payload = 2 or 1","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":180,"y":340,"wires":[["ca5884a7a3cdb668"]]},{"id":"8fd99dfe4918836a","type":"debug","z":"54e35e363e1805cc","name":"debug 13","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1140,"y":340,"wires":[]},{"id":"ad025ba930cef847","type":"change","z":"54e35e363e1805cc","name":"message 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"First and second payload are equal...","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":320,"wires":[["8fd99dfe4918836a"]]},{"id":"c96a04c9dda328e4","type":"change","z":"54e35e363e1805cc","name":"message 2","rules":[{"t":"set","p":"payload","pt":"msg","to":"First and second payload are different...","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":360,"wires":[["8fd99dfe4918836a"]]}]
In this example I compare two payloads, simulating that comes from the same node. I did this example with numbers, but can work with other kinds...
I hope it helps you!!