power-automate-api

Read, validate, and patch Power Automate flow definitions through the Dataverse and Flow APIs.

2|Updated Jul 28, 2026
One-click install
npx skills add https://github.com/mbadali25/useful-claude-add-ons --skill power-automate-api-mbadali25
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: power-automate-api
Source: https://github.com/mbadali25/useful-claude-add-ons/tree/main/skills/power-automate-api
Command: npx skills add https://github.com/mbadali25/useful-claude-add-ons --skill power-automate-api-mbadali25

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Editing Power Automate cloud flows through the maker portal designer is unreliable — the expression editor silently discards hand-typed references, and the flow definition is a JSON string inside a JSON column with no version history, so a bad write is unrecoverable. This Skill provides a safe API-based workflow with enforced snapshots and validation before every write. ## Core Features & Use Cases - Snapshot-before-write enforcement: pa.py writes a timestamped rollback copy of the live definition before every PATCH, since clientdata has no version history. - Structural validation: Detects orphaned trigger-schema required entries at every nesting level, Terminate actions nested inside Apply to each loops, unresolved host.connectionName references, and broken runAfter links — refusing to PATCH until fixed. - Authentication guidance: Documents the exact token audience and scope derivation for Dataverse, BAP, Flow, and PowerApps endpoints, including device-code login, public client IDs, and SharePoint REST restrictions. - Use Case: You need to remove a dynamically-added trigger input from a solution-aware flow. Run pa.py get to snapshot, edit the parsed definition, run pa.py validate to confirm both properties and required are consistent, then pa.py patch to write it back with a rollback command printed. ## Quick Start Ask the assistant to read a Power Automate flow by its GUID from your Dataverse org, snapshot its definition, and validate it before making any edits.

Frequently Asked Questions about power-automate-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I edit a Power Automate flow definition through the API?

Read the flow's clientdata column from the Dataverse workflow table, parse the nested JSON string into an object, edit it, re-serialize, and PATCH it back. Always snapshot the live definition first, since clientdata has no version history and a bad write is otherwise unrecoverable.

Why do I get 401 InvalidAuthenticationAudience from api.flow.microsoft.com?

Each Power Platform endpoint requires a different token audience, and a wrong one returns 401. Derive the scope as the resource URI plus /.default — for api.flow.microsoft.com the audience is https://service.flow.microsoft.com/ with a trailing slash, producing a double slash in the scope.

Why does my flow not create any run after removing a trigger input?

A dynamically-added trigger input exists in both the schema's properties and its sibling required array, often nested under rows.items. Removing it from properties but not required fails launch-time validation before any run is created, leaving run history empty.

Can the API add a new connector to a Power Automate flow?

No, the API cannot mint a connection reference. A connector the flow has never used requires one designer save first to create the reference. Check properties.connectionReferences first, since many actions reuse a connector already present.

What happens if I patch a managed Power Automate flow?

Patching a managed flow's clientdata creates an unmanaged layer that future solution imports will not overwrite. Check the ismanaged flag before patching; the change usually belongs in the unmanaged source solution instead.

Does pa.py require any Python packages to be installed?

No, pa.py uses only the Python standard library and runs on Python 3.8 or later. It handles device-code login, token caching, validation, snapshots, and PATCH operations with no pip installs required.