我希望自定义一个有多个输入和输出端口的节点,但是输入端口一直被限制最大为1个,请问我如何才能做到创建节点有多个输入端口?

我希望自定义一个有多个输入和输出端口的节点,但是输入端口一直被限制最大为1个,请问我如何才能做到创建节点有多个输入端口?

This is NOT possible, the number of inputs will ALWAYS be one.

This question has been asked on this forum several times and the answer will always be that Node-RED works like that.

For english readers:

I want to customize a node with multiple input and output ports, but the input port has been limited to a maximum of 1. How can I create a node with multiple input ports?

@cms

As @GogoVega states, this is not possible.

This is a design choice of Node-RED.

There are well established patterns for supporting multiple inputs. Here are 2 of them:

  • by expecting the incoming data to be an object with multiple properties
  • by utilising a topic to identify the incoming data

See the built-in examples for the join and split nodes to understand this.

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