“My approval task needs longer than 30 days to make the decision, can I somehow keep the Power Automate asks active for longer?”
I’ve been building a lot of approval flows lately, dealing with various situations. A restartable (and much easier to debug) approval flows, handling expired tasks, or restarting the whole expiring flows. In the previous article I proposed a solution to remove tasks after the flow expires and create them again. But after a bit of thinking I thought of another solution – keep the original task as long as necessary.
How the approval tasks work
The Approvals functionality is a standalone feature connected to Power Automate. You might notice that when you use the approvals on a new Power Platform environment for the first time, it’ll tell you to wait until it creates the related Dataverse tables. The Approvals actions in the flow then interact with these tables. When you create a new task in a flow, it’ll create a new entry in the tables. Once users complete the task, it’ll update the row in the tables.
That’s the reason why tasks still exist even after the flow expires. And that’s also why you can process tasks even after the original flow expires.
How to get the task response
The only reason why the old tasks don’t do anything is because there’s no flow waiting for them. If you use the ‘Start and wait for an approval’ action, the task must be finished during the flow run. It creates the tasks, waits for it to finish, and if it’s not finished in time nothing happens – nobody is waiting anymore.
The solution is to make a second, “waiting” flow. One flow to create the approval task, another one to wait for the response. And since it’s two flows, you can’t use the ‘Start and wait for an approval’ action.
In the first flow ‘Create an approval’ with all the necessary preparations and store the ‘Approval ID’ somewhere, e.g. in a SharePoint list.
Once the column has a value, you can start the second flow, the one waiting for the response. Get the approval ID and use it in the ‘Wait for an approval’ action.
Set the timeout on the ‘Wait…’ action to 29 days, and if it’s not completed by then, resubmit the flow. This way there’ll always be a flow waiting for the task completion, no matter how long it’ll take. The task processing must be then obviously in this second flow.
If you expect that the approval task can take more than 30 days, you’ll have to prepare your Power Automate flow for this alternative. One option is to delete the old task, restart the flow, and create a new task. Another one could be to split your flow into two as explained in this article, with the second flow being restarted over and over again, until the task is completed.