“Some approvers in my flow need more than 30 days for their task, can I somehow bypass this Power Automate limitation for long term tasks?“
If you use Power Automate for approval processes, you probably noticed that such flows can run for very long. It’s because these flows still need an user input, somebody must review the request and make a decision. A decision that can take time, let it be days, weeks, or even months. But Power Automate doesn’t like long running flows – once it runs for more than 30 days, it stops. The flow times out, nothing else will happen.
Yet it’s not uncommon in many organisations to take time on some decisions, maybe a few meetings too, surely longer than 30 days. Which brings us to the question – can you automate also such approval processes?
Note: this solution requires Power Automate premium license. If you’re using the free version there’s a similar solution in one of the previous articles.
You can, but not in a single flow
Since you can’t overcome the limitation of 30 days of run time per flow, you’ll have to think of a different approach. Instead of waiting for something in the flow, you can trigger a new flow only when it happens. It’s the same idea you surely used many times. You don’t start a flow when an item in SP is created and then wait for an update. You build a flow that’ll start on the update.
The same solution can be used for approval tasks. As explained in the previous article, approval tasks are rows in a Dataverse table.
The standard ‘Wait for an approval’ action just waits for the row to be updated, meaning the task is finished. That’s something you can easily handle yourself – you can create a flow that’ll trigger on a Dataverse row update.
One flow to create the task, another to process response
To build the whole solution you’ll need two flows. The first flow is the one that’ll create the task and end. No waiting in that flow.
The second flow will trigger when a task is completed, or more specifically, when a row in the Approvals Dataverse table is updated. Since you’re interested in the completed tasks, run only on the Result column update.
msdyn_flow_approval_result
You can add also some trigger condition that’ll check the task name and connect it with a specific process.
That’s the whole approval task, but as already explained in previous article, it doesn’t contain the approver information. That one is in a different table and you must look for it. Search in the Approval Responses table using the task id and return the response information.
Filter rows:
msdyn_flow_approvalresponseidx_approvalid eq '@{triggerOutputs()?['body/msdyn_flow_approvalid']}'
Select columns:
msdyn_flow_approvalresponseidx_approvalid,createdon,_ownerid_value,msdyn_flow_approvalresponse_response,msdyn_flow_approvalresponse_comments
Now you know that the task was completed and you have the response to the task. Continue with the flow, do all the steps that should be done after an approval, and assign the next task.
Summary
While you might feel that 30 days of flow run time is not enough, it’s more about the way you think about flows. You wouldn’t keep your car running for a month if you didn’t know whether you’ll need it, you’d shut it down after some time. It’s similar with Power Automate and long term approval tasks, 30 days is a very long time.
If you feel that your tasks might take longer than that, you don’t want to wait for the response. Build a second flow that’ll start only once a task is completed instead. This way you won’t care if the task is completed in a few days, weeks, or months, your flow will handle it.
1 thought on “How to handle long term tasks in Power Automate”