# Can I get information about the connected nodes?

**URL:** <https://discourse.nodered.org/t/can-i-get-information-about-the-connected-nodes/30921>\
**Category:** Developing Nodes\
**Created:** [30 July 2020 11:50 UTC](https://discourse.nodered.org/t/can-i-get-information-about-the-connected-nodes/30921 "2020-07-30T11:50:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin\_mpa](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@martin\_mpa](https://discourse.nodered.org/u/martin_mpa)\
**Post date:** [30 July 2020 11:50 UTC](https://discourse.nodered.org/t/can-i-get-information-about-the-connected-nodes/30921/1 "2020-07-30T11:50:52Z")

</div>

Hello, everyone,

I'm still pretty new to the topic Node-RED and especially custom nodes. At the moment I have a specific question, which I haven't found an answer to in the documentation yet and I'm asking for help:  
Can I programmatically determine at runtime which other nodes are connected to my node via the input(s) and output(s)?

Something like `output1.getConnectedNodes()` or so?

Martin

---

<div class="post-metadata">

**Author:** ![cinhcet](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cinhcet/32/438_2.png) [@cinhcet](https://discourse.nodered.org/u/cinhcet)\
**Post date:** [30 July 2020 11:58 UTC](https://discourse.nodered.org/t/can-i-get-information-about-the-connected-nodes/30921/2 "2020-07-30T11:58:20Z")

</div>

the node has a property called `wires` which tells you where the output of the node is connected to (you get an array of node ids).

The bigger question is why you want to do that?  
It is really against the core principles of Node-RED, so absolutely not recommended to do that.

---

<div class="post-metadata">

**Author:** ![martin\_mpa](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@martin\_mpa](https://discourse.nodered.org/u/martin_mpa)\
**Post date:** [10 September 2020 12:20 UTC](https://discourse.nodered.org/t/can-i-get-information-about-the-connected-nodes/30921/3 "2020-09-10T12:20:46Z")

</div>

Thanks for your answer. Currently i am evaluating possibilities, so i am not sure if i will use the `wires` property. Maybe i just don't see it, but where do i find a documentation about the node object?

---

<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:** [10 September 2020 12:24 UTC](https://discourse.nodered.org/t/can-i-get-information-about-the-connected-nodes/30921/4 "2020-09-10T12:24:37Z")

</div>

> [@martin\_mpa](#):
>
> but where do i find a documentation about the node object?

It is not documented as node's are not meant to care who they are connected to - they just call `node.send(...)` with the messages it wants passing on and the runtime takes care of routing the messages.

The fact there is an internal property called `wires` is not something a node's logic should rely on.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [9 November 2020 12:24 UTC](https://discourse.nodered.org/t/can-i-get-information-about-the-connected-nodes/30921/5 "2020-11-09T12:24:40Z")

</div>

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