cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sperry1625
Solution Supplier
Solution Supplier

Parallel Branches

I need help.  I have a flow that does an approval with reminders. It does this with Parallel paths. One track does the approvals the other does the reminders.

Approval Path

sperry1625_0-1624119795747.png

Basic approval path. When the Wait finishes, depending on why, it sets a variable to the outcome.  This tells the Reminder path that the approval is done and to exit.

Reminder Path

sperry1625_1-1624120000514.png

Reminder is a little more complicated.  It has two Do until loops, that outer loop is for days, 30 days. It times out after 30 days and only checks the condition, at most, once a day. The inner loop is for the actual reminder duration.  That counts minutes. The loop runs until (Duration Days * 1440). It has a 5 minute delay at which time is then checks if the Approval Wait exited, by checking the variable set on the Approval Path. The inner loop exits when the Minutes has passed. When it exits the loop it increments the day count by the duration days and starts over.

What we are seeing is the approval will finish and the reminder loop never stops, it seams to hang. When we open a running flow we can't even open the Do until loop to see what it is doing.

NOTE: For testing, we reduced the loop from 5 minutes to 5 seconds.

 

Thanks.

Regards,

-S

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

4 REPLIES 4
Pstork1
Dual Super User
Dual Super User

Its hard to read the screenshots, but here is what I think is happening because I've seen it in this scenario before.  The DoUntil loops will continue to run until the delays are processed or the timeout expires.  So make sure that your overall delay has a way to get out before the total time is completed.  For example, I want to send a reminder every 7 days until the approval is complete or 30 days is reached.  If you have a 7 day delay in that loop then even after the approval is complete it will wait til the end of 7 days to decide it doesn't need to send the reminder anymore and stop.  The way to fix this is to have a shorter delay with a counter.  So for 7 days the delay is set for one hour.  At the end of the hour we check to see if 168 hours have passed (7 days X 24 hours) if not we delay another hour.  When the approval is completed we set the hours counter to 168 so the loop will exit in one hour or less, not 7 days.  Here's an example

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

What you are suggesting I am already doing.  I am getting inconsistent results. Sometimes it appears as though the Flow just hangs in the reminder loop, but eventually times out.  I cannot get consistent tests run.  I know that for an Apply to Each loop there is a concurrency setting that you can change but there is no such setting for the While loops, I find that odd. Are there things I should not be doing inside a While loop? Currently I update variables and when appropriate send an email and update a SharePoint item.

 

Thanks.

Regards,

-S

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

updating variables, sending emails and updating SharePoint items are all fine while in a loop.  Not sure why you are having issues without a detailed look at the loop.  If you'll provide a higher resolution screenshot I'll try to help figure out what is going wrong.  But the screenshot you've provided so far is too fuzzy to make out the details.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

I just did a bit of restructuring, I will see if it helps.  If not I will post a better screen shot.

 

Thank you.

Regards,

-S

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,526)