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

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.

1 Like

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.

1 Like

I am also very intresed in this.
In the blog post about future plans for node red from exactly one year ago today ( :slight_smile: ) "Exportable subflows" is mentioned which seems very promising.

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

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.

Reading the admin API documentation 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.

There is also this experimental option 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.

2 Likes

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

1

So select 'View nodes' and you get

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.

2 Likes

Yes i just found this out too just now :see_no_evil:
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:

So this pretty much solves the problem :confetti_ball:

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.

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.