Top
Photo by airfocus on Unsplash

How to automatically complete approval tasks in Power Automate and Microsoft Teams


When writing my previous post on working with Tasks in Power Automate I realized existence of a column name Flow Notification URI inside of Flow Approval table, which I so far really underestimated. Let me show you how powerful it is!

Until today I was nearly sure it is impossible to automatically complete a task in Power Automate/ Microsoft Teams and as well to resume a process that is waiting for approval. It turns out I was really wrong.

Some basicis

Each time a workflow that contains an action which assigns a task and waits for completion is executed, it not only creates entries in Approval and Approval Request tables, but also in Flow Approval. Furthermore, each entry in that last table contains a value in column called Flow Notification URI, that when called with POST request simply completes waiting and resumes flow:

Flow Notification URI column

The URL there is built from the following pieces (most of them is coming from other columns of the Flow Approval table):
https://[instance].westeurope.logic.azure.com/workflows/[Flow Id]/runs/[Flow Run Sequence Id]/actions/[Action name that waits for approval]/run?api-version=2016-06-01&sp=%2Fruns%2F[Flow Run Sequence Id]%2Factions%2F[Action name that waits for approval]%2Frun%2C%2Fruns%2F[Flow Run Sequence Id]%2Factions%2F[Action name that waits for approval]%2Fread&sv=1.0&sig=[some signature key]

What’s next?

Knowing that making POST request to that URL completes waiting and resumes flow, opens a totally new range of scenarios that can be build around basic approvals, for example using custom Power Apps. Just imagine some of them:

  1. Approving on behalf
  2. Waiting for majority of responses
  3. Allowing requester to finish approval at any time
  4. and more!

The goal is, that first you need to write and update data in all other tables that Approvals are using (mentioned in my post here), get all the information needed to be sent as a response and after that make a POST to the Notification URI.

Also, when doing such a POST, be sure it is following the expected JSON format and that you put “Content-Type: application/json” as header:

{
   "responses":[
      {
         "responder":{
            "id":"GUID from Users Table",
            "displayName":"Responder name",
            "email":"Responder mail",
            "tenantId":"Tenant ID",
            "userPrincipalName":"Responder principal name"
         },
         "requestDate":"Timestamp",
         "responseDate":"Timestamp",
         "approverResponse":"Outcome",
         "comments":"Comments"
      }
   ],
   "responseSummary":"Combined response comments and approvers together with dates",
   "completionDate":"Timestamp",
   "outcome":"General outcome",
   "name":"Approval ID from Approval table",
   "title":"Approval name",
   "details":"Approval description",
   "requestDate":"Timestamp",
   "expirationDate":"Timestamp"
}

Once you send such a POST, action will complete waiting and will display all the data as dynamic outcomes, as if it was completed through the task UI:

Completed task in Power Automate

I hope this post makes you as excited as it made me when I discovered this simple information. Let me know in comments what scenarios you are able now to accomplish!


Tomasz Poszytek

Hi, I am Tomasz. I am expert in the field of process automation and business solutions' building using Power Platform. I am Microsoft MVP and Nintex vTE.

2 Comments
  • Lewis Harris-Manley

    Hi Tomasz – thanks for the article, looks great! We tried the standard “Request sign-off” approval flow from SharePoint but because it doesn’t wait until all those listed as approvers has approved and instead as soon as one of them approves it marks the document as such, it doesn’t work.

    Any ideas of how we can utilise this Flow URI to make the status update in SharePoint wait until all those marked as approvers have actually approved?

    December 15, 2021 at 6:47 pm Reply
    • Tomasz Poszytek

      Hi, indeed the oob sing-off waits for first only. For such purpose you’d need to develop your own approval workflow, where a trigger is “for a selected item”, so that it appears under context menu of a specific item (or you can use list formatting to add a button?). Back to the topic – in that custom approval workflow you can define whichever conditions you need to complete approval – either first or all. You can then extend the basic functionalities with custom flow that is triggered whenever a new record in Approval Responses is added that eg. checks if majority of approvers have already responded and then completes approval 🙂

      December 16, 2021 at 12:55 am Reply

Post a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.