I am reading the PDF document on how to create a Node-RED Workflow Startup process equivalent and something came to mind…Is there any order as to which flow will be executed first?
If so, how to we set that up?
If not, then how can we successfully setup a Node-RED Workflow Startup process equivalent? In Workflow, a Startup process is always executed first. If there are more than one, than they’re all executed first, in the order they appear in the Config, and then other regular processes will be executed which insure that all is ready for running.
I am using the complete node (God I definitely starting to love Node-RED ) and I am now at a step where I want my flow to not start until the Startup has finished but my flow isn’t trigger by a trigger node but by a HTTP In node. From what I understand, a HTTP In node is trigger when a request is received. So should I still use a Complete node then link it to the HTTP In one?
These can be two separate flows. There is no real reason to wait for the Startup flow to be completed as the application calling your end point (HTTP In) could also try to trigger the respective flow before Node-RED is started. This would result in a time-out the caller should handle.
Generally speaking it is good to make use of the Catch node and return an appropriate statusCode so that the caller can anticipate correctly.
The Catch node can be compared with Workflow’s On Error and is able to answer back to HTTP response node of your flow as illustrated in the image above. In this case I’ve set it up so that it is triggered when an error occurs with the Preview PDF node (for example in case the template is not found on the OL Connect Server). OL Connect nodes are “catchable” by the Catch node.