Pa export
Export flow definitions from Dataverse to local JSON files. USE FOR: "export flow", "download flow", "clone flow", "backup flow", "get flow definition", "save flow locally", "inspect flow JSON". DO NOT USE FOR: importing flows (use pa-import), listing flows without downloading (use pa-list).
By- name:
- pa-export
- description:
- Export flow definitions from Dataverse to local JSON files. USE FOR: "export flow", "download flow", "clone flow", "backup flow", "get flow definition", "save flow locally", "inspect flow JSON". DO NOT USE FOR: importing flows (use pa-import), listing flows without downloading (use pa-list).
Skill: Export — Download Flow Definitions to Local Files
Exports Power Automate cloud flow definitions from Dataverse to local JSON files. The exported files contain the full Logic Apps definition (clientdata) and can be edited locally and re-imported.
Export a Single Flow
python scripts/export_flow.py --flow-id a1b2c3d4-e5f6-7890-abcd-ef1234567890 --dataverse-url https://org123.crm.dynamics.com
Or, if DATAVERSE_URL is set:
python scripts/export_flow.py --flow-id a1b2c3d4-e5f6-7890-abcd-ef1234567890
Don't know the flow ID? Use pa-list first:
python scripts/list_flows.py
Export All Flows
python scripts/export_flow.py --all --dataverse-url https://org123.crm.dynamics.com
Exports every category-5 flow in the environment. Each flow gets its own subdirectory.
Output Structure
Each exported flow creates a directory under workflows/:
workflows/
Handle-Customer-Request-a1b2c3d4/
workflow.json # The full clientdata — Logic Apps definition
metadata.yml # Flow metadata (name, ID, state, solution info)
workflow.json
This is the flow's clientdata field from the Dataverse workflow entity — the complete Logic Apps JSON definition. It contains:
- Triggers: The event that starts the flow (e.g.,
manualtrigger withkind: "PowerApp"for CPS flows) - Actions: Every step in the flow (HTTP calls, conditions, compose, response, etc.)
- Parameters: Connection references, environment variables
- Schema: Input/output schemas for triggers and Response actions
This is the same JSON you'd see in the Power Automate portal's "Peek code" view.
metadata.yml
Contains:
name: Handle Customer Request
workflowid: a1b2c3d4-e5f6-7890-abcd-ef1234567890
statecode: 0
statuscode: 1
category: 5
resourcecontainerid: xxxx-xxxx
solutionid: yyyy-yyyy
Editing Exported Flows
The exported workflow.json can be edited locally:
- Open
workflow.jsonin your editor - Modify triggers, actions, schemas as needed
- Re-import with
pa-import:
python scripts/import_flow.py --flow-json workflows/Handle-Customer-Request-a1b2c3d4/workflow.json --name "Handle Customer Request v2" --dataverse-url https://org123.crm.dynamics.com
Common Edits
- Add/remove actions: Edit the
actionsobject in the definition - Change trigger schema: Edit
triggers.manual.inputs.schema(for CPS input parameters) - Fix Response outputs: Edit
actions.Response.inputs.bodyandactions.Response.inputs.schema - Remove boolean outputs: Change
"type": "boolean"to"type": "string"in Response schema (seepa-healthGotcha 3)
Use Cases
| Scenario | Command |
|---|---|
| Backup all flows before making changes | python scripts/export_flow.py --all |
| Inspect a specific flow's definition | python scripts/export_flow.py --flow-id {id} |
| Clone a flow to a new environment | Export → edit metadata → import with pa-import |
| Debug CPS integration issues | Export → inspect trigger kind, Response schema |
| Version control flows in Git | Export → commit workflows/ directory |
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.


