We will learn and understand Retry Policy in Power Automate flow. Before we start, make sure to subscribe to CRM Crate so that you can stay up to date in the field of Power Platform.
Why is Retry Policy in Microsoft flow?
A Retry Policy defines how an action or trigger retries a request when the original request times out or fails. The retry policy works with the HTTP action and handles the following HTTP status codes.
Sr No | Error Code | Error Meaning |
1 | 408 | Request Timeout |
2 | 429 | Too many requests |
3 | 5xx | xx refers to any number like 500 – Internal server error, 503 – Service Unavailable, 522 – Connection timed out etc |
Accessing a Retry Policy in the HTTP action
Open the Power Automate flow which the HTTP action is used and click on more option (Three Dots) >> Settings as shown below.
Here, navigate to “Retry Policy” for as shown below. By default, the HTTP Action supports retry of upto 4 times at exponentially increasing intervals if there is a request failure.
Setting up a Retry Policy in Microsoft Flow
We can setup our own custom retry policy when the default retry policy does not satisfies the operational needs. Microsoft provides two custom retry policies namely “Exponential Interval” & “Fixed Interval” as shown below.
For demonstration purpose, we will setup a Fixed Interval based retry policy in our Power Automate.
Steps to setup a Fixed Interval retry policy –
Step 1- Define a total retry count in the policy. You can specify a retry count from 1 to 90.
Step 2- Define a interval at which an operation retry. You need to specify interval in ISO 8601 format.
ISO 8601 Durations are expressed using the following format, where (n) is replaced by the value for each of the date and time elements that follow the (n) as shown below.
P(n)Y(n)M(n)DT(n)H(n)M(n)S
P is the duration designator (referred to as “period”), and is always placed at the beginning of the duration.
Y is the year designator that follows the value for the number of years.
M is the month designator that follows the value for the number of months.
W is the week designator that follows the value for the number of weeks.
D is the day designator that follows the value for the number of days.
T is the time designator that precedes the time components.
H is the hour designator that follows the value for the number of hours.
M is the minute designator that follows the value for the number of minutes.
S is the second designator that follows the value for the number of seconds.
For example – The “P3Y6M4DT12H30M5S” represents a duration of three years, six months, four days, twelve hours, thirty minutes, and five seconds.
In our case, we will setup a 5 seconds interval as shown below.
Test & validate the newly created custom Retry Policy
In our demonstration, we have created a manual triggered based Power Automate flow which calls an Azure Function using the HTTP action. We will purposefully return a faulty HTTP response (500 Error Code)from our Azure Function in order to validate the implementation as shown below.
Thus, we learned the concept of Retry Policy in Power Automate.
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.