Announcements
Hi everyone,
I am building an automated reporting agent in Copilot Studio that is connected to a Power Automate flow. My goal is for a user to upload a PDF, have the flow extract data using an AI Builder prompt, update a SharePoint list, and send a formatted email.
The Workflow:
Trigger: "When an agent calls the flow" (Input: File type named contentBytes).
Logic: AI Builder extraction -> SharePoint "Update Item" -> Outlook Send Email.
Frontend: Copilot Agent with the flow added as a Tool.
The Issues I am facing:
TriggerInputSchemaMismatch: Even though the flow trigger is set to the "File" type, I consistently receive a BadRequest with the error code TriggerInputSchemaMismatch.
flowActionBadRequestThe flow 'Weekly Report Automator' ('bxx15a4-3xxd-fxxx1-002xxx30c9d6') failed to run with response code 'BadRequest', error code: TriggerInputSchemaMismatch.
The "Content Bytes" Loop: When testing the agent, the AI fails to automatically grab the uploaded file. Instead, it responds with: "Please provide the content bytes of the PDF file you have uploaded."
Power Fx Errors: I attempted to map the input in the Tools > Inputs tab using formulas like First(Activity.Attachments).contentBytes or Index(System.LastMessage.Attachments, 1), but the editor returns errors such as:
"Identifier not recognized: 'Activity' or 'Attachments'."
"The function 'First' has some invalid arguments."
Naming Sync: I have tried renaming the flow and the input parameters (changing from MIR_Report_ to contentBytes) and re-adding the tool multiple times, but the agent still fails to pass the binary data of the file to the flow.
Questions:
All and all, I am not able to connect my flow to my agent because of this schema mismatch in the files/attachments, so how can i solve it ?
What is the "Gold Standard" way to map an attachment from a chat message to a Flow Action? Is there a specific Power Fx property we should be using (e.g., .ContentBytes, .FullName, or .OData_Type)?
How can we prevent the 'TriggerInputSchemaMismatch'? It feels like the Agent UI and the Power Automate OpenAPI definition are out of sync regarding what constitutes a "File" object.
What is the currently supported Power Fx syntax to extract the contentBytes from an attachment within the Agent Tools/Actions interface? (I have attached screenshots of my Flow trigger, the Tool input mapping, and the System Error screen for reference.)
How to solve the schema mismatch issue Right now, the safest way is to avoid passing File type directly from the agent. Instead:
Change the flow input from File → Text (string) or pass a file reference (name/path/id)
Then inside the flow, use Get file content or reconstruct the file
This avoids the TriggerInputSchemaMismatch completely.
“Gold standard” way to pass attachments Currently, the most reliable pattern is:
Agent → pass metadata (file name / id / link) → Flow retrieves file
Direct binary (contentBytes) passing from agent → flow is not fully reliable yet.
How to prevent TriggerInputSchemaMismatch This happens when the input schema in flow (File type) does not match what the agent actually sends.
To prevent it:
Keep inputs as simple types (string, object)
Avoid File type unless the source strictly supports it
Re-add the flow after schema changes (important)
Supported Power Fx for attachments As of now, expressions like:
First(System.Activity.Attachments)
System.LastMessage.Attachments
are not supported in tool input mapping, which is why you’re seeing errors.
There is currently no stable/supported Power Fx pattern to directly extract contentBytes from attachments in this interface.
So in summary, nothing is wrong with your setup — this is a platform limitation + schema mismatch between agent and flow. Using a reference-based approach instead of direct file passing is the most stable solution today.
Hope this helps.
If this helps resolve your issue, please consider marking the response as Verified so it can help others facing a similar scenario.
If you found this helpful, you can also click “Yes” on “Was this reply helpful?” or give it a Like.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Valantis 813
Vish WR 313
Haque 271