Skip to main content
Community site session details

Community site session details

Session Id : KkDXA/uECmhtuvR36u/QAe
Power Automate - Power Automate Desktop
Unanswered

Common sub-flows usable by multiple flows?

Like (0) ShareShare
ReportReport
Posted on 13 May 2022 16:25:32 by 225

Is it possible to have a set of common sub-flows that every flow would have access to? I'm thinking of a sub-flow that logs into a web site, which might be needed by many flows. In the free version of Power Automate, it appears that the sub-flows are limited to one flow. If true, this would be a major problem to using this tool extensively.

Categories:
  • LogicSmith Profile Picture
    225 on 17 May 2022 at 12:38:59
    Re: Common sub-flows usable by multiple flows?

    I like your solution, but in my case the base URL is all I need to find the browser window, doesn't seem to matter if the actual full URL is different at the end. I'm still learning, so it's fun. Today's task is to modify my login flow to pass in url, username, password, and browser. So I get to learn how to do a case statement on the browser.  Then adapt the case statement into every flow so everything hooks together. Piece of cake. Large piece, but may be able to finish it today.

     

  • MichaelAnnis Profile Picture
    5,721 Moderator on 16 May 2022 at 21:29:29
    Re: Common sub-flows usable by multiple flows?

    Dang, that sucks.  I hadn't ever used it before, but just tried to troubleshoot this.  At least, you can set an outputvariable to the URL which can be retrieved by the flow and set as an output variable.  And then call the URL during "Attach to Chrome", so that you don't have to set those up individually:

     

    So, my login flow (the child flow) used a "Get details of web page" action just before it's conclusion and passes the %OutputURL% to the parent flow which then used %OutputURL% to attach to chrome and get the security question.

    MichaelAnnis_1-1652736551190.png

     

    MichaelAnnis_0-1652736529663.png

    Although this isn't ideal.  It gives you a blanket way to set all output URLs to the same variable and call those OutputURLs the same way.  So flow Parent Flow A doesn't need the specific Child Flow A URL, but rather the blanket %OutputURL% every single time.

  • LogicSmith Profile Picture
    225 on 16 May 2022 at 20:30:00
    Re: Common sub-flows usable by multiple flows?

    I have not yet found a way. The only output variable type is a string. I may be able to convert a browser object instance into a JSON string, but don't know that I can convert that string back into a browser instance. The workaround is to open the browser in the flow that does the login, then in any other subsequent flow, set the browser open to attach to the browser instead (it helps that all the URLs start the same). Takes it a few seconds to find and attach to the browser, but that's not a major problem right now.

  • MichaelAnnis Profile Picture
    5,721 Moderator on 16 May 2022 at 20:25:50
    Re: Common sub-flows usable by multiple flows?

    Are you saying you can't pass a Browser Instance back from the child flow?

  • LogicSmith Profile Picture
    225 on 16 May 2022 at 20:17:58
    Re: Common sub-flows usable by multiple flows?

    Yes, got past that point. Now only issue (that I've hit) is the inability to pass anything to a flow besides a string. Would love to have a flow that logs into browser and app, but cannot return the browser instance. Found a way to workaround by having every flow look for the browser, but that can get complicated if you want one test to run on more than one browser.

     

  • MichaelAnnis Profile Picture
    5,721 Moderator on 16 May 2022 at 19:36:22
    Re: Common sub-flows usable by multiple flows?

    Yeah, this is difficult.  There are no groups; you just have the one text string.  So, I recommend normalizing your text strings to be systematic, for whatever works for you.  Example would be flow titles.  Maybe I have flows for logging into each of my bank accounts and can use a Who_What_Where system for creating my flow titles:

     

    Mike_Login_Chase
    Mike_Login_BofA
    etc.

     

    Good luck!

  • LogicSmith Profile Picture
    225 on 16 May 2022 at 14:52:22
    Re: Common sub-flows usable by multiple flows?

    OK, this works great. Now, followup question. What happens when I accumulate hundreds of desktop subflows? It's similar to the UI Elements - what happens when I have hundreds of them? I am accumulating suggestions and certainly beefing up how it handles flow and UI element management is high on the list.

  • LogicSmith Profile Picture
    225 on 13 May 2022 at 18:11:35
    Re: Common sub-flows usable by multiple flows?

    That should take care of it, thanks! I just started using PA a few weeks ago, and obviously missed that particular action. At least I'm early enough in the process I can make major design mods if I need to. 

  • MichaelAnnis Profile Picture
    5,721 Moderator on 13 May 2022 at 16:44:25
    Re: Common sub-flows usable by multiple flows?

    What about "Run Desktop Flow"?

     

    So, your subflow could be by itself in a Run Desktop Flow which can take input variables and produce output variables and you could direct your new flow to run the desktop flow containing 1 or multiple subflows.

     

    MichaelAnnis_0-1652460241164.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete