Get Power Automate Desktop runs details
Table of contents:
This post is totally focused on description of the Dataverse structure that is used to store details about runs of all Power Automate Desktop ui flows. Or as called today: desktop flows and cloud flows built using Power Automate platform.
The described below functionalities regarding visualizing data from flows’ runs, presenting statistics and in-depth insights is a highly demanded data requested by the business and IT. The departments require RPA designers to deliver these information, so that they know what bots are actually doing, why they are failing, where are bottlenecks, where they run etc. It’s worth to spend some time to build your tailored dashboards.
Dataverse structure
The below structure is used actually to store information about all kinds of flows user is able to build using Power Automate: cloud flows, business flows and desktop flows:
In fact, there are only two real tables above. The third, additionalcontext
is table build dynamically using contents of file attached to every record in table flowsessions
. Let me explain this to you.
- workflows (display name: Process) – table is keeping all the information about all flows built in Power Automate, in a specific environment. To filter desktop flows from all other kinds of flows, you need to use column
category
and get all rows with value equal 6. Then to filter further use columnuiflowtype
and get all rows with value greater or equal 0:- 0 are legacy desktop UI flows (including WinAutomation flows triggered via UI flows),
- 1 are legacy Selenium IDE based web UI flows,
- 2 are called PowerShell, however these are new Power Automate Desktop.
- flowsessions (display name: Flow Session) – table is keeping details about each flow’s instance. One of the very important columns that table has is “additionalcontext”, which contains…
- additionalcontext (not a Dataverse table, but file attached to each flowsession entry) – this is a file, containing base64 encoded JSON object. The object stores all information of that specific run, including details about each action’s execution. Using this information you can get crucial insights how the instance ran, which action failed, what was the failure reason, what were the inputs and outputs for each action etc…
How to access the data?
There are two ways to get Power Automate Desktop runs details. It is either by querying Dataverse tables directly or by using odata endpoints.
Note! To get environment URL log in to https://admin.powerplatform.microsoft.com, open specific the one you want to access and copy value under “Environment URL”.
The odata endpoints URLs are below:
- https://{ENVIRONMENT-URL}/api/data/v9.1/workflows?$filter=category eq 6
- https://{ENVIRONMENT-URL}/api/data/v9.1/flowsessions
- https://{ENVIRONMENT-URL}//api/data/v9.1/flowsessions({flowsessionid})/additionalcontext
Access the data in Power Automate
The only difficulty to access this data in Power Automate is in getting contents of the additionalcontext file. Using build-in Dataverse actions, accessing contents of files is possible only using the “Get file or image” action (that works only for current environment and is available only for flows created in solutions): Common Data Service (current environment) – Connectors | Microsoft Docs.
If you’d like to access it from a different environment then you need to use “Invoke HTTP with Azure AD” action. Configure the access by providing environment URL:
Then simply use odata endpoint and voilla! 🙂
Next steps
Important! Unfortunately due to impossibility of getting Dataverse file contents using environment URL as a dynamic variable (the Dataverse action works only for current environment, whereas HTTP with Azure requires to define the URL in advance, same issue in Power Bi) you need to hardcode each environment you’d like to monitor.
After all this introduction I now encourage you to use Power Bi to visualize the data from UI flows’ runs. However to gather data from multiple environments, you will need to create connections to each of them separately.
The draft report I am using gives me information about all details of a specific UI flow instance:
The next page of the report delivers me an overview information about stats (actions, errors), together with some calculations around actions’ time executions etc.:
Power Bi gives you of course unlimited possibilities, so the way you will use this data is only limited by your creativity.
Note! A lot from the above functionalities are available in the Center of Excellence Starter Kit dashboard. Simply download it and install in your Power Platform environment. Get it here: https://aka.ms/coestarterkit.
I hope that after the lecture of this post you will know now how to start your adventure with flows’ data and build your own dashboards. If you have any questions, leave them in the comments below.
Sravan
Hi Tomasz,
Thank you for detailed explanation
I am accessing dataverse tables .. but I don’t see flowsessions table in it.
Could you please help me .
Tomasz Poszytek
Be sure you switch view to display all tables. It’s display name is “Flow Session”.
Karol Filipowicz
Hi Tomasz,
Awesome article! Wanted to check with you, because it’s driving me nuts, does the flowsessions table contain also details of cloud flows’ run history?
Microsoft’s documentation states the following: “Entity to store the information that is generated when a modern flow or UI flow runs”.
I would interpret “modern flows” as cloud flows, however I can’t seem to find any historical data except from UI flow runs.
Is there a way to query Dataverse to get such info?
Thanks and keep up the good work 🙂
Tomasz Poszytek
Hi Karol. No, flowsessions only contain data from Desktop flows. Cloud flows are not stored in Dataverse unfortunately. They are stored somewhere outside, in some Azure databases. I don’t know deep details about it.
Nguyen Trung Duc
Hi Tomasz!
I use english not well, so i not understand all your writing.
“There are two ways to get Power Automate Desktop runs details. It is either by querying Dataverse tables directly or by using odata endpoints.”
Help me about the fisrt way: by querying Dataverse table directly. Could you explain more detail? Looks like you didn’t write about it in the back.
I can get detail run a desktop flow to Power BI in import mode, but i want to get in direct query mode. I am understanding your fisrt way does it right.
Thank you.
Tomasz Poszytek
Hey, about the first approach it’s the Dataverse structure chapter. However, please note, that the V1 schema is going to be obsolete next year. And you should look at the v2 schema: https://learn.microsoft.com/en-us/power-automate/desktop-flows/schema.
Prasanna M
Hi Tomasz,
Its a great article. Can you please help me to extract the details while the flow is running(in progress).
I need to see the action level details.. on which flow and on which step the flow is running right now.
Thanks in advance
Prasanna M
Tomasz Poszytek
It is not possible to get run details as the RPA is running. This is because the data is stored locally on the machine and saved back to cloud after the run is completed.