Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Same Flows Steps, Different Triggers. 7minutes V.S. 21 hours Durations

(0) ShareShare
ReportReport
Posted on by 45

Hello everyone, 

 

I have two identical flows:

  • Flow A: triggered by a PowerApps button
  • Flow B: triggered by a Schedule trigger. 

Run Duration :

  • Flow A: 6 to 7 minutes.
  • Flow B: 16 hours to +1d to fully run. 

 

Number of actions:

  • Flow A = Flow B = ~800 actions (They are identical)

 

This same flow when I was testing reached 25k actions, which throttled it down. As it was just a test, a few days later, I downloaded the solution, changed the flow IDs, and uploaded it again. Same issue: Flow A = 6min, Flow B = +16 hours;  

 

If I am still under the limit, why is this scheduled flow taking so long to run? Why not both of them if the only change is the trigger?

I am the owner of the flow.

 

 

  • Verified answer
    MatheusAntunes Profile Picture
    45 on at
    Re: Same Flows Steps, Different Triggers. 7minutes V.S. 21 hours Durations

    I have found a solution to my own problem:

     

    My strategy was to create a child flow with the Schedule trigger and an action calling the child flow with the logic I wanted to be executed. It is not what I wanted, because I had to split the flow in two, but it worked as it should. 

     

    How to create and use a Child Flow: 

    1. Create your flow with the "Manually trigger a flow" trigger. This will be your Child Flow. 
      • MatheusAntunes_0-1650210202591.png

         

      • At the end of your child flow add the action "Respond to a PowerApp or Flow".
      • MatheusAntunes_1-1650210306734.png
    2. Now create your main flow and add your trigger. In my case, I used the Recurrence Trigger. Also, add the action to call your child flow, and don't forget to reference the child flow inside the action. 

      •  

        MatheusAntunes_2-1650210645188.png
    3. Go back to the child flow details screen (Location where you can see all your run logs). In there you will see a section on the right side of the screen called "Run only users". Click on edit. 
      • MatheusAntunes_3-1650210794868.png

         

      • In the "Connections Used" section, select "Use this connection (your_email@yourbusiness.com)." Here you will specify with what credential you will be running this child flow. In my case, I want it to run using my credentials. 
      • MatheusAntunes_4-1650210998010.png

         

     

  • MatheusAntunes Profile Picture
    45 on at
    Re: Same Flows Steps, Different Triggers. 7minutes V.S. 21 hours Durations

    Exactly, @Pstork1 . Weird behavior. I am working on a different flow to do the same job, but I am still not confident this would solve my issue. Even after assigning a new GUID to the flow, I was still being throttled for some reason. Limit? I doubt it. As you mentioned, it is the same context as only I would be running the flow. 

  • Pstork1 Profile Picture
    65,997 Most Valuable Professional on at
    Re: Same Flows Steps, Different Triggers. 7minutes V.S. 21 hours Durations

    You are correct that the Power Apps flow will run in the context of the person who is running Power apps.  But in this case its the owner of the flow testing the app.  So its the same person and the same context.  When it goes into production that would account for the difference.  But not when one person is writing everything and testing it.

  • okeks Profile Picture
    802 Super User 2024 Season 1 on at
    Re: Same Flows Steps, Different Triggers. 7minutes V.S. 21 hours Durations

    Which plan does it say for Flow B?

     

    okeks_0-1649777337584.png

     

  • Pstork1 Profile Picture
    65,997 Most Valuable Professional on at
    Re: Same Flows Steps, Different Triggers. 7minutes V.S. 21 hours Durations

    @okeks is correct, unless in testing you are the one starting the flow in Power Apps.  That is what I am assuming.

     

    I don't see anything that would suggest why the recurrence flow is running so slow.  Could it be that its running at a different time of day?  In other words the Power Apps flow is running during working hours and the recurrence flow starts overnight.  

     

    But I do have a suggestion.  One of the things that really slows down flows is using variables for storage in an Apply to Each loop.  The problem is that every time you set the variable it needs to get a lock and that ruins any chance of using concurrency.  I had a flow that ran 9+ hours with variables.  When I switched it to Compose statements it dropped to 15 minutes.

  • MatheusAntunes Profile Picture
    45 on at
    Re: Same Flows Steps, Different Triggers. 7minutes V.S. 21 hours Durations

    @okeks Agreed. But the flow owner is me. When I run it by using the PowerApp trigger I am the user actioning the flow. For the automated version of the flow, I am the owner of it as well. 

     

    For other users, the manual version is also running in 6 min. 

  • MatheusAntunes Profile Picture
    45 on at
    Re: Same Flows Steps, Different Triggers. 7minutes V.S. 21 hours Durations

    Hello @Pstork1 , thank you for your help. 

     

    I have three parallel Apply to Each action that takes 99% of the time for both flows. 

    - For Flow A (6min): All 6 minutes are on these three Apply to Each actions. 

    - For Flow B (+20 hours): All the hours spent also are on these three Apply to Each actions.

     

    Unfortunately, after I deleted the solution and re-imported it with a new flow GUID, I lost the successful log.
    This a sample of parallel main loops I created. 

    MatheusAntunes_0-1649775915031.png

     

    Goal: 

    - Import all excel files in another SharePoint dynamic folder structure and load them into their respective locations. 

    Example: 

    - Every day a new folder structure will be generated with this info (RegionABC/2022/04/12/02 **Hour**). Within this folder will have several excel files that are being imported. 

     

    Each Main Loop was balanced with similar workloads, so they pretty much finish at the same time.

    The logic is the same, but the Duration is dramatically different. 

     

    I've read about concurrency control, but I am afraid to use it and the data be mixed in the process of getting content and creating a new file at the desired directory. 

     

    Answering your question, I own both flows, and all connections are on my account. The manual flow other people can run, but the time is the same (6 min). So the issue is not related to any other user. 

     

  • okeks Profile Picture
    802 Super User 2024 Season 1 on at
    Re: Same Flows Steps, Different Triggers. 7minutes V.S. 21 hours Durations

    The difference is that the PowerApps trigger uses the license of the user who actually triggered the flow and the Recurrence trigger uses the license of the flow owner.

  • Pstork1 Profile Picture
    65,997 Most Valuable Professional on at
    Re: Same Flows Steps, Different Triggers. 7minutes V.S. 21 hours Durations

    Have you looked at sample runs from both flows?  Each action will show how long that individual action took.  Figuring out if the whole flow was slower or whether some specific action was causing a bottleneck will help.  But I don't see anything in particular about a different trigger that should have that kind of effect.  Is the flow running in the same person's security context each time?  

  • MatheusAntunes Profile Picture
    45 on at
    Re: Same Flows Steps, Different Triggers. 7minutes V.S. 21 hours Durations

    @ScottShearer @Pstork1 Help! 😞

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,635 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow