Hello,
We are experiencing a consistent bug in Microsoft Copilot Studio when trying to publish flows that contain a "Run an agent" action.
**Environment:** Microsoft 365 / Power Platform (Commercial, Production)
**Error Message:**
Flow server error returned with status code "BadGateway" and details "DynamicSchemaResponseNotSchema"
**Steps to Reproduce:**
1. Create a flow in Copilot Studio Designer
2. Add any action (e.g., HTTP request, Send an email, etc.)
3. Add a "Run an agent" action step
4. Click the "Publish" button
**Expected Behavior:**
The flow should publish successfully.
**Actual Behavior:**
Publishing fails immediately with the error: "Flow server error returned with status code 'BadGateway' and details 'DynamicSchemaResponseNotSchema'"
**Key Observation:**
- This error ONLY occurs when the flow contains a "Run an agent" action step.
- When we remove the "Run an agent" action from the flow, publishing works perfectly with no errors.
- We have 4 different flows affected by this issue, all containing "Run an agent" steps.
**Affected Flows:**
We have 4 flows in our environment that are affected by this issue. All of them share a common structure that includes a "Run an agent" action step (e.g., Manually trigger → HTTP → Run an agent → Send an email).
**Impact:**
We are completely unable to publish any flow that uses the "Run an agent" action, which is a core feature of Copilot Studio. This is blocking our production workflows.
Please investigate this issue. It appears to be a server-side bug related to how the "Run an agent" action's dynamic schema response is validated during the publish process.
Thank you.