# Question: How to clone a subflow?

**URL:** <https://discourse.nodered.org/t/question-how-to-clone-a-subflow/20436>\
**Category:** General\
**Created:** [16 January 2020 09:34 UTC](https://discourse.nodered.org/t/question-how-to-clone-a-subflow/20436 "2020-01-16T09:34:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [16 January 2020 09:34 UTC](https://discourse.nodered.org/t/question-how-to-clone-a-subflow/20436/1 "2020-01-16T09:34:36Z")

</div>

Hello,

I recently discovered my love to subflows as they are a very good compromise before rolling out a custom node. Thank you!

**But what I didn`t managed is to clone a subflow.**

In example I have a nicely configured subflow with parameters, icons, info docs and other things I often like to clone this a a base for a new one. Or I like to do some experiments on a working subflow before placing it back into the production flow. Or I decided later in the development to split a subflow into two because the original contains two functionalities that are more versatile if placed in two different subflows.

Copy paste generates as expected an instance but export import does an instance too. Any hint, perhaps i have to edit / delete an id in the exported json before re-importing it?

---

<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:** [16 January 2020 10:09 UTC](https://discourse.nodered.org/t/question-how-to-clone-a-subflow/20436/2 "2020-01-16T10:09:54Z")

</div>

Hi @Christian-Me

the current way to do it is:

1. select an instance of the subflow
2. export it to your clipboard
3. open the import dialog, paste in the flow json. Edit the `name` field of the subflow node (it'll be the first one in the json) to something unique. Then import.

The current duplicate detection in the import code assumes you don't want duplicates. Eventually there will be a prompt to ask what to do instead.

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [16 January 2020 10:44 UTC](https://discourse.nodered.org/t/question-how-to-clone-a-subflow/20436/3 "2020-01-16T10:44:35Z")

</div>

Precisely what I was looking for, thank you that helped me a lot.

---

<div class="post-metadata">

**Author:** ![paulkeates](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@paulkeates](https://discourse.nodered.org/u/paulkeates)\
**Post date:** [16 April 2022 19:54 UTC](https://discourse.nodered.org/t/question-how-to-clone-a-subflow/20436/4 "2022-04-16T19:54:56Z")

</div>

Hi,

These instructions work except that 'Group' and 'Group styling' attributes are not copied as well.

you can manually add the Group afterwards, including the title if needed. Once added, the easiest way is to copy the Group style from one that you prefer (CTRL-SHFT-c) and apply it to the new sub-flow (CTRL-SHFT-c).

Cheers,

Paul
