# Dynamic Subflow abstraction

**URL:** <https://discourse.nodered.org/t/dynamic-subflow-abstraction/64011>\
**Category:** General\
**Created:** [16 June 2022 10:56 UTC](https://discourse.nodered.org/t/dynamic-subflow-abstraction/64011 "2022-06-16T10:56:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Backboard7880](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@Backboard7880](https://discourse.nodered.org/u/Backboard7880)\
**Post date:** [16 June 2022 10:56 UTC](https://discourse.nodered.org/t/dynamic-subflow-abstraction/64011/1 "2022-06-16T10:56:57Z")

</div>

Hi,  
Would it be possible to have a custom node which takes a Subflow name as a "topic" and then dynamically instanciate the corresponding Subflow and passes the payload to it?

The solution im looking would abstract the Switch Node and the Subflows linked to it.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/2/e2e0274dd9ffbec6344ee5367d549d34b14981a4.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [16 June 2022 10:58 UTC](https://discourse.nodered.org/t/dynamic-subflow-abstraction/64011/2 "2022-06-16T10:58:37Z")

</div>

Maybe look at the recent link call capability being added to link nodes (rather than sub flow)

---

<div class="post-metadata">

**Author:** ![Backboard7880](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@Backboard7880](https://discourse.nodered.org/u/Backboard7880)\
**Post date:** [16 June 2022 11:10 UTC](https://discourse.nodered.org/t/dynamic-subflow-abstraction/64011/3 "2022-06-16T11:10:31Z")

</div>

Hi @dceejay here is a scenario:  
Post request is received the payload indicates what subflow needs to run and the input data to provide.  
The solution im looking for would dynamically pick and execute the required subflow.

Would the solution be feasible?  
My example shows 3 subflows when im dealing with 50+. Having the ability to abstract that would make the set up easier.

Are you saying that if I use flows instead and link nodes there is a way to dynamically link to a certain flow?

---

<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:** [16 June 2022 11:27 UTC](https://discourse.nodered.org/t/dynamic-subflow-abstraction/64011/4 "2022-06-16T11:27:30Z")

</div>

This is definitely possible with the new dynamic capabilities of link call in node red version 3. Version 3 is currently in beta but you can test it out. The final release of V3 is only a matter of weeks away.

---

<div class="post-metadata">

**Author:** ![Backboard7880](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@Backboard7880](https://discourse.nodered.org/u/Backboard7880)\
**Post date:** [16 June 2022 11:38 UTC](https://discourse.nodered.org/t/dynamic-subflow-abstraction/64011/5 "2022-06-16T11:38:39Z")

</div>

Thanks I'll check it 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:** [30 June 2022 11:39 UTC](https://discourse.nodered.org/t/dynamic-subflow-abstraction/64011/6 "2022-06-30T11:39:10Z")

</div>

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