RED.nodes.getFlows() API


#1

I tried to create a node using RED.nodes.getFlows() API, but it gives me error of "TypeError: RED.nodes.getFlows is not a function". I don't know why. I could use the same way to call RED.nodes.getNode() though. Is there something special about the getFlows API?


#2

The RED object we pass into nodes does not give you full access to the runtime - it is a cut down API providing only the bits of the runtime api that nodes are allowed to access.

The RED.nodes.getFlows function is not available to Nodes.

Why do you want to access the function from your Node?


#3

I want to create a service where user/system can pre-configure which flow(as rest service) to run under a certain condition. To do this, I need to provide a service to list up the a candidate of urls that was configured in the first node of the flow, which is why I want to create a node to do so.

We have confirmed we can do this through rest service, but we thought it is neat to use API instead of calling rest service inside a node. We also confirmed we can use it if we add a "require" line with absolute path to the flow directory. But I guess we are not doing it the correct way.