# RED.nodes.getFlows() API

**URL:** <https://discourse.nodered.org/t/red-nodes-getflows-api/9013>\
**Category:** General\
**Created:** [15 March 2019 08:05 UTC](https://discourse.nodered.org/t/red-nodes-getflows-api/9013 "2019-03-15T08:05:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fangzhu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fangzhu/32/5796_2.png) [@fangzhu](https://discourse.nodered.org/u/fangzhu)\
**Post date:** [15 March 2019 08:05 UTC](https://discourse.nodered.org/t/red-nodes-getflows-api/9013/1 "2019-03-15T08:05:39Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [15 March 2019 08:43 UTC](https://discourse.nodered.org/t/red-nodes-getflows-api/9013/2 "2019-03-15T08:43:01Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![fangzhu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fangzhu/32/5796_2.png) [@fangzhu](https://discourse.nodered.org/u/fangzhu)\
**Post date:** [15 March 2019 10:21 UTC](https://discourse.nodered.org/t/red-nodes-getflows-api/9013/3 "2019-03-15T10:21:45Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/226a9b257dd487d5c64453948a28c0554929ca70.png)

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.
