Jump to content

Featured Replies

Posted

Overview

 

Intermittent failures and delays are events that might happen on a cloud environment, to overcome the occurrence of these events and minimize disruption of your logic app runs, a powerful built-in feature is available “retry policy”, but there are special cases where this retry policy won’t come into action and a custom retry strategy need to be part of your workflow to overcome these kinds of events. Such events are:

 

 

 

 

 

 

In this article, we will show how to implement this custom retry strategy as part of your workflow.

 

 

 

Steps

 

  1. Execute the required action.
  2. Check if success code or required data are returned:

    1. If yes, go to step 3.
    2. If no, execute the following steps inside until loop:
      1. Delay for X minutes; X delay time can be set as required depending on the failure cause.
      2. Execute the required action again (same as step 1).
      3. Check if success code or required data are returned:
        1. If yes, exit until loop and go to step 3.
        2. If no, go back to step I and execute same steps again.

        [*]Proceed with remaining actions execution normally.

         

         

        Sample Scenario

         

        Suppose you are using the HTTP action to call a REST API, in case of success the call returns an HTTP status code 200, the call intermittently fails and does not return the HTTP status codes identified by the retry policy, so the retry policy is not activated and the action fails. Here comes the custom retry strategy into action.

         

         

         

        Implementation

         

        Use the following steps:

         

        1. Add the HTTP action to call the targeted REST API.

         

        mediumvv2px400.png.3619ebc66b4289a519f859b6fa829339.png

         

        2. Add a Control – Condition action to check if REST API call failed by checking the HTTP status code returned by the previous action if it is not equal to 200.

         

        mediumvv2px400.png.8f07fe76838e259556c9428a6f113208.png

         

        3. Inside the True branch, add a Control – Until action.

         

        mediumvv2px400.png.ac6bacd5a9e7848f0290702621dc69e3.png

         

        4. Inside the Control – Until action:

         

        a. Add Schedule – Delay action and set the count to 1 and Unit to Minute.

         

        mediumvv2px400.png.4a3126cb3cda951c3e0d659ab3f3da96.png

         

        b. Add another HTTP action to call the same targeted REST API again.

         

        mediumvv2px400.png.f6d3ed9f7b358e1425ccc05c98b6a402.png

         

        c. Check if the HTTP status code returned from previous step is equal to 200 to exit the loop.

         

        mediumvv2px400.png.af53d767390873e4f4ba7025742cf4fa.png

         

        d. Set the until limits as required, count and timeout.

         

        mediumvv2px400.png.f85fd5e70781af20a3d23493c2e8796e.png

         

         

         

        The final workflow will look as follows:

         

        mediumvv2px400.png.cac174db11df8c383f05d5fa70ce6148.png

         

        Continue reading...



Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...