I am trying to get the most recent run time of a list of workflows. I have an export of data that gives me the Site URL and the Subscription ID of the workflow.
My thought process is to some how connect to the Workflow History list for each site URL, then filter the data by the Subscription ID. I would then sort by either the Created Date or ID, then return the first entry. This would give me the most recent run. I've been able to do this with Power Automate but the Flow that I started has been running for 5 days now and only outputted 1,000 out of the 3,000 workflows I'm interested in.
I was thinking about using PowerShell for this issue because it can query SharePoint faster and handles the data faster. I've looked at the PNP command to get list items but it doesn't work well with the Workflow history list.
Does anyone know how to get items from a SharePoint list and filter them like I describe above?