web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Large SharePoint/OneDr...
Copilot Studio
Suggested Answer

Large SharePoint/OneDrive files fail in Copilot Studio tools and flows

(1) ShareShare
ReportReport
Posted on by 2

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:

  1. Use Work IQ SharePoint / SharePoint tool to identify the required file.
  2. Use Get file content using path connector action/tool to retrieve the file.
  3. 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:

  1. 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.
  2. 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.
  3. 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:

  1. How to process SharePoint / OneDrive files larger than the 5 MB connector payload limit.
  2. 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.

Categories:
I have the same question (0)
  • Suggested answer
    Haque Profile Picture
    3,653 on at
    Hi @VB-03020721-0,
     
    The core challenge you face is that large files (over 5 MB) and binary content cannot be passed directly back to the Copilot Studio agent due to payload size limits and the binary nature of the data.
     
    Here are some workarounds:
     
    • Use Chunking or Pagination: Instead of returning the entire file content at once, split the document into smaller chunks (e.g., by pages or sections) within your Power Automate flow. Then, pass only the relevant chunk to the agent for processing or validation.

    • Pre-Process and Extract Text Outside the Agent: Use Power Automate or Azure Cognitive Services (e.g., Form Recognizer, OCR) to extract and preprocess the text content from the document before passing it to the agent. Store the extracted text in a temporary storage (Dataverse, Azure Blob Storage, or SharePoint) and have the agent query or retrieve only the processed text.

    • Use External Storage and Reference Passing: Instead of passing the file content, pass a reference (URL or ID) to the stored file or extracted content. The agent can then request or query the relevant parts dynamically.

    • Convert Binary to Base64 with Caution: While converting binary content to Base64 is possible, it increases payload size by about 33%, making it less suitable for large files.

     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!

     

  • VB-03020721-0 Profile Picture
    2 on at
    Hi @Haque,

    Thank you for the response and for sharing these workaround ideas. They are helpful, but in my scenario they do not fully solve the issue.

    For chunking/pagination, the challenge is that when a flow is used in Copilot Studio, it starts with When an agent calls the flow and ends with Respond to the agent. So even if the flow retrieves the file using Get file content using path, the final full data still has to be returned to the agent (No way for chunking the file and return chunks recursively). If the response is large, it again fails with AsyncResponsePayloadTooLarge. Also, the SharePoint connector returns binary file content, so chunking raw binary does not help the agent read the document.

    For preprocessing/OCR/external storage: our files are not fixed. They keep growing daily across different SharePoint/OneDrive folders and subfolders. Setting up OCR, temporary storage, indexing, and querying for every possible file would add a lot of overhead. Most files are normal Word documents or text-based PDFs, so OCR also feels like overengineering.

    For passing only a URL/reference, the agent still needs a supported way to read that referenced file in smaller readable parts. Otherwise, the same connector payload/output limit applies.

    For Base64, as mentioned, it increases payload size and is not practical for multiple file types like PDF, DOCX, XLSX, and PPTX.

    Please feel free to correct me if any of my understanding is incorrect, or if there is a recommended implementation pattern that I have not considered.

    Thanks again for the suggestions. I am still looking for a practical supported implementation pattern for this specific limitation.

  • Suggested answer
    Vish WR Profile Picture
    3,748 on at
     
    Chunking via flow, pre-processing with Azure Form Recognizer/OCR and storing extracted text externally, passing a URL reference instead of raw content, or Base64 encoding

    The real problem: The user pushed back on all of these — in Copilot Studio flows, the entire response still has to come back via a single "Respond to the agent" step, so chunking doesn't help. Files are also dynamic and grow daily across many folders, making pre-processing/OCR pipelines impractical overhead for mostly normal Word docs and text PDFs.

     

  • Suggested answer
    chiaraalina Profile Picture
    2,425 Super User 2026 Season 1 on at
     
    Microsoft’s recommended pattern is to process and chunk documents outside the agent, then let the agent query only relevant text snippets:
    • Index SharePoint/OneDrive documents in Azure AI Search
    • Use integrated chunking and vectorization
    • Connect Azure AI Search as a knowledge source in Copilot Studio
    • The agent retrieves only the top relevant chunks + citations, not the full file
    This avoids payload limits and scales cleanly to large and numerous documents.

    If you have a Microsoft 365 Copilot license and enable Work IQ, Copilot Studio can use Microsoft’s semantic index for SharePoint. In that case:
    • SharePoint files up to ~200 MB are supported
    • No raw file content is returned to the agent
    • The agent reasons over indexed content instead of connector payloads
    This is the simplest option if your tenant already has M365 Copilot licensing.
     
    Hope it helps!
     
     

     
  • Suggested answer
    Sajeda_Sultana Profile Picture
    189 on at
     
    You're actually on the right track. What you're seeing is a current limitation of Copilot Studio rather than an issue with your implementation.
     
    Copilot Studio has a response size limit (approximately 5 MB) for actions and Power Automate flows. Because of this limit:
    • Large files such as PDFs, Word documents, and Excel files cannot be passed directly to the agent for processing.
    • Splitting the file into smaller chunks doesn't help, because the total response still needs to fit within the same limit.
    • Returning file content as binary or Base64 data will also hit the size restriction.
    So, unfortunately, Copilot Studio isn't designed to process large document contents directly.
     
    Recommended Approach
    Instead of sending the file itself to Copilot Studio, send only the file location and process the document outside the agent.
     
    A common architecture looks like this:
    Copilot Studio
    Sends the file path (SharePoint, OneDrive, etc.)
    Sends the user's question
    ⬇️
    Power Automate
    Passes the file path and question to an Azure Function (or another backend service)
    ⬇️
    Azure Function
    Reads the file directly from storage
    Extracts and analyzes the content
    Optionally uses Azure OpenAI for summarization, validation, or Q&A
    Returns only a small response back to Copilot Studio
    ⬇️
    Copilot Studio
    Receives the concise response
    Displays the result to the user
     
    This approach works well because the large file never needs to pass through Copilot Studio, and only the final answer is returned to the agent.
     
    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.
    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).
    🏷️ For follow-ups  @Sajeda_Sultana
  • Suggested answer
    Haque Profile Picture
    3,653 on at
    Hi @VB-03020721-0,
     
    Interestingly,  you  requirement and concern both are valid. 
     
    Unfortunately, there is no out-of-the-box, fully supported way for Copilot Studio agents to dynamically read large SharePoint/OneDrive files in smaller chunks directly from a URL or reference without hitting payload limits.
     
     
    I agree with   - That's the only recommended approach right now based on your requirement hitting recommended approaches that   mentioned. 
     
     
    Plus:  The recommendation remains from my side are:
    • Pre-extract and preprocess text content outside the agent, on demand, focusing on text-based files (Word, text PDFs).
    • Store extracted text or summaries in a structured data store (Dataverse, SharePoint list) that the agent can query in small pieces.
    • Use caching and incremental retrieval at the data store/query level, not at the flow response level.
    • Avoid passing raw binary or full file content back to the agent.
    Reference:
    1. Text extraction from file in Copilot Studio - How?
    2. Copilot Studio quotas and limits
    3. Pass files to agent flows, connectors, and tools
     
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
     
  • Vish WR Profile Picture
    3,748 on at
     
    wanted to check if you were able to resolve your issue ?
     
    Please  Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like 
    Visit my blog My Tech Space    LinkedIn  

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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 277

#2
11manish Profile Picture

11manish 206

#3
sannavajjala87 Profile Picture

sannavajjala87 156 Super User 2026 Season 1

Last 30 days Overall leaderboard