- Here, we are creating an automated cloud flow. Next, enter your flow name and select trigger When an item is created or modified, click on 'Create'.


- Next, select your site address and list. Here, we will add one trigger condition that if FlowStatus is equal to 'No' our flow should not trigger.
- Initially, FlowStatus value will be null so, the flow will run until we change its value to No.


- Copy below trigger condition, click on Add and paste there and click on Done.
@not(equals(triggerBody()?['FlowStatus'],'No'))
- Next, I want to update the Status column value as "In Progress" so, users can know that the approval process started.
- As our flow will trigger when an item is created or modified so, please keep note that at any point if you want to update the item and don't want to trigger a new flow instance set FlowStatus column value as "No". So, it will not create a new flow instance for that item.

- Next, we will add the Switch condition so, based on the CurrentCase column value that Case will run.
- Here, the default CurrentCase column value is Case1. So, when a new item will be created we will check that in Switch condition and initially, Case 1 will run.



- In Case1, I need approval from the approvers. So, added Start and Wait for approval action, which will take approval from the approvers.
- Here, we will need to set a Timeout for approval. As we know flow instance default timeout is 30 days so if in Approval 1, approvers are not taking any action within 30 days it will automatically fail so, here we are adding timeout P29D = 29 Days (PT1M = 1 Minute) to manage that timeout manually and if that approval not approved/rejected within 29 days we will take next action according to that.

- Next, If approval is approved/rejected, we need to update the Status column value in the list so, I am adding the Update item action for that. Also, simultaneously we need to check that if Approval took more than 29 days, the current flow instance should be completed and a new flow instance should be created.

- Next, we will add another parallel branch so, it will have all the actions if approval timeout.

- We will need to change configure run after for the Update item action which we have added in the parallel branch. So, click on 3 dots (ellipsis) and click on "Configure run after" and select "has timed out" and click on the Done button. So, by doing this Update item 3 will only run if Start and wait for an approval time out.



- Here, if our approval process is completed within 29 days it will run the left branch of update item action and if it timed out it will run the right side of a branch of the update item.
- If the left branch is executed, it means approval has been completed within 29 days. so, we will update the Status column, set the CurrentCase column value as the next approval Case, and the FlowStatus column value as "Yes" because we want to trigger a new flow instance for the next approval process.
- On the right side, if approval timed out, I have set the Status column value as timed out, CurrentCase column value as running Case value, and FlowStatus column value as "Yes", because we want to start the same approval again.

- Repeat the steps for Case2 as I have 2 levels of approvals. You can repeat for as per your requirements.
- Make sure in the last Case, when your approvals are completed, set the FlowStatus column value as "No" so, that means your flow is completed. Here, I have set the Status and CurrentCase column values as well.

So, here we have increased the PowerAutomate timeout by more than 30 days which will never get time out.
Let me know if you have any questions or concerns.
Ninad JoshiPosted May 25, 2023, 6:53 AM
{ "error": { "code": 500, "message": "Request to the backend service timed out", "source": "", "path": "forward-request", "policyId": "", "clientRequestId": "" } }
Ninad JoshiPosted May 25, 2023, 6:53 AM
Im getting below error, can you please suggest
Thomas JohnsonPosted Jan 31, 2023, 10:46 PM
Followed your directions but when I save the flow each update item gives an error: Actions in this flow may result in an infinite trigger loop. Please ensure you add appropriate conditional checks to prevent this flow from triggering itself.