Skip to content

fix(power-automate): v3.0.3 — Asia region, solution flow edits, publish state - #412

Open
Matt Townsend (radioblazer) wants to merge 3 commits into
mainfrom
fix/power-automate-v3.0.2
Open

fix(power-automate): v3.0.3 — Asia region, solution flow edits, publish state#412
Matt Townsend (radioblazer) wants to merge 3 commits into
mainfrom
fix/power-automate-v3.0.2

Conversation

@radioblazer

@radioblazer Matt Townsend (radioblazer) commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary

Seven bug fixes for the power-automate plugin, released as v3.0.3.

Both manifests (.plugin/plugin.json and .claude-plugin/plugin.json) and the bundled server (server/mcp.mjs) are updated together. The branch name still says v3.0.2 because the v3.0.3 fixes were added to this branch after it was opened; the shipped version is v3.0.3.


Fixes

#347 — Asia-region tenants: every operation fails

list_environments and all subsequent Flow RP calls now detect MacroRegionDerivationFailed, extract the geo name from the error, and retry against the geo-specific endpoint (for example asia.api.flow.microsoft.com). The resolved endpoint is reused for the rest of the session. Previously every operation failed for any tenant whose environments are provisioned in the Asia region.

#407publish_flow reports success while the flow stays Stopped

publish_flow now reads the flow back after /start and returns the observed state as actualState. If the flow did not reach Started — for example because a connection is missing or unauthenticated — the tool returns success: false with an actionable warning. Previously a 409 Conflict was mapped to alreadyStarted: true regardless of the real state.

#414, #416 — solution flows unresolvable after publishing

get_flow_context looked the Dataverse row up by the PPAPI flow id. Publishing reassigns that id while Dataverse keeps the original workflowid, so the lookup returned 404, the flow was reported as inSolution: false, and writes were routed down the PPAPI path — which cannot express a connection-reference binding.

The lookup now uses workflowEntityId and workflowUniqueId from the PPAPI response, falling back to the flow id when they are absent. This also covers the case where one flow is addressable by two valid PPAPI ids.

#415, #418 — definition edits rejected on solution flows

Two problems on the Dataverse write path:

  • Host key convention. get_flow returns host.connectionName, but a flow's stored clientdata may use either connectionName or connectionReferenceName depending on how it was authored. The write now reads which convention the stored definition already uses and matches it, rather than assuming one. Writing the wrong key produced WorkflowRunActionInputsMissingProperty, naming an action the edit never touched.
  • Connection references. The write no longer copies PPAPI-format connectionReferences into clientdata, which would have overwritten the Dataverse-format references already stored there.

#392, #416 — spurious "No connected connection found"

autoMergeConnectionRefs filtered Dataverse connection reference rows on a status field those rows do not have, so every candidate was dropped and the tool reported no connected connection for a connector that demonstrably had one.

The filter now understands both row shapes. Fixing it surfaced a second, latent defect: the resolved reference was built from fields Dataverse rows do not expose, yielding an undefined connection name and silently writing a malformed reference. The reference is now built from the correct fields, carries the connection reference logical name through, and raises an actionable error instead of writing a malformed reference when no id can be read.

edit_flow also now carries the flow's current connection references into the update body, and autoResolveConnectionRefs is exposed on both edit_flow and update_flow so auto-merge can be disabled by callers that supply their own references.


Testing

  • 978 unit tests passing, including 7 new regression tests covering both host-key directions, the workflow id lookup and its fallback, clientdata connection references left untouched, and the auto-merge reference shape in both the resolvable and unreadable cases.
  • Clean build from matow_microsoft/flow-agent main.
  • Live smoke test against a real environment: passed in 16.7s.

Note for reviewers

Automated review reports "only the plugin version fields changed" because the third changed file, plugins/power-automate/server/mcp.mjs, is a 2.5 MB generated bundle that is skipped during review. All of the behaviour described above lives in that bundle; the corresponding source changes are in matow_microsoft/flow-agent.

The host-key detection for #415/#418 is inferred from the reported reproductions rather than confirmed against a tenant holding a connectionReferenceName-shaped flow. It is written to match whatever the stored definition already uses, so it degrades to current behaviour rather than breaking if that inference is wrong, but confirmation against a real affected flow would be worthwhile.

…efs, publish state

Three bug fixes on top of v3.0.1:

