Hi Everyone,
I am facing a limitation while trying to access and process larger files from SharePoint / OneDrive inside a Copilot Studio agent.
Scenario
I have a Copilot Studio agent where I need to read documents from SharePoint / OneDrive and validate the content. The files can be PDF, DOCX, XLSX, PPTX, etc.
The current approach is:
- Use Work IQ SharePoint / SharePoint tool to identify the required file.
- Use Get file content using path connector action/tool to retrieve the file.
- Return the file content back to the agent.
Issue observed
For smaller files, the connector/tool call may complete. But when the file is larger, the agent is not able to process the returned content properly.
I have tried multiple approaches:
- Work IQ SharePoint tool
- It identifies the file/metadata.
- But when trying to read the file content, it shows that
readSmallTextFile supports only text-based files under 5 MB.
- Example: one PDF file was around 8.07 MB, so it could not be retrieved/read directly.
- SharePoint / OneDrive “Get file content using path” connector action as a tool
- The connector action completes successfully.
- Output returned is
{File Content}.
- However, the file content is large and the agent fails while trying to process it.
- Flow using Get file content using path
- I also tried calling the same connector action through a flow and returning the output to the agent.
- The flow/action completed successfully, but once the response is returned to the agent, agents fail with the payload is too large error.
Errors received
I received the following errors in different attempts:
Error Message: The output returned from the connector was too large to be handled by the agent. Try reducing its size by utilizing available connector filters or by limiting the number of configured action outputs.
Error Code: AsyncResponsePayloadTooLarge
Error Message: An error has occurred while processing the PDF. Please ensure the document is not empty and does not exceed the maximum number of pages allowed.
Error Code: InvalidPdf
Sorry, something went wrong.
Error code: SystemError.
Official limits I found
From Microsoft documentation, Copilot Studio web app limits mention:
- Connector payload: 5 MB for public cloud plans.
- The
AsyncResponsePayloadTooLarge error means a real-time connector is returning a payload larger than the agent can handle.
This explains why even if SharePoint / Flow can technically retrieve the file, returning that raw file content to the agent fails.
My question
What is the recommended Microsoft-supported workaround for processing files larger than 5 MB inside Copilot Studio agents when the file must be read dynamically from SharePoint / OneDrive?
Specifically, I am looking for guidance on:
- How to process SharePoint / OneDrive files larger than the 5 MB connector payload limit.
- Whether there is a supported way to chunk file content and send it to the agent in multiple calls.
Expected behavior
I need the agent to dynamically read a selected SharePoint / OneDrive document and validate the contents, even when the document is larger than 5 MB.
Current blocker
The connector/tool can retrieve the file, but the response cannot be handled by the agent because:
- The returned file content is binary.
- The file/payload can exceed the Copilot Studio connector payload limit.
- Large PDF/DOCX content cannot be passed back to the agent directly.
- Returning file content through flow still hits the same “too large response” issue.
Has anyone implemented a reliable pattern for this scenario?
Any recommended architecture or workaround would be very helpful.