Subflow input's

#1

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.

0 Likes

#2

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

0 Likes

#3

Or split into 2 and use link nodes.

0 Likes

#4

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

0 Likes

#5

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.

1 Like

#6

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

0 Likes

#7

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. :slight_smile:

1 Like

#8

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

0 Likes