# Subflows and \`import\`... not always working the same

**URL:** https://discourse.nodered.org/t/subflows-and-import-not-always-working-the-same/59684
**Category:** General
**Created:** [10 March 2022 22:47 UTC](https://discourse.nodered.org/t/subflows-and-import-not-always-working-the-same/59684 "2022-03-10T22:47:23Z")
**Posts on this page:** 4
**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: [10 March 2022 22:47 UTC](https://discourse.nodered.org/t/subflows-and-import-not-always-working-the-same/59684/1 "2022-03-10T22:47:23Z")

</div>

I have (I know it is not a good idea, but this is the situation as it presents itself to me just now) a few different versions of a subflow I wrote on different machines.

I `export` what I think is the latest and `import` on the other machine.  
I get queried about it, I select the `view nodes` and then tick the required things and `replace` it.

All is good.

But then I see that is not the latest. There is one a couple of weeks newer (is that the right term? Anyway...) and so I repeat the process.

But this time when I `import` and click the `view nodes` I don't get an option to `replace` it.

Details:  
exporting from NR 2.1.4  
importing to NR 2.1.4

Ok. That throws a spanner in the works for my first theory.

First example:

 ![Screenshot from 2022-03-11 09-41-43](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/c/dc44af6f252c76279c7c06a6c12f3b28cec034ba.png)

Opening the subflow, the `env variables` part is blank.  
NR 2.1.4

Other machine I see this:

 ![Screenshot from 2022-03-11 09-42-02](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/49594f4836ba99044ef1a5386cd224cc74cb77a2.png)

NR 2.1.3

I export it and import it to the other machine and I see this:

 ![Screenshot from 2022-03-11 09-45-07](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/0/70320c1c5ef1392c90a1049dda4dc7d90571988f.png)

I select/tick the `replace` and it is replaced.

Good.

But then I find an ever newer one.

I won't update it to the intermediate version. I'll just go for an update from the start.

 ![Screenshot from 2022-03-11 09-46-49](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/1/218da06b21e1af2d6918b6f8b75c5abb6b9ee493.png)

No option to `replace`.

Sorry, but what am I missing?

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [10 March 2022 23:43 UTC](https://discourse.nodered.org/t/subflows-and-import-not-always-working-the-same/59684/2 "2022-03-10T23:43:38Z")

</div>

It could be that at some point you imported a copy, so the Subflow has a new `id` - which means when you import a new version with the original `id`, it doesn't know its a new version so doesn't think there is anything to replace.

On each Node-RED, select an instance of the subflow you are working with, hit Ctrl-E to open the export dialog. Switch to the JSON tab of the dialog. Assuming you only had the subflow instance node selected, then the first entry in the JSON will be the subflow node. Make a note of the `id` value:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/2/e2bb9d5b0f71a90787e2bd6247e7d08f7cf69b3c.png)

Share the results here - does each Node-RED instance have the same `id` for the subflow in question? Are they all different? Or a mix?

---

<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: [10 March 2022 23:51 UTC](https://discourse.nodered.org/t/subflows-and-import-not-always-working-the-same/59684/3 "2022-03-10T23:51:18Z")

</div>

I think that could be the cause.

(Alas what I have done in the mean time is updated the subflow the hard way and copied the code/instructions/etc between the machines.)

 ![Screenshot from 2022-03-11 10-48-47](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/1/01514b77a4b9202a51cf29ee44374a452583b58c.png)

 ![Screenshot from 2022-03-11 10-48-49](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/4/94493f9359ffe8713892e13cf7db0d5f45cc3075.png)

 ![Screenshot from 2022-03-11 10-48-51](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/a/0ab7c0c34686558acf319a11f526b56dcbb88ffb.png)

(Side question: All screen shots done on same machine. Why is it that 2 of the 3 are ghosted text?)

Though more importantly to the original thing: How do I make them the same _number_?

---

<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: [9 May 2022 23:52 UTC](https://discourse.nodered.org/t/subflows-and-import-not-always-working-the-same/59684/4 "2022-05-09T23:52:13Z")

</div>

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