I am embedding node-red in an express application. The entire application logic is split into small functions within Node.js and these functions are called from Node-Red. The idea is to have Node-Red as an orchestration layer. There are some async function calls from Node-Red function nodes. Now when an error(uncaught) is thrown from the node.js function, the node-red function node does not catch it and this completely stops. The node-red layer is supposed to function like a scheduler checking the database for every 20 seconds for records to process.
Also read this article:
Node-Red function node has a catch. But the error still goes uncaught and node-red stops. How can I prevent this.
Also, if the node-red stops, is there a way to start it programmatically. Right now, i have to restart the entire express application which might not be feasible in Production environments.
My design is to have node-red flow run continuously. Hopefully its not a bad design.
Sample Design Below to showcase the idea.
Sample Function Node:
Please help. I have encountered this issue at the very last moment. I am going to Prod deployment in 2 weeks time.