Exporting a flow in Power Automate generates a .zip package that contains the complete description of the flow. Unlike traditional code exports, this package is declarative: it is composed of structured JSON files that define the triggers, actions, connections, and metadata.
Editing Power Automate Export Packages
1. Introduction
Exporting a flow in Power Automate generates a .zip package that contains the complete description of the flow. Unlike traditional code exports, this package is declarative: it is composed of structured JSON files that define the triggers, actions, connections, and metadata.
By editing these files directly, you can adapt flows for different environments, replace SharePoint site references, update list names, or adjust field mappings before re-importing into Power Automate.
2. Package Structure
A typical exported flow package looks like this:
<MyFlowName>_<Timestamp>.zip
│
├── manifest.json
├── connections.json (sometimes absent)
└── Microsoft.Flow/
└── flows/
└── <FlowGUID>/
├── definition.json
└── flow.json (sometimes absent)
- manifest.json: Global metadata and package resources.
- connections.json: Connection references to external services (may be missing).
- definition.json: The full flow logic including triggers, actions, and parameters.
- flow.json: Metadata describing the state and summary of the flow (optional).
3. Detailed File Analysis
3.1 manifest.json
- Purpose: Defines which resources are included in the package.
- Contents:
- Flow GUIDs
- Display name and description
- Resource dependencies (e.g., SharePoint API, Outlook API)
- Editable fields:
details.displayName– the name shown during importdetails.description– optional description of the flow
- Avoid editing:
- Resource IDs, GUIDs, or API identifiers
This file primarily controls how the package is presented during import.
3.2 connections.json (optional)
- Purpose: Defines external connectors used by the flow.
- Example:
{ "connectionReferences": { "shared_service": { "connection": { "id": "/providers/Microsoft.PowerApps/apis/shared_service/connections/shared-service-12345", "connectionName": "shared-service-12345" }, "api": { "name": "shared_service" }, "dataSources": [ "https://tenant.sharepoint.com/sites/Example" ] } } } - Editable fields:
- Replace entries in
"dataSources"with the new target SharePoint site URL(s). - Optionally reset
connectionName(the import wizard will prompt for remapping anyway).
- Replace entries in
- Note: If
connections.jsonis absent, Power Automate will require you to remap connections manually during import.
3.3 definition.json
- Purpose: Core of the flow containing all logic.
- Sections:
parameters: connection references and authentication details.triggers: defines when the flow is executed.actions: step-by-step operations.
- Key elements to edit:
"dataset": typically holds a SharePoint site URL."table": the internal name of a list or library."siteUrl","webUrl","listName": other environment-specific references.
- Generic Example:
"Create_item": { "type": "OpenApiConnection", "inputs": { "host": { "apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline", "connectionName": "shared-sharepointonline" }, "parameters": { "dataset": "https://tenant.sharepoint.com/sites/OldSite", "table": "TargetList", "item": { "Title": "@triggerBody()?['ProjectName']", "Description": "@triggerBody()?['Details']" } } } } - What to edit:
- Replace
"dataset"with the new SharePoint site URL. - Update
"table"with the correct list name in the target environment. - Adjust
itemorbodypayloads if the target list uses different internal field names.
- Replace
This is the most important file for customization.
3.4 flow.json (optional)
- Purpose: Stores metadata about the flow.
- Contents:
{ "properties": { "displayName": "Example Flow", "state": "Started", "definitionSummary": { "triggers": ["When_an_item_is_created"], "actions": ["Create_item", "Send_an_email"] } } } - Editable fields:
displayName: useful if you want the flow to appear under a different name in the target environment.
4. Workflow for Editing and Importing
- Backup the original export:
cp FlowExport.zip FlowExport.backup.zip - Extract the package:
unzip FlowExport.zip -d extracted - Inspect JSON files:
- Use a structured editor like Visual Studio Code.
- Search for keywords:
dataset,table,siteUrl,webUrl.
- Perform edits:
- Replace URLs in
"dataset"with the new SharePoint site. - Update
"table"with target list names. - Correct any field internal names used inside
itemobjects.
- Replace URLs in
- Validate JSON syntax:
python -m json.tool extracted/Microsoft.Flow/flows/<GUID>/definition.json - Repack the package:
cd extracted zip -r ../FlowCustom.zip . - Import into Power Automate:
- Go to Power Automate > My flows > Import.
- Upload the customized package.
- Remap connections as prompted.
- Choose whether to create a new flow or update an existing one.
- Test:
- Run the flow with test data.
- Check run history for errors.
- Adjust any mismatched field mappings.
5. Common Issues
- Connections missing:
connections.jsonmay not be present; you will need to map connections manually during import. - Schema mismatches: if the target list has different internal field names, actions will fail until corrected.
- JSON corruption: one misplaced character (comma, bracket) will make the package invalid. Always validate.
- Case sensitivity: SharePoint internal field names are case-sensitive.
- Folder structure errors: if the
.zipstructure is altered, Power Automate will refuse to import.
6. Best Practices
- Keep a baseline export as reference.
- Document every modification made in a versioned log.
- Validate JSON files after edits.
- Use targeted search and replace to minimize risk of incorrect substitutions.
- Consider exporting flows as part of a Solution when moving between environments to preserve dependencies more cleanly.
7. Summary Table
| File | Purpose | Editable Fields | Notes |
|---|---|---|---|
manifest.json | Global metadata and resources | Display name, description | Do not alter GUIDs |
connections.json | External connectors and data sources | dataSources (URLs) | May be absent, remap on import |
definition.json | Core logic (triggers, actions, params) | dataset, table, field mappings | Most important file to edit |
flow.json | Metadata and summary | displayName | Optional |
8. Cheat Sheet
- Backup before editing:
cp Flow.zip Flow.bak.zip - Extract package:
unzip Flow.zip -d extracted - Search for environment-specific values inside JSON:
"dataset": "https://...""table": "...""siteUrl":,"webUrl":
- Bulk replace (Linux/macOS example):
find . -type f -name '*.json' -exec sed -i "s|https://oldsite.sharepoint.com/sites/Old|https://newsite.sharepoint.com/sites/New|g" {} + - Validate JSON:
python -m json.tool definition.json - Repack:
cd extracted && zip -r ../Flow_customized.zip . - Import into Power Automate, map connections, test thoroughly.
