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.
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.
I am also very intresed in this.
In the blog post about future plans for node red from exactly one year ago today ( ) "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.
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.
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.
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:
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.