Power automate api client
Work with Microsoft Power Automate cloud flows through the power-automate CLI. Use for pull, diff, deploy, create, start, stop, run history, action diagnostics, or replacing a hosted MCP service with local open tooling.
ByWals.pro teamPower Platform consultancy @ Wals.pro- name:
- power-automate-api-client
- description:
- Work with Microsoft Power Automate cloud flows through the power-automate CLI. Use for pull, diff, deploy, create, start, stop, run history, action diagnostics, or replacing a hosted MCP service with local open tooling.
Power Automate API Client
Use this skill when changing or diagnosing Power Automate cloud flows from the
command line. The default tool is the power-automate CLI, not a hosted MCP service.
Rules
- Do not use hosted MCP services for deployment unless explicitly requested.
- Never store OAuth access tokens. Short-lived tokens come only from an existing
az loginsession and are never persisted. - Resolve the non-secret target (environment_id, flow_id, dataverse_url,
entra_tenant_id) in this order: CLI flags, then
POWER_AUTOMATE_*environment variables, then aprofiles.jsonfile. See "Target Resolution" below. - Authenticate with an existing
az loginsession unless a future task adds service-principal support. - Always run
deploy --dry-runbefore a real deploy. - A real deploy must create a live backup and then run
verify. - New flows:
createposts a category-5 cloud flow into the DEV environment. Always pass--solution(the unmanaged solution, e.g.<your-solution-unique-name>) so it ships via the DEV->PROD pipeline. Create in DEV only; never create/deploy on PROD — PROD changes flow exclusively through the deployment pipeline. - Use
power-automate-docsfor Microsoft documentation routing. - Use
power-automate-run-forensicsbefore changing a flow to fix a runtime incident. - Use
power-automate-expression-syntaxandpower-automate-action-configurationbefore editingdefinition.
Common Commands
power-automate status --profile acme
power-automate pull --profile acme --output ./flow.json
power-automate diff --profile acme flows/<flow>.json --unified
power-automate deploy --profile acme flows/<flow>.json --dry-run
power-automate deploy --profile acme flows/<flow>.json
power-automate create --profile acme flows/<flow>.json --name "<display>" --solution <your-solution-unique-name> [--activate] [--dry-run]
power-automate verify --profile acme flows/<flow>.json
power-automate environments --profile acme
power-automate flows --profile acme
power-automate flows --profile acme --all-environments
power-automate runs --profile acme --top 10
power-automate runs --profile acme --all-environments --top 5
power-automate runs --profile acme --all-environments --json
power-automate run-detail --profile acme <run-id>
Solutions & environment variables
power-automate solutions --profile acme [--unmanaged-only]
power-automate solution-components --profile acme --solution <unique-name>
power-automate env-vars --profile acme [--solution <unique-name>]
power-automate env-var-get --profile acme acme_ApiBaseUrl
power-automate env-var-set --profile acme acme_ApiBaseUrl "https://api.example.com" --solution <unique-name> --dry-run
Secret-type environment variables are masked by default (Azure Key
Vault-backed); --reveal-secret shows only the Key Vault reference, never the
secret. env-var-set refuses Secret-type variables. For solution/ALM and
environment-variable work, use the power-automate-solutions skill.
Default discovery stays within the configured profile environment. Use
--all-environments only when the task explicitly needs every environment the
signed-in Azure user can see.
Target Resolution
The CLI resolves the non-secret target values in this precedence order:
- CLI flags — e.g.
--environment-id,--flow-id,--dataverse-url,--entra-tenant-id. - Environment variables:
POWER_AUTOMATE_ENVIRONMENT_IDPOWER_AUTOMATE_FLOW_IDPOWER_AUTOMATE_DATAVERSE_URLPOWER_AUTOMATE_ENTRA_TENANT_ID
- profiles.json at
~/.config/power-automate-cli/profiles.json, selected with--profile <profile>:
{
"acme": {
"environment_id": "00000000-0000-0000-0000-000000000000",
"flow_id": "00000000-0000-0000-0000-000000000000",
"dataverse_url": "https://org.crm4.dynamics.com",
"entra_tenant_id": "00000000-0000-0000-0000-000000000000"
}
}
dataverse_url and entra_tenant_id are optional. If dataverse_url is
absent, the CLI attempts discovery from the Power Platform environment metadata.
Short-lived OAuth tokens are never stored in any of these locations — they are
sourced exclusively from your current az login session.
More in this playbook
Safe to turn on
Use this skill when an agent or person is about to create, change or enable an automation inside someone else's account or a shared environment: "create this workflow", "build it in the customer's account", "turn it on", "go live", "deploy this automation". Produces a proposal the human approves, an automation created in the off state, and a short list of what only the human can finish.
Workflow buildingMITn8n agents
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output, output parser, RAG, vector store, a chat assistant/bot, or human-in-the-loop review. Covers Agent-vs-chain-vs-classifier choice, the model/memory/tools/outputParser slots, tool names/descriptions as prompt, structured output with autoFix, memory, RAG, human review, and chat topologies.
Workflow buildingMITn8n agents
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output, output parser, RAG, vector store, a chat assistant/bot, or human-in-the-loop review. Covers Agent-vs-chain-vs-classifier choice, the model/memory/tools/outputParser slots, tool names/descriptions as prompt, structured output with autoFix, memory, RAG, human review, and chat topologies.


