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

**URL:** <https://discourse.nodered.org/t/topic/89901>\
**Category:** General\
**Created:** [31 July 2024 08:49 UTC](https://discourse.nodered.org/t/topic/89901 "2024-07-31T08:49:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cms](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@cms](https://discourse.nodered.org/u/cms)\
**Post date:** [31 July 2024 08:49 UTC](https://discourse.nodered.org/t/topic/89901/1 "2024-07-31T08:49:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [31 July 2024 08:57 UTC](https://discourse.nodered.org/t/topic/89901/2 "2024-07-31T08:57:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [31 July 2024 09:10 UTC](https://discourse.nodered.org/t/topic/89901/3 "2024-07-31T09:10:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 October 2024 09:11 UTC](https://discourse.nodered.org/t/topic/89901/4 "2024-10-29T09:11:04Z")

</div>

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