Share via


How to rerun multiple failed runs of logic app at once

Question

Friday, April 20, 2018 3:55 AM

Hi Team,

How to rerun multiple failed runs of logic app at once. Thru OMS I found but its working for one week data only .

Thanks & Regards,

VJ

VJ

All replies (5)

Friday, April 27, 2018 4:59 PM âś…Answered | 1 vote

"Run After" configuration is disabled because the INSERT action is the first action right after your trigger. You'd want to use the Run After on your "Mark as Read" action and account for the failure scenario from your INSERT action.


Thursday, April 26, 2018 9:48 PM

Hi VJ,

Could you elaborate more on "Thru OMS I found but..." part? Also, could you clarify if you have one sequential flow of LA vs actions that run in parallel?

Moreover, it would help us help you better if you share with us the kind of setup you have and describe more on exactly what you're trying to accomplish on a higher level. 

You could post the Workflow Definition language sample of your LA or the screenshot of the Designer View too. There may be different ways to go about handling failures depending on your unique setup. In most cases, you should be able to utilize "Conditional constructs" (if, else, switch etc..) and/or the "Run After" configuration to handle error scenarios and take subsequent actions that mitigate those errors.


Friday, April 27, 2018 12:09 AM

Hi Mike,

I have created a logic app with the below flow initially. sometimes its failing with gateway / access issues.

my logic app runs every 1 minute. during that time flow ~ 100 emails.

last week 3 days it got failed total count is ~ 10k. I want to rerun all the logic apps.

Now I am trying below flow to alert us. 

Here I am checking insert output body does not contains 'status'   (i.e. coalesce(body('Insert'),'body')) 

do the below action. I don't know whether this coalesce will work or not to get the status in output body of Insert action. (i.e. If it fails only status field is appearing in output.)

VJ


Friday, April 27, 2018 6:53 AM

Hey VJ - thanks for the screenshots, they're helpful!

Here are my thoughts and a few more follow up questions:

  • It seems to me that the main issue/error that causes the failure in your LA flow is the intermittent gateway/access issues you mentioned above that are occurring on your Insert Action. Could you provide more details on that? What is the error message?
  • It also looks like your trigger is an event based trigger (when an email is received...) and not a recurrence based trigger. So when you say your LA runs every 1 min and processes approximately 100 emails, is it just by your rough estimate and calculation?

If my assumptions are correct, you're receiving new emails at a pretty high volume (~100/1min) and attempting to do INSERT operation on SQL Server for each new email. This could translate into ~100 connection requests to your database followed up by their respective INSERT operations in ~1min which could potentially overload your SQL Server instance, therefore, causing intermittent connection issues.

Instead, you may want to consider processing your emails in batches on recurrent basis (i.e. run every 2hrs and process all new email received in the past 2hrs etc..)
As you may have seen on the LA Docs, Logic Apps provides Loop construct that you can use to iterate over your emails as well as SQL Server connector that provides stored procedures for implementing batch insert operation.

As for your IF condition using coalesce function, I'm not sure if that will work. Same thing can be accomplished much more easily by using the "Run After" configuration as shown below:

 


Friday, April 27, 2018 7:05 AM

Hi Mike,

Thanks for the quick reply .

Assume if I add like below. ( i.e. mark as read action is failed it will send out an email.)

after insert action Run after is in disable state to implement the same.

VJ