
Description
This n8n workflow automates the process of retrieving images from a specific Google Drive folder, resizing them, and inserting them into a Google Docs document.
It ensures images are processed in numeric order, automatically resized to fit the document, and uploaded in batches to prevent timeouts.
This template is designed for content creators, documentation teams, and businesses who need to automatically insert images (e.g., product photos, reports, or scanned documents) into Google Docs with minimal manual effort.
How it works
- Retrieves image files from a Google Drive folder.
- Filters and sorts files based on numeric order in the filename.
- Generates direct image URIs and resizes them automatically (width & height).
- Inserts the resized images into the target Google Docs document via API.
- Uses a batch loop to avoid timeouts and ensure all images are uploaded successfully.
Requirements / Pre-conditions
- An n8n instance (self-hosted or cloud).
- Connected Google Drive credential in n8n.
- Connected Google Docs credential in n8n.
- A target Google Drive folder containing supported image files.
- A Google Docs document ready to receive the images.
- Supported formats: PNG, JPG, JPEG, GIF, WEBP.
Error handling: If a file is not an image or exceeds Google Docs API limits, the workflow will skip it and continue processing the rest.
Setup Steps
- Google Drive Credential
Connect your Google Drive account in n8n to grant access to the folder containing the images.
- Google Docs Credential
Connect your Google Docs account to allow image insertion into the document.
- Folder & File Filter
In the Search File node, replace the placeholder {{YOUR_FOLDER_ID}} with your Google Drive folder ID.
- Google Docs Document ID
In the Insert Image (HTTP Request) node, replace {{YOUR_DOCUMENT_ID}} with your target Google Docs document ID.
(Make sure you rename this node to something descriptive, e.g., Insert Image to Google Doc.)
- Batch Loop
The workflow includes a batch processing loop to prevent timeout errors when dealing with large sets of images. You can adjust the batch size if needed.
- Run the workflow
Execute the workflow, and images will be automatically retrieved, resized, and inserted into the document.
Customization
- Resize Dimensions: Adjust the width/height in the Image Resize node to fit your document’s style.
- Ordering Logic: Modify the sorting step if you want alphabetical or upload-date order instead of numeric order.
- Error Notifications: Add an email or Slack node to notify you when an image fails to insert.
- Image Placement: By default, images are appended. You can adjust the insert logic (e.g., after specific headings).