Subflow input's

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.

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

Or split into 2 and use link nodes.

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

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

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

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

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