# How to deploy a subflow to several systems

**URL:** https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045
**Category:** General
**Tags:** subflow
**Created:** [6 April 2024 18:12 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045 "2024-04-06T18:12:57Z")
**Posts on this page:** 14
**Page:** 1

<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: [6 April 2024 18:12 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/1 "2024-04-06T18:12:57Z")

</div>

I suspect this has been asked before but can't find anything searching the forum.

I have some subflows that are used on several systems. Does anyone have a clever technique to deploy a new version out to the other systems?

---

<div class="post-metadata">

### Author: ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)
#### Post date: [6 April 2024 20:30 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/2 "2024-04-06T20:30:10Z")

</div>

Like FlowFuse with Snapshot?

---

<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: [6 April 2024 21:01 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/3 "2024-04-06T21:01:32Z")

</div>

I don't think so, the systems have different flows, I use the same subflow on multiple systems and want to get a new version of just the subflow out. I can't just import the subflow because that would not replace the existing one.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [7 April 2024 08:18 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/4 "2024-04-07T08:18:51Z")

</div>

> [@Colin](#):
>
> I can't just import the subflow because that would not replace the existing one.

It does if you select the `replace` option colin

![chrome_Ff4haogfPO](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/e/1ea5c4eab3195b4048124af05483b9a154e58685.gif)

---

<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: [7 April 2024 10:16 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/5 "2024-04-07T10:16:41Z")

</div>

Brilliant, I thought. Unfortunately I am not seeing that option. I just see

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/6/c63668fad39b3d0bdf6dfc616b5699eec9adfc88.png)

Both nodes were already selected.

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [7 April 2024 10:51 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/6 "2024-04-07T10:51:47Z")

</div>

FWIW (and you recent venture into subflow modules)

you could increment the version in package.json, and it should update the instance as it will any other module?

Admittedly I'm assuming the setup here (like if you're converting it to a module?) 😬

Could make for better version control in the long if not already.

---

<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: [7 April 2024 10:59 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/7 "2024-04-07T10:59:01Z")

</div>

> [@marcus-j-davies](#):
>
> you could increment the version in package.json

This isn't a subflow packaged as a module, it is just a subflow, so there isn't a package.json.

---

<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: [7 April 2024 11:10 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/8 "2024-04-07T11:10:20Z")

</div>

I can't package it as a module yet as packaged subflows containing D2 ui nodes don't work.  
Subflows with ui-nodes don't fully work, but are usable.

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [7 April 2024 11:14 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/9 "2024-04-07T11:14:35Z")

</div>

Got it!

interestingly, I also get the **replace** option

 ![Screenshot 2024-04-07 at 12.14.26](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/5/25c6a0650dae0ab8e142467f775fa60388572c29.png)

Is this a UX thing - the name of the subflow instance seems long in your screenshot - maybe pushing it off screen?

---

<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: [7 April 2024 11:30 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/10 "2024-04-07T11:30:35Z")

</div>

The ID's have to match it seems. Somehow I have got a different id for the subflow in the one I am trying to replace. That then begs the question as to how it identifies it as already existing in the workspace.

I feel a bit of flow file hacking coming on.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [7 April 2024 12:02 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/11 "2024-04-07T12:02:46Z")

</div>

At some point you have imported a copy.

Get your IDs aligned and you should be presented with the import-\> replace option.

---

<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: [7 April 2024 12:28 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/12 "2024-04-07T12:28:23Z")

</div>

> [@Steve-Mcl](#):
>
> At some point you have imported a copy.

Yes, I am sure you are right. In that case, how does it know to say "Some of the nodes you are importing already exist in your workspace"? The import only includes the subflow itself.

---

<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: [7 April 2024 14:21 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/13 "2024-04-07T14:21:55Z")

</div>

Answering my own question, one of the nodes in the subflow had the same id as a node on the destination machine. I think I probably imported it from there when building the subflow on the other machine.

---

<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: [6 July 2024 14:22 UTC](https://discourse.nodered.org/t/how-to-deploy-a-subflow-to-several-systems/87045/14 "2024-07-06T14:22:07Z")

</div>

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