This is an oldie but a goodie and worth resharing. With four simple actions (three if you don’t care about a timestamp) you can generate a URL to the specific run of a Power Automate flow and use it for logging or error reporting and notifications.
Here is the overall view, then we’ll dive into each action -
My first step above is getting the current time of the flow run (via utcNow()
) just in case the timing may be helpful in other troubleshooting or investigation before opening the actual flow run history. This is totally optional, and you can skip this if you just want the URL.
But why do we need to convert the time in the first place? Again, this isn’t required, but Power Automate uses UTC time by default for its date and time operations and I’m lazy and would rather not do the math.
Up next, we need to get the details about the flow that is running - yes, using flow to gather information about itself, very meta! This step is super easy.
Now we want to build out our URL with a mix of hard coded pieces and some dynamic data about this flow run (from our previous step). This step is a little more involved, but the hardest part is typing all the details into the Function pane.
Okay, here, I’ll type it out for you. ;)
https://make.powerautomate.com/environments/
Outputs('Compose_-_get_Workflow_details')?['run']?['name']
/flows/
Outputs('Compose_-_get_Workflow_details')?['name']
/runs/
Outputs('Compose_-_get_Workflow_details')?['tags']?['environmentName']
Obviously, change up the name of the previous Compose step if you didn’t name it exactly like my example (I won’t take it personally).
And finally, let’s configure a Send Email action when a previous step fails or times out. In this example I’m triggering the email off of the running of a child flow, but you can use the same idea for the parent flow or your standalone flow itself. You can also use the Scope action to integrate Try-Catch grouping for handling errors and notifications, but that is out of the scope of this quick article.
Let’s start with configuring the Run After settings for our Send Email action.
Then we can build out our email using dynamic data from our previous steps.
That’s it, now you don’t have to scroll and hunt and peck through pages of Flow history runs to find the one that had a problem, it’s waiting for you in your inbox. And if you don’t want to send an email, you have the URL so you can do anything with it - log it to a table or list, send a Teams message, create a Planner task to investigate the issue, whatever!