# Node vs Subflow Node implementation research

**URL:** <https://discourse.nodered.org/t/node-vs-subflow-node-implementation-research/98012>\
**Category:** General\
**Created:** [7 July 2025 18:49 UTC](https://discourse.nodered.org/t/node-vs-subflow-node-implementation-research/98012 "2025-07-07T18:49:20Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [10 July 2025 16:06 UTC](https://discourse.nodered.org/t/node-vs-subflow-node-implementation-research/98012/21 "2025-07-10T16:06:36Z")

</div>

> [@dceejay](#):
>
> we want to adopt it into the core of Node-RED

I remember that there was once a discussion about the core nodes of Node-RED and that I was arguing that all nodes should be removed and placed in a separate node package - that might or might not be preinstalled.

IIRC you actually backed that idea 😉

Point being is that I don't see my software in the core of Node-RED, instead the core of NR should be thinned out - IMHO. And the features that NR would offer to external code would increase - perhaps libraries around network access or message handling or security and storage. That would allow node package authors their freedoms to select their licenses.

Thankfully there seems to be a trend - as far as I see it - towards open source developers being more aware of licenses and the power of corporates ~~forcing~~ encouraging them to develop software for free. It would be interesting to see how many "open source developers" are employed by corporates and how many are truly independent. Those employed by big corporates are further "encouraged" to support for "strings-free" software license.

No big corporate would have paid me to develop my eclectic set of node packages or my mind map tool but - IMHO - that's the true spirit of open source software - experimenting and trying different approaches and having the freedom to share that without worrying about licenses and lawyers.

EDIT: btw I miss the good old days when Julian and I would have these long discussions, going completely off-topic and everyone complain that we went off-topic .... 😉 Sorry folks for being completely off-topic the last few days!

---

<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:** [10 July 2025 19:47 UTC](https://discourse.nodered.org/t/node-vs-subflow-node-implementation-research/98012/22 "2025-07-10T19:47:46Z")

</div>

> [@AllanOricil](#):
>
> In node-red we can pass class instances through messages.

Does that work if you hit a clone (e.g. 2 wires out of a single node output port)? I wouldn't have thought it would because I suspect that a clone needs to serialise things but I may well be wrong.

> [@gregorius](#):
>
> ideas and implementing them in NodeJS

Except that, if I've understood things correctly (not all that likely, I will admit!), Node.js has a quite slow multi-process architecture. And so Node-RED doesn't really "pass messages" does it? All that is happening, as I understand it, is that the msg's reference (it is a variable, not really a "message") is being passed between nodes. This sounds like it is very different to Erlang (though I have only the slimmest of knowledge about Erlang).

> [@dceejay](#):
>
> When I was still at IBM the lawyers would never let us sign up to anything that included GPL3 - so may not be as "safe" as you would like.

This is very common, very few of the GPL license variations can be used in big enterprise or Government/Health. MIT is the most common for such things. UK Government and Health open source should all be dual licensed, MIT for the code and OGL2 (a UK Government specific license) for documentation.

> [@gregorius](#):
>
> Big blue doesn’t make me blue. It was on GitHub’s list of open science license so it must be ok somewhere on this planet.

The GPL licenses were created by the more extreme believers in the open source world. Lots of people disagree with them. MIT or Apache2 are much better open source licenses in most people's eyes.

> [@gregorius](#):
>
> EDIT: btw I miss the good old days when Julian and I would have these long discussions, going completely off-topic and everyone complain that we went off-topic .... 😉 Sorry folks for being completely off-topic the last few days!

Hey, I'm still here and as ~~argumentative~~ discussive (is that a word?) as ever! I just haven't had as much capacity this year so far. Just wait till I retire early next year (if not before the way things are going!). Won't be long before we get our knuckles rapped again for going down a deep, off-topic, rabbit hole I am sure. 😎

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [10 July 2025 20:23 UTC](https://discourse.nodered.org/t/node-vs-subflow-node-implementation-research/98012/23 "2025-07-10T20:23:59Z")

</div>

> [@TotallyInformation](#):
>
> Except that, if I've understood things correctly (not all that likely, I will admit!), Node.js has a quite slow multi-process architecture. And so Node-RED doesn't really "pass messages" does it?

Of course, NodeJS and Erlang are completely different however the concepts that Node-RED encapsulates can be implemented in both. Node-RED is influenced by Flow Based Programming (FBP) that has independent computational units called nodes and these can fail - in FBP.

Now we add a ["supervisor"](https://www.erlang.org/doc/apps/stdlib/supervisor.html) node which restarts failing nodes, that would be an extremely useful concept for FBP. So now we take that concept and add it to Node-RED. Immediately the question arises how to implement this in NodeJS. Of course, in the current state, Node-RED could not support a "supervisor" concept or it could but with difficulty - I honestly also don't know.

This does not reduce the usefulness of the "concept" of a supervisor node, it begs the question how to implement this in NodeJS! I'm not advocating converting the Node-RED to use "processes" and "messages" in NodeJS because NodeJS - as you say - isn't good at multi-process designs. But neither was NodeJS designed for FBP yet Node-RED does a great job of implementing the concepts underlying FBP. 🙂

> [@TotallyInformation](#):
>
> Lots of people disagree with them.

Especially since Richard Stallman fell very much out of favour. Which is a really shame since, regardless of what one thinks of RMS, he did _a lot_ for open source software community.

---

<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:** [10 July 2025 22:13 UTC](https://discourse.nodered.org/t/node-vs-subflow-node-implementation-research/98012/24 "2025-07-10T22:13:49Z")

</div>

> [@gregorius](#):
>
> Especially since Richard Stallman fell very much out of favour. Which is a really shame since, regardless of what one thinks of RMS, he did _a lot_ for open source software community.

The religion trap - we see it in all walks of life including science and tech. People end up treating their ideas like a religion instead of continuing to develop and adjust.

---

<div class="post-metadata">

**Author:** ![ThingsTinkerer](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@ThingsTinkerer](https://discourse.nodered.org/u/ThingsTinkerer)\
**Post date:** [10 July 2025 23:38 UTC](https://discourse.nodered.org/t/node-vs-subflow-node-implementation-research/98012/25 "2025-07-10T23:38:07Z")

</div>

Great point, it is something that ideally would be included as core feature of node red, not left to you alone to solve haha. But it looked like you had something like that already for your own version?

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [11 July 2025 06:14 UTC](https://discourse.nodered.org/t/node-vs-subflow-node-implementation-research/98012/26 "2025-07-11T06:14:09Z")

</div>

> [@ThingsTinkerer](#):
>
> already for your own version?

Sure, it's all [Erlang code](https://github.com/gorenje/erlang-red/blob/6b3d5e186c54765403abd5ee5a054da4a5331b50/src/servers/ered_unittest_engine.erl#L193-L246) - it basically setups collection of all exception and completed message (completed messages are generated by some nodes so that the "complete" node works), then it creates processes for the nodes, then triggers all inject nodes, waits and then halts all started processes.

Basically the entire code is pointless in NodeJS. Even the concepts don't transport - there is no such thing as exception collection in Node-RED. Also the Erlang version runs all tests concurrently and this requires isolation between process and errors raised.

---

<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:** [9 October 2025 06:14 UTC](https://discourse.nodered.org/t/node-vs-subflow-node-implementation-research/98012/27 "2025-10-09T06:14:55Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/node-vs-subflow-node-implementation-research/98012.md?page=1)
