Is there a node that could or should be used to "Stop flow", at the end?

Perhaps another silly question. I have a bunch of flows that invoke multiple external APIs or databases, and which do not expect an immediate response. Hence, in the specific flows these API calls and database calls are kinda just hanging out there at the end of their branch.

Is there a flow that could/should be used to "stop" or "close" the flow? Does leaving them open or handing like that create any risk of memory leakage over time?


Nope, just leave them hanging. A node with an output port with no wire connected won't do anything with the msg output. And once that node finishes processing an input msg, it should close down anything it needs too (if it doesn't, you will have a leak no matter what). Node.js (or more accurately the V8 JavaScript engine) takes care of recovering memory once variables have reached the end of their scope so the way that Node-RED is architected should take care of that for you.


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