Get all nodes in the same flow

How do I find all nodes in the same flow at run time?

I found Nick's answer in this post, but with NR 3.0.2, I don't have access to the API RED.nodes.getAllFlowNodes() and the like.

9 May 11:29:19 - [error] [my_node:bc80cdc0359d37e3] TypeError: RED.nodes.getAllFlowNodes is not a function

RED.nodes.getAllFlowNodes is a client side thing not server side.

Do you mean on a tab or all nodes connected upstream and downstream by wires? Does that also include nodes connected indirectly (e.g link-in ~ link-out, link-call ~ link-in),

For me the solution is to read the "start"-file in the .node-red directory. All flows has the type "tab" and an id. The nodes whiche are also inside the "start" file - have a reference (property "z") to the Flow-IDs.
If you'll find the connection and so the "wires" reference to the following node(s) of a node. This ways for me works and seems to be the best.

1 Like

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