Automated Image Extraction from Google Drive Documents using VLM Agent - n8n Workflow

Use this advanced n8n workflow template to automatically monitor Google Drive uploads, extract embedded images from documents using a VLM agent, and save the extracted files back to Drive. Master complex file operations with the Google Drive n8n node and custom flow control.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Data Processing Specialists: Users who need to standardize and extract visual data from high volumes of documents like reports or PDFs.
Finance/Accounting Teams: Automating the extraction of images (receipts, scans) from expense reports or documents uploaded to Drive.
n8n Automation Experts: Those looking for complex n8n templates demonstrating asynchronous processing (trigger/callback webhook pattern).
AI Integrators: Users seeking to integrate Vision Language Models (VLM Run) seamlessly into their cloud storage pipelines.

Overview

Manually sifting through documents in Google Drive to find and extract embedded images is time-consuming and error-prone. This sophisticated n8n workflow solves this by creating a fully automated pipeline. The moment a document is uploaded to a monitored Google Drive folder, the process begins. The document is sent to a specialized Vision Language Model (VLM Run) agent, which intelligently analyzes the content and extracts all image URLs. These URLs are then posted back to the n8n system via a dedicated webhook. The remainder of the n8n workflow handles the downloading of each image and its final storage in a clean, designated output folder in Google Drive. This powerful n8n node combination ensures robust, scalable image asset management.

How it Works

This automation operates in two distinct phases, leveraging the asynchronous capabilities of the VLM Run agent and a dedicated n8n trigger and webhook.

Phase 1: Monitoring and Agent Submission


  1. Monitor Uploads (Google Drive Trigger): The workflow begins with a Google Drive n8n trigger, which continuously monitors a specific input folder for new file uploads (fileCreated). This is the starting n8n trigger.

  2. Download File (Google Drive n8n node): Upon detection, the n8n workflow downloads the document file using the ID provided by the trigger.

  3. Extract Images (VLM Run Agent): The binary data of the document is passed to the VLM Run n8n node. This node executes an agent specifically designed for image extraction and provides a callback webhook URL. This concludes the first execution chain of the n8n workflow.

Phase 2: Receiving, Splitting, and Saving


  1. Receive Image Links (Webhook n8n node): The VLM Run agent asynchronously posts the extracted image URLs back to the designated n8n webhook path (image-extract-via-agent). This acts as the second, crucial n8n trigger point.

  2. Split Out (n8n node): The received JSON payload often contains multiple image links. The Split Out n8n node iterates over the list of URLs (body.response.extracted_images), ensuring each URL is processed individually.

  3. Download Image (HTTP Request n8n node): For each URL, an HTTP Request n8n node downloads the content, treating the response as a binary file.

  4. Save Image (Google Drive n8n node): Finally, the binary image file is uploaded and saved into the configured destination Google Drive folder (Extracted Image). This completes the n8n automation process.

Installation Guide

To deploy this powerful n8n workflow template, follow these steps:


  1. Import the n8n workflow: Copy the provided JSON and import it directly into your n8n instance.

  2. Google Drive Credentials: You need valid Google Drive OAuth2 credentials set up. Apply these credentials to the Monitor Uploads (n8n trigger), Download File, and Save Image n8n node instances.

  3. VLM Run Credentials: Configure your VLM Run API credentials and apply them to the Extract Images n8n node.

  4. Configure Folders: In the Monitor Uploads n8n trigger, specify the Folder ID for the documents you wish to process. In the Save Image n8n node, specify the Folder ID where the extracted images should be stored.

  5. Set up the Webhook Callback:

a. Activate the Receive Image Links n8n webhook node and copy its Production URL.
b. In your VLM Run agent configuration (or directly in the Extract Images n8n node parameters), ensure this exact n8n webhook URL is set as the callback URL (agentCallbackUrl), allowing the agent to return the results to this n8n workflow segment.

Node Details

Monitor Uploads (Google Drive Trigger): This critical n8n trigger initiates the entire process. It is configured to watch a specific folder (testdata) for the fileCreated event, polling every minute.
Download File (Google Drive): Uses the file ID from the initial n8n trigger to fetch the document's binary content, storing it under the property name data.
Extract Images (VLM Run): Executes a specific VLM agent. Key configuration includes defining the agentPrompt (instructions for image extraction) and the agentCallbackUrl, which must point to the Receive Image Links webhook n8n node.
Receive Image Links (Webhook): Serves as the second entry point for the n8n workflow, expecting a POST request containing the extracted image URLs from VLM Run. The path is set to image-extract-via-agent.
Split Out (n8n node): Essential for handling multiple outputs. It splits the input data based on the array body.response.extractedimages, generating a separate item for each image URL to allow parallel processing by subsequent n8n nodes.
Download Image (HTTP Request): Dynamically uses the URL provided by the Split Out n8n node ({{ $json['body.response.extracted_images'] }}) to download the image file content.


  • Save Image (Google Drive): Takes the binary image file and saves it to the target folder (Extracted Image). This final n8n node ensures permanent storage of the extracted assets.

Related n8n Workflows

Free

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

I’m Shahrear, a Software Engineer with over 5 years of experience in full-stack development and workflow automation. I specialize in building intelligent automations using n8n, helping teams streamline operations and boost productivity. I’m also an expert in developing custom n8n nodes, with published work on npm - including the @vlm-run/n8n-nodes-vlmrun package. Linkedin - https://www.linkedin.com/in/shahrear-amin/ Email - [email protected]

Featured*