Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Flow takes a lot of time to process a simple condition

(0) ShareShare
ReportReport
Posted on by 65

I have a flow where I update a task when I receive an update from Azure DevOps. It used to work great but now, I noticed that I get a long time of processing on tasks that shouldn't take long. For instance, I have a condition where I determine if a workItem relation is a parent (reversed) one. The condition itself is:

@equals(items('Find_WorkItem_Parent')?['rel'], 'System.LinkTypes.Hierarchy-Reverse')

Just this condition takes about a minute to evaluate! I don't get it. Any idea anyone?

  • MJC Profile Picture
    on at
    Re: Flow takes a lot of time to process a simple condition

    I've come across this recently and thought I'd update here.  I found that a condition action which finds a value in an array using "Contains", even finding one value in a list of 2000 simple array elements, can take anywhere from 10 seconds to 10 minutes depending on how far through the array it is.

     

    Instead, if I use some select/compose magic to rebuild the array so that the item I want to search is a key value, then I can use compose to test if that key value is empty or present, and depending on the result, output 1 or 0.  Then, i can use an equals condition on the compose value, if equals 1, yes, else no.  This completes consistently in 1 second.

     

    I'll try to post more details later if anyone is interested.  But basically, avoid "contains" in a condition, and find a way to write a compose to evaluate to 1 or 0, and condition off that.

  • nicolasdb Profile Picture
    65 on at
    Re: Flow takes a lot of time to process a simple condition

    @jsenger Sure, look at the accepted solution 😁 Using compose helped a lot.

  • Jeroen J Profile Picture
    on at
    Re: Flow takes a lot of time to process a simple condition

    Same issue occurring here. Easy, straight forward condition (field ne 3) that can take up to minutes. In the same instance other conditions take way too long too, while this flow usually runs within a few hundred milliseconds.

    @nicolasdb ever found a solution?

  • jsenger Profile Picture
    4 on at
    Re: Flow takes a lot of time to process a simple condition

    Hello - I am also coming across this same problem. The condition I have is taking > 1hr to supposedly execute a single contains() function.

     

    Has anyone found a root cause/resolution for this?

  • chico Profile Picture
    636 on at
    Re: Flow takes a lot of time to process a simple condition

    I'm dealing with this myself now....
    trying to see if there is any difference/improvement in using a Switch or a Condition.

  • nicolasdb Profile Picture
    65 on at
    Re: Flow takes a lot of time to process a simple condition

    Anyone has an answer to my last post? I don't quite understand how a simple condition could take so much time to resolve. Here's another one:

     

    https://i.imgur.com/1oZOA4z.png

     

    How am I suppose to find where the problem is? I suspect the individual reported task time isn't reliable and that my problem might lie in an http request or, that my whole Flow process gets jammed at some point and thus ending taking so much time to complete. Any idea?

  • nicolasdb Profile Picture
    65 on at
    Re: Flow takes a lot of time to process a simple condition

    Another update! I tough everything was fine but I got another situation, even using mostly Compose actions instead of variables. The only variable I use is a list in read only for my Apply to Each.

     

    Clipboard - 26 septembre 2019 11_15.png

    And here is the code in the "If may be applied" condition:

    and(
     or(
     equals(outputs('LastTimeCampEntryID'), 0),
     greater(int(items('Apply_to_each')['id']), outputs('LastTimeCampEntryID'))
     ),
     or(
     equals(body('WorkItem_JSON')?['fields']?['Custom.TimeCampAppliedEntryIDs'], null),
     not(contains(body('WorkItem_JSON')?['fields']?['Custom.TimeCampAppliedEntryIDs'], string(items('Apply_to_each')['id'])))
     )
    )

    Nothing special, really. Any idea anyone? It's like the process is suspended for a while and then resumes whatever it was doing. It's weird.

  • Verified answer
    nicolasdb Profile Picture
    65 on at
    Re: Flow takes a lot of time to process a simple condition

    An update on my situation. I completely modified my flow to use Compose instead of variables and got execution time down to a few seconds instead of many minutes overall. I kept variables for clarity for general settings for my flow but not for variable data.

     

    Thanks all!

  • nicolasdb Profile Picture
    65 on at
    Re: Flow takes a lot of time to process a simple condition

    Maybe that explains. I found another example where there is some processing after the evaluation of a condition:

     

    Annotation 2019-09-20 084505.png

    The evaluated condition looks like this:

    @Or(and(and(equals(body('Parent_WorkItem_Details')?['fields']?['System.WorkItemType'], 'Projet'),
    	not(contains(body('Parent_WorkItem_Details')?['fields'],'AgileDev.AcombaProjectID'))),
    	not(or(equals(body('Parent_WorkItem_Details')?['fields']?['System.State'], 'Closed'),
    	equals(body('Parent_WorkItem_Details')?['fields']?['System.State'], 'Removed')))),
    	and(equals(body('Parent_WorkItem_Details')?['fields']?['System.WorkItemType'], 'Client'),
    	not(equals(body('Parent_WorkItem_Details')?['id'], '217'))))

    So it's similar and I don't quite understand why it takes so long to complete. After watching the video of John Liu I think I might be able to convert some variables to use compose instead but not all of them, not simply I mean. Complete rework of my logic and loops would need to be done for that...

  • RezaDorrani Profile Picture
    12,141 on at
    Re: Flow takes a lot of time to process a simple condition

    Hi @nicolasdb 

     

    Microsoft Flow and PowerApps have been slow today. So that could be one reason that your Flow has been taking time (assuming this was running fast earlier)

     

    the screenhsot shared shows a case which was false, did you check and see the true case and how long the actions take then

    The GetParentWorkItem might be the one taking time to respond 

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

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

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!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Featured topics

Restore a deleted flow