Skip to content

OpenAI Codex for Power Automate (No Code Editor)

Connect OpenAI Codex to Power Automate so you can build, debug, and operate cloud flows from a chat instead of the portal. This guide uses the Codex Desktop app — no code editor and no command line.

How Codex works with Power Automate

Codex is OpenAI's AI agent. It has no native access to Microsoft Power Automate (Microsoft's cloud workflow automation service, part of the Power Platform), so on its own it cannot see your flows. You give it access by adding FlowStudio MCP, an MCP server for Power Automate. Once registered with Codex, it can call around 20 Power Automate tools: list flows, read run history, inspect action-level inputs and outputs, build new flows, and fix broken ones. MCP (the Model Context Protocol) is the standard way to plug a tool into an AI agent.

Codex is a separate product from Microsoft Copilot, GitHub Copilot, and Copilot Studio, which have their own guides.

Before you start

You need two separate logins:

  • A ChatGPT account — to sign in to Codex. The free tier works; ChatGPT Free currently includes limited trial access to Codex.
  • A Microsoft 365 work or school account with a Power Automate license — the account where your flows live. This is usually your work email. Standard Power Automate is included in most Microsoft 365 business and enterprise plans; premium connectors and some features need a paid Power Automate license. A personal Gmail or Outlook.com account will not work — it does not have business Power Automate.

FlowStudio's free Starter plan needs no credit card: 100 API calls over 21 days. The whole setup takes about ten minutes, all in a settings screen.

Step 1: Get the Codex app

You almost certainly already use ChatGPT — that is where you get Codex. No command line, no developer tools.

  1. Go to chatgpt.com and sign in. The free account is fine.
  2. In the left sidebar, click Codex. (If a "Work faster with Codex" pop-up appears, you can use that instead.)
  3. Click Download for Windows, then open the file it downloads to install the app.
ChatGPT with Codex highlighted in the left sidebar and the Download for Windows button in the Work faster with Codex pop-up

If Windows shows a SmartScreen warning, that is normal for a brand-new app — choose the option to run it anyway. It is the official OpenAI app.

On a Mac? The same Codex menu in ChatGPT has a Mac download.

Step 2: Sign in and pick a folder

Open the Codex app you just installed and sign in with the same ChatGPT account. The free tier works. (Have an OpenAI API key instead? You can use that too, but the ChatGPT sign-in is simpler.)

Codex then asks you to choose a folder to work in. You are not writing code, so this does not really matter — just point it at any empty folder. Make a new folder (your Desktop is fine), name it Codex Power Automate Test, and pick that. Codex only uses it as a home base; your actual flows live in Power Automate, not in this folder.

Step 3: Get your FlowStudio key

This is the key that lets Codex reach your flows. Get it in your browser:

  1. Go to mcp.flowstudio.app and click Get Started.
  2. Sign in with your Microsoft 365 work or school account — the one where your flows live. (If you sign in with the wrong account, Codex will not see your flows later.)
  3. Click Start Free. This is the free Starter plan: 100 calls over 21 days, no credit card.
  4. Grant the Power Platform consent for both Power Automate and Power Apps. Both must show Connected before the key is issued. If only one is connected, finish the other.
  5. Copy the API key from the Your API Key section. It is a long token (a JWT) — a long string of letters and numbers. Keep it somewhere safe for the next step; treat it like a password.
The Your API Key section on mcp.flowstudio.app showing the masked key with a copy button and the MCP endpoint
Step 4: Add the MCP server in Codex

Do this in the Codex Desktop app, not the ChatGPT.com app connectors area. On ChatGPT.com, custom MCP apps are mainly an admin feature for Business, Enterprise, and Edu workspaces — going through Codex Desktop gives you more control as an individual.

In the Codex Desktop app, open Settings > MCP servers > Add server and fill in the form:

  • Name: anything you like, for example flowstudio.
  • Transport: leave the default.
  • URL: https://mcp.flowstudio.app/mcp
  • Bearer token env var: leave this empty. This is the number one mistake. Do not put your key here. If you do, Codex sends an Authorization: Bearer header, which FlowStudio rejects with a 401 error and no clear reason. Skip this field entirely.
  • Headers: add one row. Key is x-api-key — lowercase, spelled x, dash, a, p, i, dash, k, e, y. Paste your API key (the long string from Step 3) into the Value field.
Codex Desktop Connect to a custom MCP form: URL https://mcp.flowstudio.app/mcp, Bearer token env var left empty, and a Headers row with key x-api-key and the JWT as the value

