Does node red have the concept of an execution or instance of a flow. I have some previous experience with workflow orchestration tools like airflow where you can start multiple executions of a workflow simultaneously and all of the intermediate steps are separate.
To illustrate what I'm talking about...
I created the following test flow where a timestamp is injected, duplicated and one of the copies is delayed (to simulate a slow process). After this the messages are combined again and printed out. What I would like to happen is that the final result be an array where the same timestamp is found twice like this: [1643962351491,1643962351491]
. However due to the slow path in the flow what ends up happening is the values are different [1643962360975,1643962361407]
as two subsequent values from the fast path get combined in the join step.
Is there a solution in node red such that separate executions or initial inputs create distinct flows?
[{"id":"f6f2187d.f17ca8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"d75fb16cf5282db7","type":"inject","z":"f6f2187d.f17ca8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":240,"wires":[["24aa14b5db6a8c4d"]]},{"id":"137bdaf1c11ca9fc","type":"delay","z":"f6f2187d.f17ca8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":420,"y":300,"wires":[["b50907d20858610a"]]},{"id":"b50907d20858610a","type":"join","z":"f6f2187d.f17ca8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":570,"y":240,"wires":[["02863d76260a4b79"]]},{"id":"02863d76260a4b79","type":"debug","z":"f6f2187d.f17ca8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":730,"y":240,"wires":[]},{"id":"24aa14b5db6a8c4d","type":"function","z":"f6f2187d.f17ca8","name":"duplicate","func":"\nreturn [msg, msg];","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":260,"y":240,"wires":[["b50907d20858610a"],["137bdaf1c11ca9fc"]]}]