Handling Large PDF Files in Logic Apps + GPT Workflow

Madhu Prasad 20 Reputation points
2026-08-04T17:25:27.48+00:00

I have built an Azure Logic Apps workflow that:

  1. Monitors a SharePoint location for new PDF files.
  2. Extracts text from the PDF.
  3. Sends the extracted content to a GPT agent/persona for information extraction and summarization.
  4. Receives the structured response in JSON format.
  5. Parses the JSON and writes the output to a SharePoint-hosted Excel table.

The workflow works well for most documents. However, it fails for certain PDFs that contain a large number of embedded images or have a large overall file size, resulting in token/context limit errors when sending the document content to the GPT persona model.

To address this, I also experimented with parsing the document and splitting it into smaller token-based chunks before sending the content to the GPT persona. Unfortunately, the process still fails during the document parsing stage itself for some large or image-heavy PDFs, before chunking can even occur.

I'm interested in learning how others have addressed similar challenges. Specifically:

  • Best practices for processing large contract documents that exceed model token limits.
  • Approaches for handling image-heavy PDFs.
  • Chunking or section-based processing strategies that preserve document context.
  • Architectures that work well with Logic Apps and Azure OpenAI for large-document extraction workflows.

Any recommendations, lessons learned, or reference architectures would be greatly appreciated. Thanks!

Azure Logic Apps
Azure Logic Apps

An Azure service that automates the access and use of data across clouds without writing code.


Answer accepted by question author
Gursimran Singh 570 Reputation points Microsoft External Staff Moderator
2026-08-04T21:56:39.2833333+00:00

Hi @Madhu Prasad ,

Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

Based on your description, it appears the bottleneck is occurring during the PDF parsing/extraction stage rather than at the GPT processing stage. Since chunking can only happen after the document is successfully parsed, splitting the content into smaller chunks will not help if parsing fails first.

For large or image-heavy PDFs, consider using Azure AI Document Intelligence to extract text and layout information before sending the content to Azure OpenAI. These types of documents often contain scanned pages or embedded images that can make standard PDF parsing unreliable. Once the content has been successfully extracted, it can then be chunked and processed by GPT more effectively. [learn.microsoft.com], [azure.microsoft.com], [Parse Docu...soft Learn | Learn.Microsoft.com]

Please accept as Yes if the answer is helpful so that it can help others in the community.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Newest

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.