Skip to content

Build Power Automate flows with AI agents using Flow Studio MCP

A worked 3-step example showing how an AI agent reads, constructs, and deploys a real Power Automate cloud flow using Flow Studio MCP, with sample prompts you can copy.

AI agent build Power Automate guide

AI agent build Power Automate works in three steps with Flow Studio MCP: discover the connections in your environment, construct a valid Workflow Definition Language JSON, deploy via the update_live_flow tool. The agent does not need environment IDs, flow GUIDs, or connection IDs; it looks them up by name.

For the full agent install matrix across Copilot Studio, Codex, and other agents, see Install Flow Studio MCP for Power Automate.

What an AI agent does to build a Power Automate flow

An AI agent that has Flow Studio MCP installed can build a Power Automate cloud flow without you opening the Power Automate portal. You describe what you want in plain English. The agent then does three things: it discovers the connections available in your environment, it constructs a valid Microsoft Workflow Definition Language (WDL) JSON for the flow, and it deploys the flow using a single MCP tool call. The agent does not need you to provide environment IDs, flow GUIDs, or connection IDs. It looks them up by name.

Flow Studio MCP is an MCP server for Power Automate. It exposes 30+ tools to any MCP-compatible AI agent (GitHub Copilot, Claude, Microsoft Copilot Studio, OpenAI Codex, and others). The 3 tools that matter for build are list_live_connections, describe_live_connector, and update_live_flow.

A worked 3-step example: build an HR Onboarding notifier

Suppose you want to build a flow that runs every weekday at 9 AM, reads new employees from a SharePoint list, sends each one a welcome email, and posts a summary to a Teams channel.

You ask your agent:

Build a Power Automate flow in my Default environment.
Every weekday at 9 AM, read new items from the SharePoint list "HR_Onboarding"
on the johnliu365 site, send each new hire a welcome email via Outlook,
and post a summary to the #onboarding Teams channel. Call it HR Onboarding Notifier.
Step 1: Discover the connections

The agent calls list_live_environments to find your Default environment, then calls list_live_connections with that environment ID to discover which connectors are available. The agent confirms it has SharePoint, Outlook (Office 365), and Microsoft Teams connections, and captures the connection ID for each.

If a connector parameter takes a dropdown value (a SharePoint site ID, a Teams channel ID), the agent uses describe_live_connector with the operation ID, then get_live_dynamic_options to resolve the dropdown. This is the part that usually fails in older agentic flow builders. Flow Studio MCP exposes the dynamic-options metadata that the Power Automate API hides behind a UI.

Step 2: Construct the flow definition

The agent generates a Workflow Definition Language (WDL) JSON describing the flow. The structure includes a recurrence trigger (weekdays 9 AM), a Get Items action (SharePoint), an Apply to each loop, a Send Email action (Outlook), and a Post Message action (Teams). The agent assembles connection references using the IDs from Step 1, fills in dynamic parameters using the resolved dropdown values, and includes proper expression syntax for any column references.

You do not have to look at the JSON. The agent prepares it internally. If you want to inspect it before deploy, ask your agent: "show me the flow definition before deploying".

Step 3: Deploy the flow

The agent calls update_live_flow with the constructed WDL. Power Automate validates the definition, returns the new flow ID, and the agent reports back. Total time, from your initial prompt to a deployed flow: roughly 30 seconds.

If validation fails (a connector reference is wrong, an expression has a typo, a trigger argument is invalid), the agent reads the error response, fixes the issue, and retries. This is the loop that is impossible without an MCP server: the agent sees the actual validation error from Power Automate, not a generic top-level status code.

Sample prompts you can copy
  • "List my Power Automate flows in Default environment"
  • "Build a flow that triggers on new SharePoint list items in my Issues list and posts a card to the #issues channel in Teams"
  • "Create an approval flow: when a new file lands in the Contracts library, send approval to my manager, and on approval move the file to the Approved folder"
  • "Build a flow that runs every Monday at 8 AM, reads my Outlook calendar for the week, and posts the summary to my Teams chat"
  • "Modify the HR Onboarding flow to also create a Microsoft 365 group for new hires"
What works today across each agent
Claude Code for Power Automate

Claude (via the Claude Code VS Code extension or the CLI) handles all 3 steps reliably. Add the power-automate-build skill bundle from Flow Studio MCP and Claude follows a curated build recipe: discover, construct, deploy, validate. See the Claude install guide.

GitHub Copilot for Power Automate

GitHub Copilot Chat in VS Code handles build with the same pattern. Install the Power Automate MCP Server VS Code extension and Copilot Chat picks up the MCP server automatically. The 5 bundled skills (build, debug, monitor, discover, governance) are available as agent skills.

Microsoft Copilot Studio for Power Automate

A Copilot Studio agent with Flow Studio MCP wired in (see the Copilot Studio install guide) can build flows for any M365 Copilot user in your tenant directly from Teams chat. Build is slower than Claude or GitHub Copilot because of the chat-orchestration model, but it works.

OpenAI Codex for Power Automate

Codex Desktop and Codex CLI both work. The Codex CLI requires you to add mcp.flowstudio.app to the network allow-list (Codex blocks network by default). See the Codex install guide.

Frequently asked questions
Can an AI agent really build a Power Automate flow without me opening the portal?

Yes. With Flow Studio MCP installed, your agent uses the update_live_flow MCP tool to deploy a complete flow definition directly to Power Automate. The flow appears in your portal already deployed.

Does this work with custom connectors?

Yes. describe_live_connector works against any connector you have access to in your environment, including custom HTTP connectors and certified third-party connectors.

What happens if the AI agent generates an invalid flow?

Power Automate returns a validation error with the specific issue (invalid expression, unknown column, missing required parameter). Flow Studio MCP exposes this error to the agent via get_live_flow_run_error and get_live_flow_run_action_outputs, so the agent can fix it and retry. Microsoft Graph API only returns top-level status, which is why agents without Flow Studio MCP often get stuck in a build loop.

Can I use this with Microsoft Copilot Studio agents that already exist?

Yes. Wire Flow Studio MCP into an existing Copilot Studio agent and the build skill becomes available to every M365 Copilot user in your tenant. No per-user install required.

Is Flow Studio MCP a Microsoft product?

No. Flow Studio MCP is an independent MCP server made by Flow Studio. It is not affiliated with, endorsed by, or sponsored by Microsoft Corporation. It calls the Power Platform API on your behalf using your API key.

How much does it cost to try?

The free evaluation gives you 100 API calls over 21 days, no credit card required. Most build sessions use 5 to 15 calls. See mcp.flowstudio.app for full pricing.

Next steps

Flow Studio is an independent product and is not affiliated with, endorsed by, or sponsored by Microsoft Corporation. Microsoft, Power Automate, Power Platform, and Copilot are trademarks of the Microsoft group of companies. Claude is a trademark of Anthropic. GitHub Copilot is a trademark of GitHub, Inc. (a Microsoft subsidiary).