# Exporting and Importing flows - problem with SUBFLOWS

**URL:** https://discourse.nodered.org/t/exporting-and-importing-flows-problem-with-subflows/24194
**Category:** General
**Created:** [3 April 2020 23:18 UTC](https://discourse.nodered.org/t/exporting-and-importing-flows-problem-with-subflows/24194 "2020-04-03T23:18:46Z")
**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: [3 April 2020 23:18 UTC](https://discourse.nodered.org/t/exporting-and-importing-flows-problem-with-subflows/24194/1 "2020-04-03T23:18:46Z")

</div>

If I write a _flow_ and export it then import it to another machine, all the existing nodes are honoured and not overwritten.

Alas I have seen that if you write a subflow and export a flow with it then import it to another machine which already has that subflow, a second (or third, etc) copy of the subflow is created.

Just asking:  
Why?

I get that subflows can be different between machines. Though I can't exactly see why.  
They are like nodes.  
If you have a different version of NR on one machine to another when you copy flows, they don't take their _most up to date_ (or older) nodes with them.

If the two (sub)flows are different, then maybe make another _version_ of it on the second machine.

Otherwise, I can't see why it is creating a copy.

---

<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: [17 April 2020 00:09 UTC](https://discourse.nodered.org/t/exporting-and-importing-flows-problem-with-subflows/24194/2 "2020-04-17T00:09:17Z")

</div>

To be as direct as possible: it does that because no one has written the code to detect the existing subflow and avoid adding a duplicate.

There is an item on the backlog to improve this behaviour.

---

<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: [17 April 2020 00:14 UTC](https://discourse.nodered.org/t/exporting-and-importing-flows-problem-with-subflows/24194/3 "2020-04-17T00:14:07Z")

</div>

Thanks.

I don't mind directness. (Or I hope I don't)

No problems. It slipped through the gaps - no one is perfect.

I just have to be careful when exporting flows with subflows in them.

---

<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 June 2020 00:21 UTC](https://discourse.nodered.org/t/exporting-and-importing-flows-problem-with-subflows/24194/4 "2020-06-16T00:21:40Z")

</div>

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