Flow Sequence Operation?

I have a Node Red program with 3 flows, how will this be excuted?
Will flow 2 not start until flow 1 is done or will flow 2 and flow 3 start at same time flow 1 starts?

All flows start (or more accurately, the nodes are instantiated) as soon as they are deployed. However, the logic the nodes perform will depend on the flow of messages from one node to the next.

The best way to understand what is going on is to litter your flows with debug nodes at various points.

If you have a specific question, please post more details and a sample flow.

How would I use a "Complete" node to trigger the start of another Flow?

Example when Flow 1 debug node completes I want it to trigger the start of Flow 2?

Or would there be a better way to get this sequence done?

Simple 3 flow complete example

[{"id":"bf3716de3c14b081","type":"inject","z":"65617ffeb779f51c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":1220,"wires":[["694bd0bbcd02448c"]]},{"id":"694bd0bbcd02448c","type":"delay","z":"65617ffeb779f51c","name":"","pauseType":"random","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":320,"y":1220,"wires":[["356dba7230eb2312"]]},{"id":"356dba7230eb2312","type":"change","z":"65617ffeb779f51c","name":"","rules":[{"t":"set","p":"whatever","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":1220,"wires":[["4b3380e9ae01a232"]]},{"id":"4b3380e9ae01a232","type":"debug","z":"65617ffeb779f51c","name":"debug 254","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":670,"y":1220,"wires":[]},{"id":"13a757730c667abc","type":"complete","z":"65617ffeb779f51c","name":"","scope":["356dba7230eb2312"],"uncaught":false,"x":190,"y":1320,"wires":[["3fcb12b5857de47f"]]},{"id":"3fcb12b5857de47f","type":"delay","z":"65617ffeb779f51c","name":"","pauseType":"random","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":360,"y":1320,"wires":[["8c63c41ae5d0337c"]]},{"id":"8c63c41ae5d0337c","type":"change","z":"65617ffeb779f51c","name":"","rules":[{"t":"set","p":"whatever2","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":1320,"wires":[["3846024eec7adb02"]]},{"id":"3846024eec7adb02","type":"debug","z":"65617ffeb779f51c","name":"debug 255","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":1320,"wires":[]},{"id":"f23ec15cc29c2f27","type":"complete","z":"65617ffeb779f51c","name":"","scope":["8c63c41ae5d0337c"],"uncaught":false,"x":190,"y":1400,"wires":[["f57bce3e44c00ead"]]},{"id":"f57bce3e44c00ead","type":"delay","z":"65617ffeb779f51c","name":"","pauseType":"random","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":360,"y":1400,"wires":[["194190e90dd1d02e"]]},{"id":"194190e90dd1d02e","type":"change","z":"65617ffeb779f51c","name":"","rules":[{"t":"set","p":"whatever3","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":1400,"wires":[["dc4b6ac63e6314f2"]]},{"id":"dc4b6ac63e6314f2","type":"debug","z":"65617ffeb779f51c","name":"debug 256","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":1400,"wires":[]}]

You could simply connect the last node from flow 1 to start flow 2 (link nodes are ideal here)

The complete node is not 100% supported by all nodes and may not fire upon completion of a long running task (depends on how the node author implemented it)

Maybe I'm not making myself very clear.

I have 3 "TABS" labeled Flow 1 and Flow 2 and Flow 3.

I don't want Flow 2 to start until Flow 1 is complete.

I don't think I can use "Complete" as it only works for the LOCAL FLOW,

But I do have a "LINK OUT" and "LINK IN" setup as the more I read I am thinking this is what I actually need?

use link nodes

[{"id":"13a757730c667abc","type":"complete","z":"65617ffeb779f51c","name":"","scope":["356dba7230eb2312"],"uncaught":false,"x":170,"y":1300,"wires":[["6ca683e98fbdbc47"]]},{"id":"6ca683e98fbdbc47","type":"link out","z":"65617ffeb779f51c","name":"link out 1","mode":"link","links":["f04cf33ad7f1b643"],"x":345,"y":1300,"wires":[]}]
[{"id":"f04cf33ad7f1b643","type":"link in","z":"9fd2ab54a016a59e","name":"link in 1","links":["6ca683e98fbdbc47"],"x":285,"y":120,"wires":[["3fcb12b5857de47f"]]},{"id":"3fcb12b5857de47f","type":"delay","z":"9fd2ab54a016a59e","name":"","pauseType":"random","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":460,"y":120,"wires":[["8c63c41ae5d0337c"]]},{"id":"8c63c41ae5d0337c","type":"change","z":"9fd2ab54a016a59e","name":"","rules":[{"t":"set","p":"whatever2","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":120,"wires":[["3846024eec7adb02"]]},{"id":"3846024eec7adb02","type":"debug","z":"9fd2ab54a016a59e","name":"debug 255","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":830,"y":120,"wires":[]}]

I think the misunderstanding comes from the notion that a flow might have a state like started or stopped, whereas in reality all the flows exist in a ready state and whenever there is an event like an incoming message (but could be a specific time etc.) the receiving node is triggered and performs some action. Such action regularly finishes with the same or a different message produced and sent to the next node which then processes the event/message.

In order to get the nodes on "flow 2" going whenever "flow 1" is ready, you have to define what ready means for flow 1, find a way to produce a message and forward that (e.g. via link node) to the first node of the flow on "flow 2" tab.

I want to thank "E1cid" for the examples they helped.
I also want to thank "Steve-Mcl (the mention of Link nodes got to to study more.)

And the help of everybody else has go me on the right track once again.

Thanks to all.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.