flowstudio-power-automate-build

Build, scaffold, and deploy Power Automate cloud flows using the FlowStudio MCP server. Your agent constructs flow definitions, wires connections, deploys, and tests — all via MCP without opening the portal. Load this skill when asked to: create a flow, build a new flow, deploy a flow definition, sc

By github · 1,962 installs

npx skills add github/awesome-copilot --skill flowstudio-power-automate-build

Source repository · Upstream listing

Build & Deploy Power Automate Flows with FlowStudio MCP Step by step guide for constructing and deploying Power Automate cloud flows programmatically through the FlowStudio MCP server. Prerequisite : A FlowStudio MCP server must be reachable with a valid JWT. See the flowstudio power automate mcp skill for connection setup. Subscribe at https://mcp.flowstudio.app Workflow: 1. Load current build tools. 2. Check for an existing flow. 3. Resolve connection references. 4. Build the definition. 5. Deploy. 6. Verify. 7. Test. Source of Truth Always call list skills / tool search first to confirm available tool names and parameter schemas. Tool names and parameters may change between server versions. This skill covers response shapes, behavioral notes, and build patterns — things tool schemas cannot tell you. If this document disagrees with tool search or a real API response, the API wins. Python Helper 0. Load the Current Build Tools For a brand new flow, load the server's create flow bundle. For editing an existing flow, load build flow . This keeps the agent aligned with the MCP server's current schema before constructing JSON. If you need a tool outside the bundle, load it explicitly: 1. Safety Check: Does the Flow Already Exist? Always look before you build to avoid duplicates: For very large environments, list live flows may return a continuation URL. Pass it back as continuationUrl with the same mode to retrieve the next batch. Use mode="admin" only when the user needs all environment flows and the MCP identity has admin rights. 2. Obtain Connection References Every connector action needs a connectionName that points to a key in the flow's connectionReferences map. That key links to an authenticated connection in the environment. MANDATORY : You MUST call list live connections first — do NOT ask the user for connection names or GUIDs. The API returns the exact values you need. Only prompt the user if the API confirms that required connections are missing. 2a — Find active connections For a known connector, pass search to reduce output and get paste ready connectionReferenceTemplate and hostTemplate values: 2b — Determine which connectors the flow needs Common connector API names: SharePoint shared sharepointonline , Outlook shared office365 , Teams shared teams , Approvals shared approvals , OneDrive shared onedriveforbusiness , Excel shared excelonlinebusiness , Dataverse shared commondataserviceforapps , Forms shared microsoftforms . Flows that need no connectors, such as Recurrence + Compose + HTTP only, can omit connectionReferences . 2c — If connections are missing, guide the user 2d — Build the connectionReferences block In Step 3 action JSON, inputs.host.connectionName must be the map key such as shared teams , not the GUID. The GUID belongs only inside the connectionReferences[connector].connectionName value. If an existing flow uses the same connectors, you may also copy its properties.connectionReferences from get live flow . 3. Build the Flow Definition Construct the definition object. See [flow schema.md](references/flow schema.md) for the full schema and these action pattern references for copy paste templates: [action patterns core.md](references/action patterns core.md) — Variables, control flow, expressions [action patterns data.md](references/action patterns data.md) — Array transforms, HTTP, parsing [action patterns connectors.md](references/action patterns connectors.md) — SharePoint, Outlook, Teams, Approvals See [build patterns.md](references/build patterns.md) for complete, ready to use flow definitions covering Recurrence+SharePoint+Teams, HTTP triggers, and more. Discover connector operations before guessing JSON For connector backed triggers/actions, prefer the live connector describer over hand written shapes. It can return authored hints, canonical examples, variant keys, inputs/outputs, and dynamic metadata pointers. When an operation has multiple authored variants, request the variant the flow needs: When the operation description says a parameter has dynamic options or dynamic properties, call the indicated next tool: Use dynamic options for dropdown IDs such as SharePoint sites/lists and Teams teams/channels. Use dynamic properties for schema/field shapes such as SharePoint list item columns. 4. Deploy (Create or Update) update live flow handles both creation and updates in a single tool. Create a new flow (no existing flow) Omit flowName — the server generates a new GUID and creates via PUT: Update an existing flow Provide flowName to PATCH: ⚠️ update live flow always returns an error key. null (Python None ) means success — do not treat the presence of the key as failure. ⚠️ Flow description lives at definition["description"] . The current server appends flowstudio mcp for usage tracking. Do not pass a top level description argument unless tool search shows one in the active schema. Common deployment errors Error message (contains) Cause Fix missing from connectionReferences An action's host.connectionName references a key that doesn't exist in the connectionReferences map Ensure host.connectionName uses the key from connectionReferences (e.g. shared teams ), not the raw GUID ConnectionAuthorizationFailed / 403 The connection GUID belongs to another user or is not authorized Re run Step 2a and use a connection owned by the current x api key user InvalidTemplate / InvalidDefinition Syntax error in the definition JSON Check runAfter chains, expression syntax, and action type spelling ConnectionNotConfigured A connector action exists but the connection GUID is invalid or expired Re check list live connections for a fresh GUID 5. Verify the Deployment 6. Test the Flow MANDATORY : Before triggering any test run, ask the user for confirmation . Running a flow has real side effects — it may send emails, post Teams messages, write to SharePoint, start approvals, or call external APIs. Explain what the flow will do and wait for explicit approval before calling trigger live flow or resubmit live flow run . Updated flows (have prior runs) — ANY trigger type Use resubmit live flow run first. It works for EVERY trigger type — Recurrence, SharePoint, connector webhooks, Button, and HTTP. It replays the original trigger payload. Do NOT ask the user to manually trigger the flow or wait for the next scheduled run. HTTP, Button, and PowerApps flows — custom test payload Only use trigger live flow when you need to send a different payload than the original run. For verifying a fix, resubmit live flow run is better because it uses the exact data that caused the failure. Brand new non HTTP flows A brand new Recurrence flow needs no workaround: deploy it, then run it immediately with trigger live flow and no body — same as the portal's "Run flow" button. A body is refused; scheduled triggers take no inputs. A brand new connector triggered flow (SharePoint, webhooks) has no prior runs and cannot fire without a real source event. Deploy with a temporary HTTP trigger, test the actions, then swap to the production trigger: The trigger is only the entry point; testing through HTTP still exercises the same actions. If actions use triggerBody() or triggerOutputs() , pass a representative body shaped like the production trigger payload. Gotchas Mistake Consequence Prevention Missing connectionReferences in deploy 400 "Supply connectionReferences" Always call list live connections first "operationOptions" missing on Foreach Parallel execution, race conditions on writes Always add "Sequential" union(old data, new data) Old values override new (first wins) Use union(new data, old data) split() on potentially null string InvalidTemplate crash Wrap with coalesce(field, '') Checking result["error"] exists Always present; true error is != null Use result.get("error") is not None Flow deployed but state is "Stopped" Flow won't run on schedule Call set live flow state with state: "Started" — do not use update live flow for state changes Teams "Chat with Flow bot" recipient as object 400 GraphUserDetailNotFound Use plain string with trailing semicolon (see below) Copilot/Skills flow not in a solution Copilot Studio may not discover it as an agent tool After deploy, call add live flow to solution with the target solutionId Button/Skills trigger used for MCP testing Runs even when a required input is missing (null) Pass inputs in trigger live flow body ; on warning , cancel and retry with the full body Connector action missing metadata.operationMetadataId Designer/run only UI can behave inconsistently Preserve existing IDs; add stable GUIDs for new connector actions Placeholder Excel scriptId Dynamic validation fails at save time Resolve the real Office Script ID before deploying SharePoint PatchItem omits required fields Save can fail even if the field is not changing Echo unchanged required fields such as item/Title Copilot Studio connector calls a draft agent Connector invocation can fail or hit stale behavior Publish the agent before testing/resubmitting the flow Teams PostMessageToConversation — Recipient Formats The body/recipient parameter format depends on the location value: Location body/recipient format Example Chat with Flow bot Plain email string with trailing semicolon "user@contoso.com;" Channel Object with groupId and channelId {"groupId": "...", "channelId": "..."} Common mistake : passing {"to": "user@contoso.com"} for "Chat with Flow bot" returns a 400 GraphUserDetailNotFound error. The API expects a plain string. Reference Files [flow schema.md](references/flow schema.md) — Full flow definition JSON schema [trigger types.md](references/trigger types.md) — Trigger type templates [action patterns core.md](references/action patterns core.md) — Variables, control flow, expressions [action patterns data.md](references/action patterns data.md) — Array transforms, HTTP, parsing [action patterns connectors.md](references/action patterns connectors.md) — SharePoint, Outlook, Teams, Approvals [build patterns.md](references/build patterns.md) — Complete flow definition templates (Recurrence+SP+Teams, HTTP trigger) Related Skills flowstudio power automate mcp — Core connection setup and tool reference flowstudio power automate debug — Debug failing flows after deployment