Leave "Bearer token env var" empty. Put the key in a Headers row named x-api-key.

Click Save.

Advanced and optional: Codex also has a "Headers from environment variables" option if you would rather not paste the key into the form. Most people should skip this and just paste the key as above.

Step 5: Check it connected

Codex picks up the connection right away — no restart needed. In the MCP servers settings, your new server should show as connected and list its tools (around 20 — read flows, read run history, build and update flows, resubmit runs, and more). If it lists tools, you are done. If it shows an error, jump to Troubleshooting below.

Step 6: Your first prompt

In the Codex chat, type a plain-English request, for example:

"List my Power Platform environments"

If it comes back with the environments from your tenant, the connection works and you can start asking it about your flows. (This prompt uses one of your 100 free Starter calls.)

What you can do once Codex is connected
You say to Codex What happens
"List my Power Automate flows in the Default environment"Returns the flows in that environment by name.
"Why did my HR Sync flow fail this morning?"Reads the run history, opens the failed action, and tells you the actual error message and the inputs that caused it.
"Show me the inputs and outputs of the last Invoice Processing run"Returns the action-level detail you would otherwise click through in the portal.
"Build a flow that posts to Teams when a new item is added to my Issues list"Works out the connections, builds the flow, and deploys it to your environment.
"Fix the expression error in that flow and update it"Patches the flow definition and saves the change back to Power Automate.
"Resubmit yesterday's failed run"Re-runs it with the same trigger data.
Sample prompts you can copy
  • "List my Power Platform environments"
  • "List my Power Automate flows and tell me which ones failed in the last week"
  • "Why is my Invoice Processing flow failing? Read the latest run and find the root cause."
  • "Build a Power Automate flow that emails me when a new file lands in the Reports document library"
  • "Explain in plain English what my Approval Routing flow actually does"
Troubleshooting
  • You get a 401 or authentication error. You either put your key in the Bearer token env var field (leave it empty) or your header name is wrong. The header must be x-api-key — all lowercase, with the hyphen. X-Api-Key or Authorization will not work. Delete the server, add it again, and put the key only in a header row named x-api-key.
  • Your API key never appears on mcp.flowstudio.app. The key is only issued after both Power Automate and Power Apps show Connected. Finish the second consent, then copy the key.
Frequently asked questions

Can I connect OpenAI Codex to Power Automate without writing code?

Yes. Use the Codex Desktop app, not a code editor. Install Codex Desktop on Windows, sign in with a ChatGPT account, and add FlowStudio MCP as an MCP server in Settings. MCP is the standard way to plug a tool into an AI agent. Once connected, Codex can read, debug, and build your Power Automate flows from a chat. You do not need a code editor or a developer setup.

What logins do I need to connect Codex to Power Automate?

Two. A ChatGPT account to sign in to Codex (the free tier works), and a Microsoft 365 work or school account with a Power Automate license, where your flows live. Standard Power Automate is included in most Microsoft 365 business and enterprise plans; premium connectors need a paid license. A personal Gmail or Outlook.com account will not work — it does not have business Power Automate.

Why does Codex give a 401 or authentication error with FlowStudio MCP?

The most common cause is using the Bearer token field. Leave the Bearer token env var field empty. FlowStudio does not accept an Authorization: Bearer header. Instead add a header row with the key x-api-key (lowercase, with the hyphen) and your API key as the value. A wrong header name or wrong case also causes a 401.

Is connecting Codex to Power Automate free?

ChatGPT Free currently includes limited trial access to Codex, so you can run Codex without paying — but it is a trial with the lowest usage limits, not unlimited. FlowStudio MCP has a free Starter plan: 100 API calls over 21 days, no credit card.

Should I add FlowStudio MCP as a ChatGPT connector instead?

Not for this guide. Use the Codex Desktop app. On ChatGPT.com, custom MCP apps are mainly an admin feature for Business, Enterprise, and Edu workspaces, so going through Codex Desktop gives you more control as an individual.

Is FlowStudio MCP affiliated with OpenAI or Microsoft?

No. FlowStudio MCP is an independent product made by FlowStudio. It is not affiliated with, endorsed by, or sponsored by OpenAI or Microsoft. It uses the open Model Context Protocol to talk to Codex and the Power Platform API to talk to Power Automate.

Next steps

FlowStudio is an independent product and is not affiliated with, endorsed by, or sponsored by OpenAI or Microsoft. OpenAI and Codex are trademarks of OpenAI. Microsoft, Microsoft 365, Power Automate, Power Platform, and Copilot are trademarks of the Microsoft group of companies.