# Delete in-use subflow doesn't warn, and how to find subflow uses

**URL:** <https://discourse.nodered.org/t/delete-in-use-subflow-doesnt-warn-and-how-to-find-subflow-uses/39793>\
**Category:** General\
**Created:** [26 January 2021 16:18 UTC](https://discourse.nodered.org/t/delete-in-use-subflow-doesnt-warn-and-how-to-find-subflow-uses/39793 "2021-01-26T16:18:00Z")\
**Posts on this page:** 10\
**Page:** 1

<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:** [26 January 2021 16:18 UTC](https://discourse.nodered.org/t/delete-in-use-subflow-doesnt-warn-and-how-to-find-subflow-uses/39793/1 "2021-01-26T16:18:01Z")

</div>

Two related issues:

1. If I delete a subflow that is currently in use there is no warning, all instances of it just disappear. Is that expected?

2. Is there a way of finding all instances of a subflow? Searching for the subflow name doesn't do it (if the instance is given a different name).

NR version 1.2.7

---

<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:** [26 January 2021 16:25 UTC](https://discourse.nodered.org/t/delete-in-use-subflow-doesnt-warn-and-how-to-find-subflow-uses/39793/2 "2021-01-26T16:25:06Z")

</div>

> [@Colin](#):
>
> Is that expected?

Yes it is expected, but probably not desirable and there ought to be a wanring.

> [@Colin](#):
>
> Is there a way of finding all instances of a subflow

Yes, although its a bit of a handful and we ought to make it easier to do. If you know the ID of the subflow, you can search for that and both the subflow and all its instances will be found.

---

<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:** [26 January 2021 16:49 UTC](https://discourse.nodered.org/t/delete-in-use-subflow-doesnt-warn-and-how-to-find-subflow-uses/39793/3 "2021-01-26T16:49:27Z")

</div>

> [@knolleary](#):
>
> Yes it is expected, but probably not desirable and there ought to be a wanring.

Well _I_ didn't expect it 🙂  
[_Nobody_ expects ...]  
Should I submit an issue so it doesn't get forgotten? It isn't very user friendly as it is, because after deleting the subflow it may not be immediately obvious that anything is wrong. Luckily I had committed it just before so was easily able to recover the situation, once I realised that I had a problem.

> [@knolleary](#):
>
> If you know the ID of the subflow, you can search for that

OK, thanks.

---

<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:** [26 January 2021 17:33 UTC](https://discourse.nodered.org/t/delete-in-use-subflow-doesnt-warn-and-how-to-find-subflow-uses/39793/4 "2021-01-26T17:33:35Z")

</div>

Have added [this item](https://trello.com/c/6skQxaQb) to the backlog

---

<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:** [26 January 2021 17:41 UTC](https://discourse.nodered.org/t/delete-in-use-subflow-doesnt-warn-and-how-to-find-subflow-uses/39793/5 "2021-01-26T17:41:32Z")

</div>

Should there be one for searching for subflow instances too?

---

<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:** [26 January 2021 17:42 UTC](https://discourse.nodered.org/t/delete-in-use-subflow-doesnt-warn-and-how-to-find-subflow-uses/39793/6 "2021-01-26T17:42:29Z")

</div>

Yup - added [here](https://trello.com/c/PLvlLSGT)

---

<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:** [28 January 2021 00:49 UTC](https://discourse.nodered.org/t/delete-in-use-subflow-doesnt-warn-and-how-to-find-subflow-uses/39793/7 "2021-01-28T00:49:37Z")

</div>

@Colin for the "how to find subflow instances" question, I've just raised [this pull-request](https://github.com/node-red/node-red/pull/2839) that adds two new ways to easily locate a subflow's instances. Let me know what you think.

---

<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:** [28 January 2021 23:13 UTC](https://discourse.nodered.org/t/delete-in-use-subflow-doesnt-warn-and-how-to-find-subflow-uses/39793/8 "2021-01-28T23:13:00Z")

</div>

And here's a PR that adds a confirmation dialog when trying to delete an in-use subflow.

> <https://github.com/node-red/node-red/pull/2845>

---

<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:** [29 January 2021 10:09 UTC](https://discourse.nodered.org/t/delete-in-use-subflow-doesnt-warn-and-how-to-find-subflow-uses/39793/9 "2021-01-29T10:09:12Z")

</div>

Great, thanks.  
I have realised that it is very easy to find the id of a subflow, for searching. Hovering over the subflow node in the side panel shows the id, then you just have to search for the last few characters of that. Soon even that won't be necessary though 🙂

---

<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:** [30 March 2021 10:09 UTC](https://discourse.nodered.org/t/delete-in-use-subflow-doesnt-warn-and-how-to-find-subflow-uses/39793/10 "2021-03-30T10:09:26Z")

</div>

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