Node-Red Function Nodes In Sequence

538 Views Asked by At

Hi I am currently developing a system in Node-Red. So it will receive input from POST and it will process it in the JS function node. But this is where the question begins. So if I put all the logics in one function node it will take like 100 lines of code (which now works btw). Should I just keep this or do I need to make several(like 2 or 3) function nodes in order to process the information in a sequential manner or is there no such need to do so? So instead of just having 3 nodes in a flow (receive input, function node to process logic, and output), should I separate the logic? (receive input, function node #1, function node #2, function node #n, and output)

1

There are 1 best solutions below

1
Renato Shumi On BEST ANSWER

It depends how do you want to organize your graph. Sometimes split in several nodes is better for maintenance and reuse the function in other flows.

Once I see node-red is a solution for prototype, POC etc, if you want to move it to production or it is getting too complex I recommend do it in NodeJs.