# Thoughts on this new node? node-red-contrib-components

**URL:** <https://discourse.nodered.org/t/thoughts-on-this-new-node-node-red-contrib-components/30279>\
**Category:** General\
**Created:** [18 July 2020 01:36 UTC](https://discourse.nodered.org/t/thoughts-on-this-new-node-node-red-contrib-components/30279 "2020-07-18T01:36:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [18 July 2020 01:36 UTC](https://discourse.nodered.org/t/thoughts-on-this-new-node-node-red-contrib-components/30279/1 "2020-07-18T01:36:04Z")

</div>

[Components.](https://flows.nodered.org/node/node-red-contrib-components)

It would seem it is an _alternative_ to the _sub-flow_.

My take is that it is, but in a different _flavour_ of how it is done. But: I have been wrong before.

So I am politely asking here other people's thoughts on what it is and what it offers compared to the sub-flow scheme already in Node-Red.

---

<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:** [18 July 2020 02:43 UTC](https://discourse.nodered.org/t/thoughts-on-this-new-node-node-red-contrib-components/30279/2 "2020-07-18T02:43:13Z")

</div>

disclaimer - I havent used it - but I can see the motivation.

I think it could be useful. Its almost like a subroutine (and almost wish it had been called `node-red-contrib-subroutine`).

2 benefits I see over subflow is it easier to setup & you can see node-statuses etc (as nodes are on the main flow not in a hidden instance).  
1 downside is you still have the flows somewhere on a tab unlike the subflow (which is a nice neat self contained unit). (no biggie TBH)

I may have more constructive feedback once I install it and give it a go. however, at this point, I have not installed it as I can achieve most things with link nodes and / or subflows - but I will keep it in mind when I next need simple subflow-like functionality.

What are your thoughts?

---

<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:** [18 July 2020 12:15 UTC](https://discourse.nodered.org/t/thoughts-on-this-new-node-node-red-contrib-components/30279/3 "2020-07-18T12:15:46Z")

</div>

Other than having an in-line run node, I really don't see any difference or benefit over using link-out/-in nodes which is what I do now. I rarely even use subflows any more.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [18 July 2020 12:51 UTC](https://discourse.nodered.org/t/thoughts-on-this-new-node-node-red-contrib-components/30279/4 "2020-07-18T12:51:11Z")

</div>

I tried it out and no advantage over link in and out nodes as Julian says

Subflows are still the tool for job went you want to reuse the same set of nodes as a package

---

<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:** [18 July 2020 20:25 UTC](https://discourse.nodered.org/t/thoughts-on-this-new-node-node-red-contrib-components/30279/5 "2020-07-18T20:25:13Z")

</div>

> [@TotallyInformation](#):
>
> I really don't see any difference or benefit over using link-out/-in nodes

I thought that at first too but I believe the difference is that it only returns to the output of the calling "component" node where as a link node would return to all linked nodes & you would need a topic it other means for understanding/routing the return of used multiple times.

Think of a subroutine call where the gosub return returns to that caller only with the result of the subroutine calculation.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [18 July 2020 21:38 UTC](https://discourse.nodered.org/t/thoughts-on-this-new-node-node-red-contrib-components/30279/6 "2020-07-18T21:38:20Z")

</div>

> [@Steve-Mcl](#):
>
> I thought that at first too but I believe the difference is that it only returns to the output of the calling "component" node where as a link node would return to all linked nodes

Good point - I hadn't realised 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:** [11 August 2020 14:27 UTC](https://discourse.nodered.org/t/thoughts-on-this-new-node-node-red-contrib-components/30279/7 "2020-08-11T14:27:51Z")

</div>

> [@Steve-Mcl](#):
>
> I may have more constructive feedback once I install it and give it a go.

So now I am using this set of nodes - here are my thoughts. (Spoiler - I'm liking it)

- It should _really_ be called `node-red-contrib-subroutine` (IMO) as that is pretty much what it does...

- unlike a subflow where you cant choose `msg` or `flow` as an input, you can with this node - very nice touch...

Apart from the odd naming of nodes...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/4/24356a0f0a26aacefccb883d58558db243ba5d6b.png)  
... this is a pretty good set of nodes.

Me likey - a lot 🙂

👍

* * *

PS, if i were pushed for alternative naming, it'd be...  
node-red-contrib-components --\> node-red-contrib-subroutine  
comp start --\> Subroutine Define  
comp return --\> Subroutine Return  
use comp --\> Subroutine Call

---

<div class="post-metadata">

**Author:** ![ollix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ollix/32/27306_2.png) [@ollix](https://discourse.nodered.org/u/ollix)\
**Post date:** [17 August 2020 08:50 UTC](https://discourse.nodered.org/t/thoughts-on-this-new-node-node-red-contrib-components/30279/8 "2020-08-17T08:50:56Z")

</div>

Hi folks,  
sorry I missed this conversation. I saw regular downloads, but until now did not really expect a discussion. Thanks to @Steve-Mcl, I learned, that people do use my nodes, so I have to bring some more focus to the forum.

It makes me think, that some (or most?) of you did not understand the purpose / intention of node-red-contrib-components. I tried to explain all of that in the readme. But obviously that was either too long or not clear enough.

Did you check out node-red-contrib-actionflows before? That was the node, I used a lot, until it occured to me, that their understanding of **interface** was not mine. But still, it is a widely used set of nodes and well done.

I am very pleased to see you guys being interested and I would love to discuss, how components could be improved and be made more useful.  
Starting with @Steve-Mcl suggesting a renaming, I invite you to talk about that in a separate thread:

> [@Renaming of node-red-contrib-components](https://discourse.nodered.org/t/renaming-of-node-red-contrib-components/31649):
>
> Hello node-red enthusiasts, I published node-red-contrib-components in February, but never really cared to use the forum until now, that some users started to discuss about it. There is a suggestion by @Steve-Mcl to rename the node to node-red-contrib-subroutine. I am not so happy about that, since my original intention was to really get close to something like a component, which for me is a stand-alone piece of functionality, that can be reused many times. But maybe the difference between s…

---

<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:** [16 October 2020 08:51 UTC](https://discourse.nodered.org/t/thoughts-on-this-new-node-node-red-contrib-components/30279/9 "2020-10-16T08:51:29Z")

</div>

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