# Subflow input's

**URL:** <https://discourse.nodered.org/t/subflow-inputs/3352>\
**Category:** General\
**Created:** [21 September 2018 23:23 UTC](https://discourse.nodered.org/t/subflow-inputs/3352 "2018-09-21T23:23:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![real-prometheus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/real-prometheus/32/1079_2.png) [@real-prometheus](https://discourse.nodered.org/u/real-prometheus)\
**Post date:** [21 September 2018 23:23 UTC](https://discourse.nodered.org/t/subflow-inputs/3352/1 "2018-09-21T23:23:46Z")

</div>

Is there a reason why a subflow can only have no or one input? Using subflow to built components it would be very helpful to have multiple inputs. E.g. a shutter component can have one bool input for up/down and a second one for stop/roll.

---

<div class="post-metadata">

**Author:** ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)\
**Post date:** [21 September 2018 23:28 UTC](https://discourse.nodered.org/t/subflow-inputs/3352/2 "2018-09-21T23:28:20Z")

</div>

The behavior you describe should be achievable using topics and switch nodes.

---

<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:** [22 September 2018 00:22 UTC](https://discourse.nodered.org/t/subflow-inputs/3352/3 "2018-09-22T00:22:22Z")

</div>

Or split into 2 and use link nodes.

---

<div class="post-metadata">

**Author:** ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)\
**Post date:** [22 September 2018 00:25 UTC](https://discourse.nodered.org/t/subflow-inputs/3352/4 "2018-09-22T00:25:29Z")

</div>

I'm pretty sure you can't use link nodes inside a subflow.

---

<div class="post-metadata">

**Author:** ![wb666greene](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wb666greene/32/6534_2.png) [@wb666greene](https://discourse.nodered.org/u/wb666greene)\
**Post date:** [22 September 2018 02:50 UTC](https://discourse.nodered.org/t/subflow-inputs/3352/5 "2018-09-22T02:50:13Z")

</div>

I'm not a node-red expert, but when I've really needed multiple inputs, a function node and if (msg.topic...) has always seemed to allow a nice solution.

I've played with some of the "boolean" nodes -- not as effective as a function node in my experience.

---

<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:** [22 September 2018 12:14 UTC](https://discourse.nodered.org/t/subflow-inputs/3352/6 "2018-09-22T12:14:29Z")

</div>

> [@JayDickson](#):
>
> I'm pretty sure you can't use link nodes inside a subflow.

Sorry, I wasn't clear (it was late) I meant outside the subflows.

---

<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:** [22 September 2018 12:16 UTC](https://discourse.nodered.org/t/subflow-inputs/3352/7 "2018-09-22T12:16:49Z")

</div>

> [@wb666greene](#):
>
> I'm not a node-red expert, but when I've really needed multiple inputs, a function node and if (msg.topic...) has always seemed to allow a nice solution.
> 
> I've played with some of the "boolean" nodes -- not as effective as a function node in my experience.

Really depends on your experience. Not everyone who uses Node-RED is JavaScript savvy. That's part of the point of a flow-based development tool after all. However, you are correct that quite often you can get a lot done in a single function node. Whether you can follow your own logic after 6 months is another matter. 🙂

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [22 September 2018 14:24 UTC](https://discourse.nodered.org/t/subflow-inputs/3352/8 "2018-09-22T14:24:29Z")

</div>

You can feed the messages in using different topics and immediately separate them using a Switch node.
