power-automate-flows
Power Automate Cloud Flows (Dataverse) — Build, Deploy, Test
Overview
Operate Power Automate cloud flows (Dataverse-triggered) from the CLI/API instead of the maker portal: pull the live definition, edit it as JSON, deploy by patching clientdata, and verify by triggering a real run and reading its raw outputs. Covers creating a flow from scratch via the API, document generation (Word/Excel → PDF) and the connector/identity gotchas that waste the most time.
Core principle: the deployed flow is the source of truth — always pull it live, never trust local solution files; and verify by reading the actual generated files, not by trusting an action's "Succeeded".
Always pull the latest cloud version first. Before reading, editing, patching, or reasoning about any flow, GET its current clientdata from the environment — even if a local snapshot, an exported solution, or a previous session's JSON is sitting right there. Someone may have edited the flow in the maker UI in between, and the UI silently rewrites definitions (dynamic schema stripped, image params flattened to strings). Skip the pull only when the user explicitly says to work from a specific local file or snapshot.
Tooling assumed: pac (Power Platform CLI), az (Azure CLI, for Graph + Dataverse + Flow API tokens), Python (urllib). All operations here are doable headless.