ECG_Dataverse_Flows 0.1.0

ECG_Dataverse_Flows

Read-only client for Power Automate cloud flows and their run history in Dataverse. Built for batch jobs that archive runs, because Dataverse keeps them for 28 days only.

Usage

using var http = new HttpClient();

var client = new DataverseFlowClient(
    http,
    orgUrl: "https://orgXXXXXXX.crm4.dynamics.com",
    tenantId: tenantId,
    clientId: clientId,
    clientSecret: clientSecret);

var flows = await client.GetFlowsAsync();
var runs = await client.GetRunsAsync(since: DateTime.UtcNow.AddDays(-2));

The client does not own the HttpClient, so lifetime and timeout stay your decision.

Always fetch a wider window than the last run reached and upsert on FlowRun.RunId. Rows are written a couple of minutes after a run starts, so an exact watermark loses data.

Runs come back as raw rows rather than counts. Aggregate them in SQL, where you can re-slice by week, by error, or with child runs excluded, without re-fetching anything.

Requirements

The app registration must also exist as an Application User in the Power Platform admin centre with read access to Process and Flow Run. Without it the token is issued fine and the data call then answers 401.

Only solution aware flows produce flowrun rows. Flows living outside a solution report no runs at all, even when they run.

Flows shipped by managed Microsoft solutions are left out of GetFlowsAsync. In the first environment we tested, one Project Operations housekeeping flow ran hourly and accounted for 672 of 675 rows.

No packages depend on ECG_Dataverse_Flows.

.NET 10.0

  • No dependencies.

Version Downloads Last updated
0.1.0 5 07/28/2026