Retry whole sequence with error handler

Hi guys,

I am trying to create a global error handler but instead of just retry the failed action I want to retry the whole sequence how can I do this?

Hi,

You can do that by creating retry flowchart

  1. Create int variable RetryVar assign it to 0

  2. Use If Decision activity to Check if RetryVar<3, (you can keep any number instead of 3, basically the number you want to repeat your sequence)

  3. In True part Create actual seq which needs to be repeated again and again. keep the seq in TryCatch block.

In Try block keep your original seq and at the end of seq assign RetryVar= 4. It means the complete sequence has executed successfully and loop needs to be end.

In Catch Block add clean up activities as per you process. For e.g. Close application and assign RetryVar=RetryVar+1. So it keeps the count of failure. Additionally you can log the exception details with its retry number.

  1. Connect TryCatch Block seq back to If Decision activity , so it completes the loop.

Hi @CVGenderingen

Its a good question… To continue the discussion…

@Reshmamore - I was also thinking about this too… Just to get few things clarified from you. (this might help @CVGenderingen as well )
So, in your approach, you are mentioning to have a full flowchart within the retry segment that includes all the activities we basically need to re run. So, let’s just assume, We have two workflows which are invoked through invoke workflow activity in our solution. So in case an activity fails in either two, if we are to repeat that sequence, having that entire workflow again in the global handler will not be a good design right? Is it possible to have Invoke workflow activity within the retry segment to retry the entire workflow again?

But if so, problem is, how do we determine which workflow’s activity failed… In global handler, is there a way to find the workflow file that got failed?

Hey @CVGenderingen

Why can’t you use Retry Scope where you have to specify the condition and action by providing NumberOfRetries and RetryInterval.

@Reshmamore - I think the Retry Scope activity will provide similar functionality what you suggested.

Regards,
Vijay.

1 Like

global handler will not be a good design right?
-Maybe I am wrong, but I don’t think there will be design issue, if we use invoke workflow activity, it will separate process steps.

Is it possible to have Invoke workflow activity within the retry segment to retry the entire workflow again?
-Yes, It’s possible.

But if so, problem is, how do we determine which workflow’s activity failed… In global handler, is there a way to find the workflow file that got failed?
-if we follow naming convention, then on exception it will give the workflow name as well as activity where it failed.

3 Likes

Retry Scope is suitable when you want to retry 1-2 activities, but in case of multiple activities, it will not work effectively.
And exception will be thrown at Retry scope level not on seq or activity level.

Hi @Reshmamore

Retry scope will retries the contained activities as long as the condition is not met or an error is thrown. There is no specific count on activities. Condition check is what the final deciding factor.

For exception you can keep whole retry scope which contains whole sequence inside Try Catch and you can handle exceptions.

Regards,
Vijay.

1 Like

I am running into this same issue. And it seems like your solution might work for me, just one question. How do you connect the TryCatch block seq back to If Decision? Just having the issue on completing the loop.

Thank you in advance.