- Asia region (#347): list_environments now auto-detects
  MacroRegionDerivationFailed, extracts the geo name from the error, and
  retries with the geo-specific Flow RP endpoint (e.g.
  asia.api.flow.microsoft.com). All subsequent Flow RP calls in the
  session use the geo endpoint. Fixes all FlowAgent operations for
  tenants whose environments are provisioned in the Asia region.

- Solution-flow connection refs (#392): edit_flow now includes the
  flow's connectionReferences map in the PPAPI PATCH body whenever
  logical-name rewrites are performed. Without it PPAPI could not
  resolve the connection reference name and returned
  WorkflowRunActionInputsInvalidProperty mid-session.

- publish_flow state verification (#407): publishFlow verifies the
  actual flow state after calling /start via a getFlow round-trip and
  returns actualState in the response. If the flow is not Started,
  the tool returns success:false with an actionable warning (missing or
  unauthenticated connection). Previously a 409 Conflict was silently
  treated as 'already started' regardless of the real state.
@radioblazer
Matt Townsend (radioblazer) requested a review from a team as a code owner August 12, 2026 22:30
Copilot AI lite review requested due to automatic review settings August 12, 2026 22:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the power-automate plugin metadata version to v3.0.2 (and its legacy mirror). The PR description, however, describes three functional bug fixes (#347/#392/#407) that are not present in the provided diffs.

Changes:

  • Bump plugins/power-automate/.plugin/plugin.json version from 3.0.13.0.2.
  • Bump plugins/power-automate/.claude-plugin/plugin.json version from 3.0.13.0.2 (legacy mirror).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
plugins/power-automate/.plugin/plugin.json Updates the Open Plugins manifest version to 3.0.2.
plugins/power-automate/.claude-plugin/plugin.json Updates the legacy manifest mirror version to 3.0.2.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 2 to 4
"name": "power-automate",
"version": "3.0.1",
"version": "3.0.2",
"description": "Build, edit, run, and debug Power Automate cloud flows via the FlowAgent MCP server — connection lifecycle, surgical edits, copy across environments, run management, and validated expressions.",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The third changed file, plugins/power-automate/server/mcp.mjs, is a 2.5 MB generated bundle and is skipped by automated review, which is why only the two manifests appear here. All of the behaviour described in the PR body lives in that bundle; the corresponding source changes are in matow_microsoft/flow-agent.

The PR description has been rewritten to match what is actually shipping (v3.0.3, seven fixes), and both manifests are consistent at 3.0.3. The branch name still reads �3.0.2 because the later fixes were added after the branch was opened.

…#416, #418)

Fixes four bugs affecting edits to solution flows:

- getFlowContext: use workflowEntityId/workflowUniqueId for Dataverse lookup
  (post-publish ID reassignment caused 404 → wrong write path)
- updateFlowViaDataverse: rewrite host.connectionName → host.connectionReferenceName
  before writing clientdata (PPAPI reads connectionName; Dataverse stores
  connectionReferenceName — verbatim copy caused WorkflowRunActionInputsMissingProperty)
- updateFlowViaDataverse: do not copy PPAPI-format connectionReferences into
  Dataverse clientdata (would corrupt Dataverse-format refs stored there)
- autoMergeConnectionRefs: accept Dataverse connectioninstance rows that have
  no status field (old filter returned 0 candidates → spurious connection error)

Also threads autoResolveConnectionRefs through editFlow, and editFlow now includes
current connectionReferences in the update body.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 13, 2026 23:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (2)

plugins/power-automate/.plugin/plugin.json:4

  • The plugin manifest version is bumped to 3.0.3, but the PR title/description says this is the v3.0.2 release. Please align the release version across the PR metadata and the manifests so consumers can correlate the published package with the changelog/issues being fixed.
  "name": "power-automate",
  "version": "3.0.3",
  "description": "Build, edit, run, and debug Power Automate cloud flows via the FlowAgent MCP server — connection lifecycle, surgical edits, copy across environments, run management, and validated expressions.",

plugins/power-automate/.claude-plugin/plugin.json:4

  • The legacy mirror manifest is also set to version 3.0.3, which conflicts with the PR title/description indicating v3.0.2. Please ensure both manifests and the PR metadata refer to the same release version.
  "name": "power-automate",
  "version": "3.0.3",
  "description": "Build, edit, run, and debug Power Automate cloud flows via the FlowAgent MCP server — connection lifecycle, surgical edits, copy across environments, run management, and validated expressions.",

…ites

Corrects two defects in the previous v3.0.3 commit.

- The Dataverse clientdata write unconditionally renamed host.connectionName to
  host.connectionReferenceName. Solution flows do not all use the same
  convention, and rewriting unconditionally risked breaking flows whose stored
  definition uses connectionName. The write now reads which convention the
  flow's stored definition already uses and matches it, so it is correct for
  either shape and a no-op for definitions with no connector hosts.

- autoMergeConnectionRefs built its resolved reference from fields that
  Dataverse connection reference rows do not expose, producing a reference with
  an undefined connection name. It now reads the correct field, carries the
  connection reference logical name through, and raises an actionable error
  instead of writing a malformed reference when no id can be read.

Adds 7 regression tests covering both host-key directions, the workflow id
lookup and its fallback, and the auto-merge reference shape.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 13, 2026 23:46
@radioblazer Matt Townsend (radioblazer) changed the title fix(power-automate): v3.0.2 — Asia region, solution-flow connection refs, publish state fix(power-automate): v3.0.3 — Asia region, solution flow edits, publish state Aug 13, 2026
@radioblazer

Matt Townsend (radioblazer) commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

Updated to v3.0.3 — adds fixes for #414, #415, #416, #418

Four root causes behind the solution-flow edit failures:

Issue Fix
#414 / #416 get_flow_context looked the Dataverse row up by the PPAPI flow id. Publishing reassigns that id while Dataverse keeps the original workflowid, so the lookup returned 404, reported inSolution: false, and sent the write down the PPAPI path that cannot express a connection-reference binding. Now uses workflowEntityId / workflowUniqueId from the PPAPI response, falling back to the flow id.
#418 / #415 The Dataverse clientdata write now matches whichever host key convention the flow's stored definition already uses (connectionName or connectionReferenceName) instead of assuming one.
#418 The Dataverse write no longer copies PPAPI-format connectionReferences into clientdata, which would overwrite the Dataverse-format references stored there.
#416 autoMergeConnectionRefs filtered Dataverse connection reference rows on a status field they do not have, dropping every candidate and reporting "No connected connection found" for a connector that demonstrably had one. It now reads those rows correctly, including the connection id and logical name, and raises an actionable error rather than writing a malformed reference if the id cannot be read.

Also: autoResolveConnectionRefs is now exposed on edit_flow and update_flow so auto-merge can be turned off, and edit_flow carries the flow's current connection references into the update body.

Testing: 978 unit tests passing, including 7 new regression tests pinning both host-key directions, the workflow id lookup and its fallback, and the auto-merge reference shape. Live smoke test passed in 16.7s.


Edited to repair mangled characters in the original version of this comment, and to bring the PR description in line with what is actually shipping.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants