update_live_flow
Update or create a Power Automate flow via the live PA API. If flowName is omitted or blank, a new flow is created (PUT with a generated GUID) using an environment admin account — definition and displayName are required in that case. If flowName is provided, the existing flow is PATCHed: displayName and/or definition and/or connectionReferences are updated. RENAME: pass displayName alone, or alongside definition/operations. Power Automate rejects a PATCH that carries no flow content, so a displayName-only (or connectionReferences-only) save re-saves the flow's unchanged live definition and connectionReferences — the maker portal does the same full save on rename. The response updated list names only what you asked to change. SURGICAL EDIT: instead of resending the whole definition, pass operations — an ordered list of set/add/remove/merge ops on array-of-keys paths — to change one action/parameter on a large flow cheaply and safely (fetches the live definition, applies the ops, PATCHes the result). Provide EITHER operations OR definition — but connectionReferences may accompany EITHER, and when it accompanies operations the new entries and the edit land in one save. Use dryRun: true to preview the result without writing. Mirrors displayName changes into the Power Clarity cache (gFlows). To modify a WHOLE definition: call get_live_flow, mutate properties.definition (including its description), pass it here. The flow description lives at definition.description and is required; we append " #flowstudio-mcp" to it for usage tracking — that suffix counts toward Power Automate's description length limit, which rejects an over-long one with WorkflowDescriptionTooLong only after a full validation pass, so keep the note brief.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | Preview only, on BOTH paths: with flowName, apply the change to the live definition and return the result + what changed; without flowName, return the flow that WOULD be created. Nothing is written either way. | |
| flowName | No | Name (ID) of the flow to update. Omit or leave blank to create a new flow. | |
| definition | No | Full flow definition as a JSON object (triggers + actions + parameters + outputs + description). MUST be a JSON object — strings are rejected. Do not JSON.stringify the definition; pass the parsed object directly. Required when creating. For updates, obtain from get_live_flow (properties.definition), modify it, then pass the modified object here. definition.description is required (a short note about what changed); when updating, if you omit it we reuse the flow's existing description. | |
| operations | No | SURGICAL EDIT of an existing flow (requires flowName; do not combine with definition). An ordered list applied to the LIVE definition. Each item = { op, path, value? }. path is an ARRAY of literal keys, e.g. ["actions","Send_Email","inputs","parameters","subject"] (each element is one key; a "/" inside an element is literal, so it addresses SharePoint/Dataverse columns like ["actions","Update_Item","inputs","parameters","item/Title"]). ops: set (create/overwrite), add (new key — errors if it already exists), remove (delete key — no-op if absent), merge (deep-merge an object value, keeping sibling keys). | |
| displayName | No | Display name for the flow. Required when creating. | |
| environmentName | Yes | Name of the Power Platform environment. | |
| connectionReferences | No | Connection references map copied from get_live_flow. Direct-flow entries use { connectionName, id }. Solution-aware entries also include { connectionReferenceLogicalName, source } and must retain those fields exactly. A freshly migrated entry may instead be keyed by the physical connection name and carry no connectionName field at all — copy it back as-is. The action/trigger inputs.host.connectionName must match the map key; the physical connectionName stays inside the entry. Never invent a solution logical name. Adding a connectionReferenceLogicalName to an entry that lacks one does not always take: the save can return success without storing it, so re-read with get_live_flow to confirm. MAY BE PASSED ALONGSIDE operations: your entries are merged over the stored map and saved in the SAME request as the edit. That is how you add the first action for a connector the flow does not use yet — a reference saved on its own does not stick, because Power Automate prunes an entry no action references. Your entries win on a key collision. |