# Sub flows..... Dumb question

**URL:** https://discourse.nodered.org/t/sub-flows-dumb-question/12847
**Category:** General
**Created:** [3 July 2019 06:13 UTC](https://discourse.nodered.org/t/sub-flows-dumb-question/12847 "2019-07-03T06:13:22Z")
**Posts on this page:** 8
**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 July 2019 06:13 UTC](https://discourse.nodered.org/t/sub-flows-dumb-question/12847/1 "2019-07-03T06:13:22Z")

</div>

I have started using sub-flows and it is great.

My understanding is that I have a flow and because parts of it are repeated, rather than have the same nodes repeated, I can use a sub-flow and it acts like a "sub-routine" (from basic).

Yeah, as many of you may know: I'm not the best coder, and I have changed a couple of things in the sub-flow as I have found problems with their working/s.

To edit them I understand I can either double click on the icon and then "edit sub-flow" or double click on it from the left window.

Alas now I have 6 versions in the list.

![Screenshot%20from%202019-07-03%2016-11-17](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e3d2d50587dc23c56290ba72fa6cf2e597f0ee1c.png)

I get that I am using multiple occurrences of them, but that's the whole idea - isn't it?

What have I done "wrong"?

---

<div class="post-metadata">

### Author: ![michaelblight](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/michaelblight/32/445_2.png) [@michaelblight](https://discourse.nodered.org/u/michaelblight)
#### Post date: [3 July 2019 06:35 UTC](https://discourse.nodered.org/t/sub-flows-dumb-question/12847/2 "2019-07-03T06:35:14Z")

</div>

Yeah something is going wrong. I've always double-clicked the sub-flow in the flow and then clicked "edit sub-flow". Then I make changes and click "Save". I've never ended up with multiple versions, even though the sub-flow is used multiple times in flows. Can you detail the exact steps to the issue so others can replicate?

---

<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 July 2019 07:08 UTC](https://discourse.nodered.org/t/sub-flows-dumb-question/12847/3 "2019-07-03T07:08:20Z")

</div>

Alas I can't give an example of how I did it. I just noticed it today.

All the editing was done days ago.

Just on a thought: If the "nodes" aren't yet _wired up_ would that cause this to happen?

I'll do some testing here on another machine. Testing on the machine shown, `DEPLOY` takes about 4 minutes.

---

<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: [3 July 2019 07:43 UTC](https://discourse.nodered.org/t/sub-flows-dumb-question/12847/4 "2019-07-03T07:43:22Z")

</div>

That looks like you have imported a flow into the editor that includes the subflow... Which results in a copy of the subflow being added to the palette.

We have an item on the backlog to handle that better by detecting that you are importing a subflow you already have and then offering to either update the existing subflow, or add a copy.

---

<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 July 2019 07:48 UTC](https://discourse.nodered.org/t/sub-flows-dumb-question/12847/5 "2019-07-03T07:48:16Z")

</div>

Thanks. It isn't urgent.

Is there anything I can do to remove the extra entries?

---

<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: [3 July 2019 07:49 UTC](https://discourse.nodered.org/t/sub-flows-dumb-question/12847/6 "2019-07-03T07:49:01Z")

</div>

Delete them.

Double click it, press delete button

---

<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 July 2019 07:50 UTC](https://discourse.nodered.org/t/sub-flows-dumb-question/12847/7 "2019-07-03T07:50:04Z")

</div>

Mia Culpa.

Thanks Steve.

---

<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: [3 July 2019 08:47 UTC](https://discourse.nodered.org/t/sub-flows-dumb-question/12847/8 "2019-07-03T08:47:10Z")

</div>

You might want to check where they are used first, so you can replace them with the other version. Assuming they are used.
