# Export/Edit/Import a flow containing a subflow, I am ending up with multiple copies of subflow with auto renamed

**URL:** https://discourse.nodered.org/t/export-edit-import-a-flow-containing-a-subflow-i-am-ending-up-with-multiple-copies-of-subflow-with-auto-renamed/98913
**Category:** General
**Tags:** subflow
**Created:** [2 September 2025 12:09 UTC](https://discourse.nodered.org/t/export-edit-import-a-flow-containing-a-subflow-i-am-ending-up-with-multiple-copies-of-subflow-with-auto-renamed/98913 "2025-09-02T12:09:33Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)
#### Post date: [2 September 2025 12:09 UTC](https://discourse.nodered.org/t/export-edit-import-a-flow-containing-a-subflow-i-am-ending-up-with-multiple-copies-of-subflow-with-auto-renamed/98913/1 "2025-09-02T12:09:33Z")

</div>

I had a small flow with subflow in it, I copied and pasted multiple bits and ended up having a huge duplicates of subflow, what is the correct way ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/7/d70d61cc6e901fd0bad1414340bd47cfd110201c.png)

i followed this discussion which seems to be similar , but i could not understnad much.

> [@Why does importing a clipboard with a subflow create a "new" identical but renamed subflow](https://discourse.nodered.org/t/why-does-importing-a-clipboard-with-a-subflow-create-a-new-identical-but-renamed-subflow/15668):
>
> Edit: Now that I know the behavior I observe is inherent to Node-RED, I reposted this over on the feature requests: [Import a flow containing a subflow without unintentionally creating a duplicate subflow](https://discourse.nodered.org/t/import-a-flow-containing-a-subflow-without-unintentionally-creating-a-duplicate-subflow/15683) I need to copy/paste a flow that contains a subflow. However, when I do this, nodered creates an identical subflow but appends (2) or (3) or (4), etc. to the end of the subflow name. So far I determined a very basic test subflow does not behave like this, but once I include an mqtt node, I …

---

<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: [2 September 2025 12:12 UTC](https://discourse.nodered.org/t/export-edit-import-a-flow-containing-a-subflow-i-am-ending-up-with-multiple-copies-of-subflow-with-auto-renamed/98913/2 "2025-09-02T12:12:48Z")

</div>

> [@smanjunath211](#):
>
> i followed this discussion which seems to be similar , but i could not understnad much.

Which one?

---

<div class="post-metadata">

### Author: ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)
#### Post date: [2 September 2025 12:16 UTC](https://discourse.nodered.org/t/export-edit-import-a-flow-containing-a-subflow-i-am-ending-up-with-multiple-copies-of-subflow-with-auto-renamed/98913/3 "2025-09-02T12:16:31Z")

</div>

OOps, forgot to paste. edited the main post.

---

<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: [2 September 2025 12:28 UTC](https://discourse.nodered.org/t/export-edit-import-a-flow-containing-a-subflow-i-am-ending-up-with-multiple-copies-of-subflow-with-auto-renamed/98913/4 "2025-09-02T12:28:44Z")

</div>

> [@smanjunath211](#):
>
> I copied and pasted multiple bits

Do you mean copy/paste or Export/Import?

---

<div class="post-metadata">

### Author: ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)
#### Post date: [2 September 2025 12:54 UTC](https://discourse.nodered.org/t/export-edit-import-a-flow-containing-a-subflow-i-am-ending-up-with-multiple-copies-of-subflow-with-auto-renamed/98913/5 "2025-09-02T12:54:55Z")

</div>

Sorry, my post was not complete. apologies.

It is indeed export and import back, BUT with editing in notepad.  
so i have 25 machines for which i made a small flow whcih included a subflow, i needed 24 copies of these each for an hour on clock. (complex story, which can be simplified, subject for another topic), i assumed exporting one block and changing the values in the change node to replace 00 with 01, etc for 24 times, made a quick alternate for copy paste since i need to change each change node for 25 machines for every hour.  
it did work, as i expected (well) except for the duplicate copies of the subflow. and i cannot delete them because they are referred to in some of the flows.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b8374149157b072d6876dbda20d0c021342dcd6d.png)

repeat this 24 times one for each hour.

---

<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: [2 September 2025 13:04 UTC](https://discourse.nodered.org/t/export-edit-import-a-flow-containing-a-subflow-i-am-ending-up-with-multiple-copies-of-subflow-with-auto-renamed/98913/6 "2025-09-02T13:04:01Z")

</div>

If you `import` with a `subflow` NR should detect the existence of it and ask you to either `replace` or.... _something else_.... (Can't remember)

So making _copies_ of it shouldn't happen. They should be filtered at the NR level.

(BTW, versions?)  
NR,  
O/S,  
Node.js,  
Javascript,  
etc...

May help.

---

<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: [2 September 2025 13:05 UTC](https://discourse.nodered.org/t/export-edit-import-a-flow-containing-a-subflow-i-am-ending-up-with-multiple-copies-of-subflow-with-auto-renamed/98913/7 "2025-09-02T13:05:28Z")

</div>

Go back to your previous version (assuming that you are using some sort of version control/backup strategy) and start again, using Copy/Paste.

Also please edit the title of this thread and your initial description to say Import/Export, they are very different.

---

<div class="post-metadata">

### Author: ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)
#### Post date: [2 September 2025 14:52 UTC](https://discourse.nodered.org/t/export-edit-import-a-flow-containing-a-subflow-i-am-ending-up-with-multiple-copies-of-subflow-with-auto-renamed/98913/8 "2025-09-02T14:52:13Z")

</div>

> [@Colin](#):
>
> start again

Yes, I did that, and as i told, i have a repetetive task of changing the change node contents, i want to copy, but change the hour marker from H00 to H01 etc. i thought editing the json was easy after exporting and before importing. OR, i could only exclude the subflow bit of the flow, export , change the json , import and wire it manually. whcih is a tedious process again, but better than opening change node, editing the contents and save it.  
or may be there is a function node alternative, using a for next loop which may reduce my flow logic.

> [@Colin](#):
>
> Also please edit the title

done, thanks for pointing out.

---

<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: [16 September 2025 14:52 UTC](https://discourse.nodered.org/t/export-edit-import-a-flow-containing-a-subflow-i-am-ending-up-with-multiple-copies-of-subflow-with-auto-renamed/98913/9 "2025-09-16T14:52:42Z")

</div>

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