# Is it possible to make a \`bus\` node?

**URL:** <https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605>\
**Category:** Feature Requests\
**Created:** [17 September 2019 02:03 UTC](https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605 "2019-09-17T02:03:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 September 2019 02:03 UTC](https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605/1 "2019-09-17T02:03:27Z")

</div>

Ok, this is a bit _silly_ but I am sure people have seen this problem a few times.

A flow. Lots of nodes and outputs.

They are neat as they are, but you need to duplicate these _wires_ (signals?) else where on the flow.

You have to add a heap of `link` nodes or run a lot of _wires_ from where this _set up_ is to else where on the flow.

_wouldn't it be better if you could bus these signals together?_

Two nodes: In and Out. (No prizes for guessing that) 😉

The `in` node has multiple inputs, (User editable) and one output.  
The `out` node is the reverse. (Maybe save the number of outputs.) One input and multiple outputs.

Then you connect up the signals to the inputs of the `in` node.  
Connect that node's output to the `out` of the pair.  
(Ok, you will need to edit the number of outputs)  
Then connect the outputs to where they need to go.  
Obviously #1 to #1, #2 to #2, #3 to #3 and so on.

I'm not of the ilk to be able to make anything like that.  
(and there is a problem that there is only 1 input on a node.)

But I'm just asking.

Is it possible?

Would people like/use it?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [17 September 2019 03:59 UTC](https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605/2 "2019-09-17T03:59:35Z")

</div>

> but you need to duplicate these wires (signals?) else where on the flow.  
> You have to add a heap of link nodes or run a lot of wires from where this set up is to else where on the flow.

Do you ?

Although I can see _some_ benefit in your idea of a "bus", it will become convoluted very quickly and you still need to add lots of wires, lots of configuration and lots of figuring out where what you put on the bus and where it exists or not.

Link nodes already act like buses but "multiplexed" - you can use a switch node to filter if needed.

NR has all the flexibility one could wish for, but what is 'best practice' ?  
The concept of a flow is from left to right, you have a canvas of 5000x5000 at your disposal.

_Why_ do you need all these link nodes ?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 September 2019 04:29 UTC](https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605/3 "2019-09-17T04:29:46Z")

</div>

It was ONLY a question.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 September 2019 08:22 UTC](https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605/4 "2019-09-17T08:22:04Z")

</div>

> [@Trying\_to\_learn](#):
>
> The `in` node has multiple inputs

There lies the problem. Node-RED enforces a single input and there is a good reason for that.

As soon as you try to allow multiple inputs, you hit the timing issue - Node.js is not realtime and you can never totally predict the order in which messages will arrive. So what should a node do that expects multiple inputs when it only has received some of those inputs? What happens if input #1 receives another msg before all of the other inputs have received one?

It gets very complex, very quickly.

With the link node, (or indeed any other) you can already have as many wires connected to an input. That leaves it up to you how to handle the issues.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 September 2019 09:05 UTC](https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605/5 "2019-09-17T09:05:50Z")

</div>

Julian.

Thanks for the clarification on that.

It was only whimsical thinking.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [17 September 2019 09:06 UTC](https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605/6 "2019-09-17T09:06:32Z")

</div>

> [@TotallyInformation](#):
>
> That leaves it up to you how to handle the issues.

Using topics comes to mind first

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

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

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 September 2019 09:08 UTC](https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605/7 "2019-09-17T09:08:05Z")

</div>

That's an interesting take on the idea.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 September 2019 09:14 UTC](https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605/8 "2019-09-17T09:14:52Z")

</div>

And that is fine if each input is independent of the others - though frankly, in that case I have an out link for each flow and a single in link. That's how I handle most MQTT connections now, Telegram as well.

So I often have 2 MQTT out nodes defined for all flows, one has the retain flag set and one doesn't. Makes it fairly easy to see what messages are being retained.

With Telegram, you have an out node for each bot but may wish to send messages to it from anywhere.

uibuilder is similar. I took the decision to bundle everything into a single node because of the appearance of link nodes. Send from anywhere via a link out. Have a single link in.

* * *

A bigger issue arises if you need to coordinate messages and that was what I was really referring to as the reason NR doesn't allow multiple inputs.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [17 September 2019 09:30 UTC](https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605/9 "2019-09-17T09:30:50Z")

</div>

> [@TotallyInformation](#):
>
> though frankly, in that case I have an out link for each flow and a single in link.

For a bus concept - the traffic has to go thru one node

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 September 2019 09:44 UTC](https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605/10 "2019-09-17T09:44:37Z")

</div>

> [@cymplecy](#):
>
> For a bus concept

I leave those to Boris Johnson. 😺

Having a single link-in _is_ a conceptual bus since all traffic goes through it. Of course, it doesn't have any of the other features that a true bus architecture would have like message queuing, back pressure, acknowledgements, etc.

But if you wanted that, Node-RED is the wrong tool anyway. MQTT will give you a subset of course. But an enterprise message hub will have a lot of additional features.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [17 September 2019 13:42 UTC](https://discourse.nodered.org/t/is-it-possible-to-make-a-bus-node/15605/11 "2019-09-17T13:42:19Z")

</div>

> Using topics comes to mind first

in the beta it is possible to switch by key, which introduces even more flexibility
