PDF Image Extraction and GPT-4o Analysis Automation - n8n Workflow

Use this comprehensive n8n workflow to automatically extract images from PDF documents stored in Google Drive, analyze them using OpenAI's GPT-4o multimodal model, and compile the final report into a single text file.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Research Analysts: Quickly extract and analyze visual data from large research papers or reports. Content Managers: Automate the auditing and summary generation of image content within published PDF assets. Automation Specialists: Users seeking advanced examples of integrating multimodal AI (GPT-4o) and external APIs (ConvertAPI) within a single n8n node sequence. n8n Developers: Anyone looking for practical n8n templates showcasing complex file manipulation and AI logic.

Overview

Handling PDF documents, especially those dense with imagery, often requires manual inspection and content summation. This robust n8n workflow eliminates that tedious process. It starts by pulling a PDF from Google Drive, leverages ConvertAPI to expertly extract all embedded images, and then passes each image URL to the OpenAI GPT-4o n8n node for detailed analysis. The primary value of this n8n automation lies in its ability to scale visual intelligence. By utilizing this n8n template, users can quickly generate summaries and detailed reports on visual content, significantly speeding up data processing and research tasks. This powerful n8n solution ensures that all visual data is accurately analyzed and compiled.

How it Works

This automation is initiated by an n8n trigger, though the recommended setup is using a Google Drive trigger for live file processing.


  1. Trigger and Retrieval: The n8n workflow starts (via manual n8n trigger or preferred alternative). It then uses the Google Drive n8n node to download a specified PDF file.

  2. Image Extraction: The downloaded PDF binary data is sent to the ConvertAPI via an HTTP Request n8n node. ConvertAPI extracts all images, saves them temporarily, and returns URLs for the extracted images.

  3. Data Preparation: The Split Out n8n node separates the list of extracted images into individual items. A Set n8n node then cleans the data, specifically isolating the image URL ($json.Url) for the subsequent AI step.

  4. AI Analysis (GPT-4o): The core intelligence happens here. The OpenAI n8n node, configured to use the powerful GPT-4o model, receives the image URL and runs a detailed analysis based on the provided prompt.

  5. Result Compilation (Per Image): A subsequent Set n8n node integrates both the original image URL and the newly generated GPT-4o analysis content into a single item.

  6. Final Integration: A critical Code n8n node aggregates all the individual analysis results from every image, stitching them together into one large content variable.

  7. Output Generation: Finally, the Convert To File n8n node takes this compiled analysis content and outputs it as a readable .txt file.

Installation Guide

To deploy and run this sophisticated n8n workflow, follow these steps:


  1. Import: Copy the provided n8n workflow JSON code and paste it into your n8n instance using the 'New' > 'Import from JSON' option.

  2. Credential Setup: This n8n template requires three main credentials to function correctly:

Google Drive: Set up OAuth2 credentials for the 'Get pdf file' n8n node to allow access to your files.
Convert API: Configure the HTTP Header Authentication credentials for the 'Extract pdf image' n8n node, using your Convert API key.
* OpenAI: Configure your API key credentials for the 'Analyze image' n8n node.

  1. File Configuration: In the 'Get pdf file' n8n node, replace the placeholder fileId with the actual ID of the PDF document you wish to process.

  2. Testing: Click 'Test workflow' on the manual n8n trigger to ensure the entire flow executes correctly and produces the analyzed text file.

Node Details

When clicking ‘Test workflow’ (Manual Trigger): Serves as the initial n8n trigger to start the process manually. In production, this n8n node should be swapped for an event-based trigger, such as Google Drive or webhook.
Get pdf file (Google Drive n8n node): Downloads the target PDF document using a specific fileId. The operation is set to download.
Extract pdf image (HTTP Request n8n node): Calls the ConvertAPI endpoint (/pdf/to/extract-images) via a POST request. It uses the PDF binary data as File in a multipart form data body, configured to output JPG images.
Get image data (Split Out n8n node): Essential for looping. It takes the array of files returned by ConvertAPI and creates a separate workflow item for each extracted image.
Analyze image (OpenAI n8n node): The core AI n8n node. It uses the analyze operation with the GPT-4o model. It takes the image URL from the previous step as input for analysis.
Integrate all content to a a content (Code n8n node): This custom JavaScript n8n node collects the results from all preceding steps and merges the content property from every item into one unified text string.


  • Output content to a .txt file (Convert to File n8n node): The final step of the n8n workflow, which formats the compiled analysis text into a file ready for storage or further action.

Related n8n Workflows

Free

Nodes: 9 Nodes
Updated: December 26 2025
View all
Created by

Featured*