---
title: OpenAI Codex for Power Automate (No Code Editor)
description: Connect OpenAI Codex to Power Automate using the Codex Desktop app and FlowStudio MCP. Read, debug, and build flows from a chat, no code editor.
---

[Skip to content](https://learn.flowstudio.app/codex-power-automate#main-content)

[![Flow Studio](https://learn.flowstudio.app/hs-fs/hubfs/flow-studio-transparency.png?width=90&height=90&name=flow-studio-transparency.png)](https://flowstudio.app)

- [FlowStudio App](https://learn.flowstudio.app/)
  
  Show submenu for FlowStudio App 
  
    - [Getting Started](https://learn.flowstudio.app/getting-started)
    - [Full Text Search](https://learn.flowstudio.app/full-text-search)
    - [Flow Diagram](https://learn.flowstudio.app/flow-diagram)
    - [Clipboard & Library](https://learn.flowstudio.app/clipboard)
    - [Restore a Flow](https://learn.flowstudio.app/restore-power-automate)
    - [Migrate and Deploy](https://learn.flowstudio.app/migrate-flows)
    - [Bulk Export Flows](https://learn.flowstudio.app/bulk-export-flows)
    - [More Info for IT](https://learn.flowstudio.app/more-info-for-it)
- [MCP](https://learn.flowstudio.app/mcp-getting-started)
  
  Show submenu for MCP 
  
    - [Getting Started](https://learn.flowstudio.app/mcp-getting-started)
    - [Which Agent to Use](https://learn.flowstudio.app/mcp-which-agent-power-automate)
    - [Connect Without Admin Consent](https://learn.flowstudio.app/mcp-browser-key)
    - [Build Flows with AI](https://learn.flowstudio.app/build-power-automate-flows-with-ai-agents)
    - [Vibe Code Flows](https://learn.flowstudio.app/vibe-code-power-automate)
    - [Power Automate in VS Code](https://learn.flowstudio.app/power-automate-ide)
    - [Debug Flows](https://learn.flowstudio.app/mcp-debug)
    - [MCP Tools Reference](https://learn.flowstudio.app/mcp-tools)
    - [Copilot Agent Skills](https://learn.flowstudio.app/mcp-copilot-skills)
    - [Compare with Microsoft MCP](https://learn.flowstudio.app/compare/flowstudio-mcp-vs-microsoft-power-automate-mcp)
    - [Pricing & Plans](https://learn.flowstudio.app/mcp-pricing)
    - [Manage Tenant Plan](https://learn.flowstudio.app/mcp-tenant-plan-admin)
- [FlowStudio AI](https://learn.flowstudio.app/flowstudio-ai)
- [Teams](https://learn.flowstudio.app/flowstudio-for-teams)
  
  Show submenu for Teams 
  
    - [Manage Workspace](https://learn.flowstudio.app/teams-workspace)
    - [Adding Permissions](https://learn.flowstudio.app/teams-add-permission)
    - [Flow Monitoring](https://learn.flowstudio.app/teams-monitoring)
    - [Flow Report](https://learn.flowstudio.app/teams-report)
- [Blog](https://learn.flowstudio.app/blog)
- [FAQ](https://learn.flowstudio.app/faq)
- [Personal Data](https://learn.flowstudio.app/personal-data)

Open main navigation

Close main navigation

- [FlowStudio App](https://learn.flowstudio.app/)
  
  Show submenu for FlowStudio App 
  
    - [Getting Started](https://learn.flowstudio.app/getting-started)
    - [Full Text Search](https://learn.flowstudio.app/full-text-search)
    - [Flow Diagram](https://learn.flowstudio.app/flow-diagram)
    - [Clipboard & Library](https://learn.flowstudio.app/clipboard)
    - [Restore a Flow](https://learn.flowstudio.app/restore-power-automate)
    - [Migrate and Deploy](https://learn.flowstudio.app/migrate-flows)
    - [Bulk Export Flows](https://learn.flowstudio.app/bulk-export-flows)
    - [More Info for IT](https://learn.flowstudio.app/more-info-for-it)
- [MCP](https://learn.flowstudio.app/mcp-getting-started)
  
  Show submenu for MCP 
  
    - [Getting Started](https://learn.flowstudio.app/mcp-getting-started)
    - [Which Agent to Use](https://learn.flowstudio.app/mcp-which-agent-power-automate)
    - [Connect Without Admin Consent](https://learn.flowstudio.app/mcp-browser-key)
    - [Build Flows with AI](https://learn.flowstudio.app/build-power-automate-flows-with-ai-agents)
    - [Vibe Code Flows](https://learn.flowstudio.app/vibe-code-power-automate)
    - [Power Automate in VS Code](https://learn.flowstudio.app/power-automate-ide)
    - [Debug Flows](https://learn.flowstudio.app/mcp-debug)
    - [MCP Tools Reference](https://learn.flowstudio.app/mcp-tools)
    - [Copilot Agent Skills](https://learn.flowstudio.app/mcp-copilot-skills)
    - [Compare with Microsoft MCP](https://learn.flowstudio.app/compare/flowstudio-mcp-vs-microsoft-power-automate-mcp)
    - [Pricing & Plans](https://learn.flowstudio.app/mcp-pricing)
    - [Manage Tenant Plan](https://learn.flowstudio.app/mcp-tenant-plan-admin)
- [FlowStudio AI](https://learn.flowstudio.app/flowstudio-ai)
- [Teams](https://learn.flowstudio.app/flowstudio-for-teams)
  
  Show submenu for Teams 
  
    - [Manage Workspace](https://learn.flowstudio.app/teams-workspace)
    - [Adding Permissions](https://learn.flowstudio.app/teams-add-permission)
    - [Flow Monitoring](https://learn.flowstudio.app/teams-monitoring)
    - [Flow Report](https://learn.flowstudio.app/teams-report)
- [Blog](https://learn.flowstudio.app/blog)
- [FAQ](https://learn.flowstudio.app/faq)
- [Personal Data](https://learn.flowstudio.app/personal-data)

 Contact Us

# 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](https://mcp.flowstudio.app?utm_source=hubspot&utm_medium=content&utm_campaign=learn-codex), 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](https://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](https://learn.flowstudio.app/hubfs/mcp-learn-articles/screenshots/codex-chatgpt-get-app.png)**Figure:** ChatGPT with Codex in the left sidebar; click Download for Windows to install the desktop app.

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](https://mcp.flowstudio.app?utm_source=hubspot&utm_medium=content&utm_campaign=learn-codex) 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](https://learn.flowstudio.app/hubfs/mcp-learn-articles/screenshots/apikey-quickstart.png)**Figure:** Your API Key on mcp.flowstudio.app: copy the long token (a JWT) for the next step.

## 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](https://learn.flowstudio.app/hubfs/mcp-learn-articles/screenshots/codex-connect-custom-mcp-hl.png)**Figure:** The Codex Desktop Connect to a custom MCP form: the server URL and the key added as an x-api-key header row.

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

Click **Save**.

**Most common mistake:** the header name must be `x-api-key`, all lowercase with the hyphen. ✓ `x-api-key`   ✗ `X-Api-Key`   ✗ `Authorization: Bearer`

*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 plugin instead?**

You can now do either. FlowStudio is available as a ChatGPT plugin that signs you in through your browser, covered in [ChatGPT for Power Automate](https://learn.flowstudio.app/chatgpt-power-automate?hsLang=en). Codex Desktop is still the better fit if you already work alongside files on your machine.

**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

- [Not sure which AI agent to use?](https://learn.flowstudio.app/mcp-which-agent-power-automate?hsLang=en) Compare Codex, ChatGPT, Claude, Copilot Studio, and the others.
- [Full FlowStudio MCP setup guide for all agents](https://learn.flowstudio.app/mcp-getting-started?hsLang=en), including the Codex CLI config if you want it.
- [Build Power Automate flows with AI agents](https://learn.flowstudio.app/build-power-automate-flows-with-ai-agents?hsLang=en)
- [Start your free evaluation](https://mcp.flowstudio.app?utm_source=hubspot&utm_medium=content&utm_campaign=learn-codex): 100 calls, 21 days, no credit card.

**What does FlowStudio MCP show that the Graph API doesn’t?**

The Graph and Web APIs tell your agent a run failed. FlowStudio MCP tells it which action failed, the inputs that triggered it, and the exact error, so the agent can fix it.

*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.*

[![Flow Studio](https://learn.flowstudio.app/hs-fs/hubfs/flow-studio-transparency.png?width=90&height=90&name=flow-studio-transparency.png "Flow Studio")](https://flowstudio.app)

flowstudio.app

---

[Go to FlowStudio MCP](https://mcp.flowstudio.app/)

[Go to FlowStudio App](https://flowstudio.app/)

[youtube icon](https://www.youtube.com/playlist?list=PLXiXrMydfoLYzS-Ya3yOmYvfEyLbkXhpQ) [linkedin-in icon](https://www.linkedin.com/company/flow-studio-solutions/about/) [envelope icon](mailto:support@flowstudio.app) [link icon](https://flowstudio.app/)

Copyright © 2026, Flow Studio Solutions

```json
{
  "@context" : "https://schema.org",
  "@type" : "FAQPage",
  "mainEntity" : [ {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "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."
    },
    "name" : "Can I connect OpenAI Codex to Power Automate without writing code?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "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, because it does not have business Power Automate."
    },
    "name" : "What logins do I need to connect Codex to Power Automate?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "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."
    },
    "name" : "Why does Codex give a 401 or authentication error with FlowStudio MCP?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "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."
    },
    "name" : "Is connecting Codex to Power Automate free?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "You can now do either. FlowStudio is available as a ChatGPT plugin that signs you in through your browser. Codex Desktop is still the better fit if you already work alongside files on your machine."
    },
    "name" : "Should I add FlowStudio MCP as a ChatGPT plugin instead?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "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."
    },
    "name" : "Is FlowStudio MCP affiliated with OpenAI or Microsoft?"
  }, {
    "@type" : "Question",
    "acceptedAnswer" : {
      "@type" : "Answer",
      "text" : "The Graph and Web APIs tell your agent a run failed. FlowStudio MCP tells it which action failed, the inputs that triggered it, and the exact error, so the agent can fix it."
    },
    "name" : "What does FlowStudio MCP show that the Graph API doesn’t?"
  } ]
}
```

```json
{
  "@context" : "https://schema.org",
  "@type" : "HowTo",
  "description" : "Install the Codex Desktop app, sign in with a ChatGPT account, get a FlowStudio MCP key, and add the MCP server so Codex can read, debug, and build Power Automate cloud flows. No code editor.",
  "name" : "Connect OpenAI Codex to Power Automate via FlowStudio MCP",
  "step" : [ {
    "@type" : "HowToStep",
    "name" : "Get the Codex app",
    "text" : "Go to chatgpt.com and sign in (the free account works). In the left sidebar, click Codex, then click Download for Windows and open the downloaded file to install. If Windows shows a SmartScreen warning, choose the option to run it anyway. A Mac download is available from the same Codex menu."
  }, {
    "@type" : "HowToStep",
    "name" : "Sign in and pick a folder",
    "text" : "Open the Codex app and sign in with your ChatGPT account (the free tier works, with limited trial access). When Codex asks for a folder to work in, create an empty folder named Codex Power Automate Test and select it. Your flows live in Power Automate, not in this folder."
  }, {
    "@type" : "HowToStep",
    "name" : "Get a FlowStudio MCP key",
    "text" : "Go to mcp.flowstudio.app, click Get Started, sign in with your Microsoft 365 work or school account, click Start Free, then grant consent for both Power Automate and Power Apps so both show Connected. Copy the API key (a long string) from the Your API Key section."
  }, {
    "@type" : "HowToStep",
    "name" : "Add the MCP server in Codex",
    "text" : "In Codex Desktop, open Settings, MCP servers, Add server. Set the URL to https://mcp.flowstudio.app/mcp. Leave the Bearer token env var field empty. In Headers, add a row with key x-api-key (lowercase, with the hyphen) and paste your API key as the value. Save."
  }, {
    "@type" : "HowToStep",
    "name" : "Verify the connection",
    "text" : "Codex picks up the connection immediately, no restart. Check that the server connects and lists its tools in Settings."
  }, {
    "@type" : "HowToStep",
    "name" : "Run your first prompt",
    "text" : "Ask Codex: List my Power Platform environments. If it returns your environments, the connection works."
  } ]
}
```