# Custom node's input port disappears if the "inputs" field's value is greater than 1

**URL:** <https://discourse.nodered.org/t/custom-nodes-input-port-disappears-if-the-inputs-fields-value-is-greater-than-1/77760>\
**Category:** Developing Nodes\
**Tags:** function-node\
**Created:** [21 April 2023 00:54 UTC](https://discourse.nodered.org/t/custom-nodes-input-port-disappears-if-the-inputs-fields-value-is-greater-than-1/77760 "2023-04-21T00:54:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kakyoism](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kakyoism/32/46283_2.png) [@kakyoism](https://discourse.nodered.org/u/kakyoism)\
**Post date:** [21 April 2023 00:54 UTC](https://discourse.nodered.org/t/custom-nodes-input-port-disappears-if-the-inputs-fields-value-is-greater-than-1/77760/1 "2023-04-21T00:54:06Z")

</div>

## Environment

Node-RED 2.0.5

## Repro

For my custom node, I allow two input ports, so in node.html, I filled the number of inputs this way

```html
inputs: 2,
outputs: 2,

```

## Expectation

Knowing that NR supports a single in-port, I expect to see **just one in-port at the left end of my node**.

## Observation

- However, the node in the workspace looks like **there are no in-ports at all.**
- There appear to be two out-ports as expected

## Question

This behavior feels a bit counterintuitive. Is this by design? Should I remember to keep the "inputs" field as either 1 or 0 at all times?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [21 April 2023 07:54 UTC](https://discourse.nodered.org/t/custom-nodes-input-port-disappears-if-the-inputs-fields-value-is-greater-than-1/77760/2 "2023-04-21T07:54:29Z")

</div>

Node-RED doesn't support more than 1 input. The code assumes the value is 0 or 1. I don't think I've ever tested the behaviour of setting it to anything else, because it isn't supported.

---

<div class="post-metadata">

**Author:** ![kakyoism](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kakyoism/32/46283_2.png) [@kakyoism](https://discourse.nodered.org/u/kakyoism)\
**Post date:** [21 April 2023 10:02 UTC](https://discourse.nodered.org/t/custom-nodes-input-port-disappears-if-the-inputs-fields-value-is-greater-than-1/77760/3 "2023-04-21T10:02:14Z")

</div>

@knolleary Thanks for clarifying, Nick.

---

<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:** [5 May 2023 10:02 UTC](https://discourse.nodered.org/t/custom-nodes-input-port-disappears-if-the-inputs-fields-value-is-greater-than-1/77760/4 "2023-05-05T10:02:21Z")

</div>

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