# \[ANNOUNCE\] node-red-contrib-reusable-flows

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708>\
**Category:** Share Your Nodes\
**Created:** [30 September 2021 08:44 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708 "2021-09-30T08:44:56Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![rozek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rozek/32/48594_2.png) [@rozek](https://discourse.nodered.org/u/rozek)\
**Post date:** [30 September 2021 08:44 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708/1 "2021-09-30T08:44:56Z")

</div>

Hello,

since I urgently needed an equivalent for `function` nodes which are backed by a separate flow rather than JavaScript code, I wrote [node-red-contrib-reusable-flows](https://github.com/rozek/node-red-contrib-reusable-flows).

My requirements turned out to be much more difficult to meet than expected, as the Node-RED editor is not yet designed to handle dependencies between several nodes.

It took me more than three days of hacking and experimenting to reach a state I could live with. I'm not proud at all of the resulting code since I had to _learn during programming_ rather than being able to _plan first and implement afterwards_...

But it seems to work now.

Please consider the current state as "pre-alpha" as it has only been "smoke-tested" yet and still lacks a set of automated tests (which I currently do not know how to implement, though)

Nota bene: I know that some people do not like nodes like those provided by "node-red-contrib-reusable-flows" and prefer to see such functionality to be implemented in Node-RED itself - but I needed it _now_ and could not wait for a new Node-RED version.

Feel free to play with my code and raise issues if needed - any feedback is welcome!

With greetings from Germany,

Andreas Rozek

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [30 September 2021 11:28 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708/2 "2021-09-30T11:28:03Z")

</div>

Hello,  
Isn't this very similar to:

> **[node-red-contrib-components](https://flows.nodered.org/node/node-red-contrib-components)**
>
> reusable flows with a well defined API. Write components and use them anywhere in your node-red app

Best regards Johannes

---

<div class="post-metadata">

**Author:** ![rozek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rozek/32/48594_2.png) [@rozek](https://discourse.nodered.org/u/rozek)\
**Post date:** [30 September 2021 11:37 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708/3 "2021-09-30T11:37:30Z")

</div>

as explained in the [docs](https://github.com/rozek/node-red-contrib-reusable-flows#readme): "components" identify "callees" by their unique ids - and that causes problems, right now they completely break my flows

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [30 September 2021 11:54 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708/4 "2021-09-30T11:54:01Z")

</div>

I look at the readme, and I see it lists 4 different very similar concepts. Personally, I would have gone with subflows regardless, but that's not what this topic is about.  
You mention in the readme, and in this post that the issue is with their use of caller/callee IDs. I see you're a contributor on the node-red-contrib-components repository. Is it something that can be worked through in the design of the contrib-components library, or is it impossible to combine this in that same set of nodes. I ask this because you describe it as that design concept causing problems, so wouldn't it be preferable to have those problems fixed/evaded initially?

---

<div class="post-metadata">

**Author:** ![rozek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rozek/32/48594_2.png) [@rozek](https://discourse.nodered.org/u/rozek)\
**Post date:** [30 September 2021 12:04 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708/5 "2021-09-30T12:04:36Z")

</div>

Well, right now, I can't tell you whether the [issues of "node-red-contrib-components"](https://github.com/ollixx/node-red-contrib-components/issues) are due to its design or its implementation. However, referring to nodes by their unique id already caused some problems.

I've already promised the creator of "node-red-contrib-components" to check if I can reproduce the last problem which finally dealt that package the death blow in my own flows: once upon a sudden (I think I just restarted the Node-RED server) many "component use" nodes emitted messages when a single "component use" node was triggered. That immediately broke all my flows and kickstarted my own development as I cannot wait for these bugs to be fixed.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [30 September 2021 19:59 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708/6 "2021-09-30T19:59:24Z")

</div>

At first glance, it seems that these requirements will be met by the `link call` modifications to the `link` nodes that Nick worked on in the latest [live stream](https://www.youtube.com/watch?v=jqt8R2M_5QM). If the feature makes it into the version 2.1 beta, that will be an opportunity to see whether everyone can be happy with the result or if more work is needed.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [30 September 2021 21:21 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708/7 "2021-09-30T21:21:39Z")

</div>

the beta will be out fairly soon - so feedback then would be good.

---

<div class="post-metadata">

**Author:** ![rozek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rozek/32/48594_2.png) [@rozek](https://discourse.nodered.org/u/rozek)\
**Post date:** [14 October 2021 08:25 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708/8 "2021-10-14T08:25:08Z")

</div>

Thanks to a nice soul who raised a GitHub issue, "node-red-contrib-reusable-flows" are now part of the Node-RED library and can be found alongside the already well-known "node-red-contrib-actionflows" and "node-red-contrib-components".

---

<div class="post-metadata">

**Author:** ![rozek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rozek/32/48594_2.png) [@rozek](https://discourse.nodered.org/u/rozek)\
**Post date:** [15 October 2021 03:22 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708/9 "2021-10-15T03:22:54Z")

</div>

I just updated the docs to explain the relationship between "reusable flows" and the new "Link Call" nodes (with "Link Out" nodes put into "return" mode) and explain the installation from within the Palette Manager.

A new version has only been assigned in order to enforce an update of the documentation in `npm` and [flows.nodered.org](https://flows.nodered.org/)

---

<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:** [15 October 2021 06:53 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708/10 "2021-10-15T06:53:51Z")

</div>

I'd just like to say, that this looks like a fantastic bit of work and your documentation is superb 😃

Obviously, the new inbuilt link return core feature is going to be the goto technique to use for simple cases but you've created a great facility if we ever need more than that

Very impressive work 😃

---

<div class="post-metadata">

**Author:** ![rozek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rozek/32/48594_2.png) [@rozek](https://discourse.nodered.org/u/rozek)\
**Post date:** [15 October 2021 07:26 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708/11 "2021-10-15T07:26:29Z")

</div>

Thank you very much for this great praise!

I'm glad you like my little contribution!

---

<div class="post-metadata">

**Author:** ![rozek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rozek/32/48594_2.png) [@rozek](https://discourse.nodered.org/u/rozek)\
**Post date:** [25 October 2021 12:43 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-reusable-flows/51708/12 "2021-10-25T12:43:09Z")

</div>

For those who noticed the new version: I just changed a few error messages and made them a bit more descriptive...no _real_ need to update, though
