# Design requirements for nodes and their connection types

**URL:** <https://discourse.nodered.org/t/design-requirements-for-nodes-and-their-connection-types/75889>\
**Category:** Share Your Nodes\
**Created:** [28 February 2023 19:58 UTC](https://discourse.nodered.org/t/design-requirements-for-nodes-and-their-connection-types/75889 "2023-02-28T19:58:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric-cooper](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eric-cooper/32/69556_2.png) [@eric-cooper](https://discourse.nodered.org/u/eric-cooper)\
**Post date:** [28 February 2023 19:58 UTC](https://discourse.nodered.org/t/design-requirements-for-nodes-and-their-connection-types/75889/1 "2023-02-28T19:58:52Z")

</div>

Are there design requirements (some metadata) that describe the kinds of input and output connections that the node supports?

For example, how do I specify that node input must be a number? or RTSP?

More specifically, is there a way to inspect a node and then disallow certain (nonsensical) linkings?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 February 2023 20:10 UTC](https://discourse.nodered.org/t/design-requirements-for-nodes-and-their-connection-types/75889/2 "2023-02-28T20:10:24Z")

</div>

> [@eric-cooper](#):
>
> For example, how do I specify that node input must be a number? or RTSP?

Have a look in the docs for input validation.

> [@eric-cooper](#):
>
> More specifically, is there a way to inspect a node and then disallow certain (nonsensical) linkings?

As far as I'm aware, no. Node-RED tends to rely on conventions.

---

<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:** [28 February 2023 20:47 UTC](https://discourse.nodered.org/t/design-requirements-for-nodes-and-their-connection-types/75889/3 "2023-02-28T20:47:41Z")

</div>

> [@TotallyInformation](#):
>
> Have a look in the docs for input validation.

Just to clarify, that only covers validate the properties of a node - which I don't believe is what is being asked here.

Node-RED doesn't have any concept of typing on the inputs/outputs. It has been discussed from time to time, but nothing conclusive has come from that.

---

<div class="post-metadata">

**Author:** ![eric-cooper](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eric-cooper/32/69556_2.png) [@eric-cooper](https://discourse.nodered.org/u/eric-cooper)\
**Post date:** [28 February 2023 21:01 UTC](https://discourse.nodered.org/t/design-requirements-for-nodes-and-their-connection-types/75889/5 "2023-02-28T21:01:01Z")

</div>

Argh ... just deleted my reply.

Thanks!

Yes, I am looking for something akin what IDE/compiler does when it checks function declarations against function calls - and throws errors/warning for mismatches.

Building on that, I would also like to implement next level - one that could warn developer that, e.g., MQTT broker has multiple publishers for a topic but no subscribers (or vice versa).

This said, I will find and read input validation docs.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 February 2023 21:22 UTC](https://discourse.nodered.org/t/design-requirements-for-nodes-and-their-connection-types/75889/6 "2023-02-28T21:22:25Z")

</div>

> [@eric-cooper](#):
>
> warn developer that, e.g., MQTT broker has multiple publishers for a topic but no subscribers

How can you tell that when an instance of node-red only knows about actions on one of the clients connected to the broker? For example, if you have a sensor publishing its values to MQTT then node red will be subscribed to that topic but will not publish to it.

---

<div class="post-metadata">

**Author:** ![eric-cooper](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eric-cooper/32/69556_2.png) [@eric-cooper](https://discourse.nodered.org/u/eric-cooper)\
**Post date:** [28 February 2023 21:53 UTC](https://discourse.nodered.org/t/design-requirements-for-nodes-and-their-connection-types/75889/7 "2023-02-28T21:53:07Z")

</div>

Good question.

First, this was meant as aspirational - beyond simple syntax and type checking - and MQTT was one example that came to mind.

I was assuming cases where both publishers and subscribers are within node-red. (Arguably, a bad assumption.) In any case, my MQTTInNode and MQTTOutNode instances would have "Topic" values (and mqtt-broker "Server" values) - and these could be inspected. Maybe all this does is surface typos on topic names.

My larger focus is on providing high (though configurable) guardrails to help "accidental coders" be more successful, more productive.

---

<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:** [28 February 2023 22:12 UTC](https://discourse.nodered.org/t/design-requirements-for-nodes-and-their-connection-types/75889/8 "2023-02-28T22:12:59Z")

</div>

You may also want to have a look at `nrlint` - a linter for flows - [GitHub - node-red/nrlint: Node-RED Flow Linter](https://github.com/node-red/nrlint)

It lets you create custom rules that could be used to apply additional checks to the flows.
