# Help on how to roll out a new version of a subflow I wrote amongst my machines

**URL:** <https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113>\
**Category:** General\
**Created:** [12 October 2021 03:12 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113 "2021-10-12T03:12:02Z")\
**Posts on this page:** 12\
**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:** [12 October 2021 03:12 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113/1 "2021-10-12T03:12:02Z")

</div>

I've written/made/built a `subflow`.

Maybe not the _correct_ way - not via `github` - and it has evolved to the next level.

I have tried my best to also update the instructions.

So how can I get it to all my machines - with the new instructions, etc.  
I get I could just go to each machine; edit the subflow and paste the new stuff in.  
But that seems an even worse way.

Someone - please.

---

<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:** [13 October 2021 16:02 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113/2 "2021-10-13T16:02:05Z")

</div>

Has anyone any suggestions on a good way to do this? It must be a fairly common situation. Like @Trying_to_learn I have subflows that are used across multiple systems and am missing a good way to keep a master copy that can be easily distributed to the other systems.

---

<div class="post-metadata">

**Author:** ![eastling](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eastling/32/39127_2.png) [@eastling](https://discourse.nodered.org/u/eastling)\
**Post date:** [13 October 2021 17:36 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113/3 "2021-10-13T17:36:49Z")

</div>

I am also very intresed in this.  
In the [blog post](https://nodered.org/blog/2020/10/13/future-plans) about future plans for node red from exactly one year ago today ( 🙂 ) "Exportable subflows" is mentioned which seems very promising.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [13 October 2021 18:59 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113/4 "2021-10-13T18:59:15Z")

</div>

I might be missing the point here, but see the attached gif which seems to work fine.  
In the video (for ease of demo) I export the subflow to the clipboard, before pasting it in a different NR server, but it would be equally easy to download the subflow, instead of 'Copying it to the clipboard'. Then all you need to do is import the file which you downloaded into all of your other servers.

![SHARESUBFLOWS](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/b/8b857a800cc6910db16e2d05f484c32ae6a509b8.gif)

---

<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:** [13 October 2021 19:56 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113/5 "2021-10-13T19:56:41Z")

</div>

I think the problem is to do this when you have the previous version of the subflow already in use in several tabs are on the second server and you want to update those.  
If I remember correctly importing the updated subflow will not replace the old version already used in use but instead create a new additional subflow.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [13 October 2021 19:59 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113/6 "2021-10-13T19:59:58Z")

</div>

Reading the [admin API documentation](https://nodered.org/docs/api/admin/types) there is some way to post subflows via a POST method, not entirely sure how this work and indeed it might add a duplicated subflow.

---

<div class="post-metadata">

**Author:** ![Hopperpop](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hopperpop/32/42533_2.png) [@Hopperpop](https://discourse.nodered.org/u/Hopperpop)\
**Post date:** [13 October 2021 20:13 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113/7 "2021-10-13T20:13:32Z")

</div>

There is also this experimental [option](https://nodered.org/docs/creating-nodes/subflow-modules) to pack your subflow as a module and use normal node versioning.

I'm also struggling with the same problem. The packaging options still need to many steps to make it usable from my point of view.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [13 October 2021 20:16 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113/8 "2021-10-13T20:16:24Z")

</div>

> [@JGKK](#):
>
> If I remember correctly importing the updated subflow will not replace the old version already used in use but instead create a new additional subflow

No, I don't think so.  
When you import the revised subflow, you will get this message

![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/c/fc5100e8e493b16567d98716bb65ee8791d1b396.jpeg)

So select 'View nodes' and you get

 ![2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/0/e0d960bc9e967244e55f46589bee1bd8f9757630.jpeg)

Then select the node which is un-ticked, and also select 'replace'  
It should then overwrite the existing subflow, and update all of the existing flows that use the subflow.

---

<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:** [13 October 2021 20:21 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113/10 "2021-10-13T20:21:25Z")

</div>

Yes i just found this out too just now 🙈  
I didn’t notice before because some of my node-red instances where on 1.1 still including the one i was importing too.  
This feature was added in 1.2.1 with also this use case in mind and slipped straight past me:

> **[Version 1.2 released](https://nodered.org/blog/2020/10/15/version-1-2-released)**
>
> Find out more on the blog

So this pretty much solves the problem 🎊

---

<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:** [13 October 2021 20:33 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113/11 "2021-10-13T20:33:57Z")

</div>

> [@JGKK](#):
>
> So this pretty much solves the problem

It makes the act of pasting a replacement subflow into another instance reasonably simple to do, but it is a manual operation. Suppose, for example, that it is used in 20 systems, then it becomes onerous.

In fact the option to pack a subflow as a module is definitely the way to go, I think. If I understand correctly, the source could be on github and it can be updated there and all that has to be done is to use npm on the secondary systems to update to the new version. Therefore the update could, for example, be updated automatically using tools such as ansible, which is how I deploy flows in the first place. I had a recollection that I had seen something about this but had not been able to find it. Thanks @Hopperpop for pointing it out. I will give it a go and see how well it works.

---

<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:** [13 October 2021 22:36 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113/12 "2021-10-13T22:36:38Z")

</div>

Thanks all for the replies.

I shall have to try that, but just now I can't. Other things happening and I really need to make sure doing that won't upset the _apple cart_.

Silly me for not seeing/thinking of the option posted by @Paul-Reed.  
I guess I haven't dealt with that option too much and so it slipped past me.

Thanks Paul.

I'll give it a go and report back ASAP.

---

<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:** [12 December 2021 22:36 UTC](https://discourse.nodered.org/t/help-on-how-to-roll-out-a-new-version-of-a-subflow-i-wrote-amongst-my-machines/52113/13 "2021-12-12T22:36:55Z")

</div>

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