Set up an n8n workflow to automatically compress images in Google Drive using the Tinify API, move originals to an archive, log savings, and send daily reports via Gmail. Explore this powerful n8n template for file optimization.
Download this n8n workflow template and start using it instantly.
Digital agencies or webmasters needing to optimize large batches of images for faster loading speeds.
Users looking for advanced examples of integrating external APIs (like Tinify) within an n8n workflow.
Technical users wanting to automate cloud storage file operations (Google Drive) and detailed logging using n8n templates.
Developers seeking a reliable, scheduled n8n trigger for daily maintenance tasks.
Maintaining large Google Drive folders of images often results in inefficient storage and slow load times. This robust n8n workflow solves this by providing a hands-off, scheduled image optimization solution. Utilizing a powerful schedule n8n trigger, the system wakes up daily, identifies images in a designated input folder, and sends them to the Tinify compression API. The n8n workflow manages the entire file lifecycle: downloading the original file via a Google Drive n8n node, uploading the compressed version back to Google Drive, archiving the uncompressed file, and meticulously logging the performance gains (original size vs. compressed size) in an n8n Data Table. Finally, it uses a custom code n8n node to aggregate this data and send a professional, detailed compression report via Gmail. This end-to-end automation ensures efficient cloud storage management and guaranteed file optimization using a sophisticated n8n template.
This powerful n8n workflow operates in four main phases:
Daily at 08:00 am n8n trigger initiates the process every morning. A unique processingid is generated immediately by the Generate Processing Id n8n node to track all logs related to this specific run.Get all files Google Drive n8n node fetches a list of files from the Google Drive input folder. This list is then split into two parallel paths using Loop Over Original Files and Loop Over Processed Files n8n nodes for sequential compression and archiving.Load Raw Image Google Drive n8n node downloads the file. The Tiny URL API Call n8n node sends the binary data for compression using the external Tinify API. Once compressed, the workflow fetches the result using Download Compressed Image and saves it via the Save to Remove Background Google Drive n8n node into the designated 'Compressed' folder. Crucially, the Processing Logs n8n node records metrics like original size, compressed size, and the file ID in a structured Data Table. The archiving path simultaneously moves the original file using the Move Files to the Folder /Original Google Drive n8n node.Collect Logs n8n node retrieves all data associated with the current processingid. The Generate Report code n8n node compiles this data into a comprehensive HTML report, calculating the total data saved. Finally, the Send Report Gmail n8n node delivers the detailed summary report to the recipient's inbox, showcasing the efficiency of this n8n workflow.To deploy this automated n8n workflow, follow these setup steps:
Input, Compressed, and Original Images Archive. Update the Folder IDs in the Get all files, Save to Remove Background, and Move Files to the Folder /Original n8n node configurations. Ensure your Google Drive credential is set up correctly in all relevant n8n nodes.api as the Username and your Tinify API key as the Password. Update the Tiny URL API Call n8n node to use this credential.fileName, originalSize, compressedSize, imageId, outputUrl, and processingId. Update the Data Table ID in both the Processing Logs and Collect Logs n8n nodes.Send Report n8n node. Update the recipient email address (currently marked as lYOUREMAIL> ) within the Send Report n8n node parameters.The complex file management and reporting logic rely on several specialized n8n node components:
Daily at 08:00 am (Schedule Trigger): This critical n8n trigger initiates the compression batch process at a fixed time every day.
Generate Processing Id (Set Node): Ensures every execution of the n8n workflow has a unique identifier for logging purposes.
Get all files (Google Drive Node): Executes the initial query against the target Google Drive folder, providing the data list for the subsequent batch processes.
Tiny URL API Call (HTTP Request Node): Handles the external API interaction, sending the binary image data to the Tinify compression service using configured n8n credentials.
Save to Remove Background (Google Drive Node): This Google Drive n8n node handles the file upload of the newly compressed image to the designated output folder.
Processing Logs (Data Table Node): Records essential metadata (file name, size reduction, IDs) for detailed reporting within n8n.
Move Files to the Folder /Original (Google Drive Node): Archives the original files, maintaining a clean input folder for the next n8n trigger run.
Generate Report (Code Node): A custom scripting n8n node responsible for executing complex calculations (total savings) and generating the final HTML email body.
Use this powerful n8n workflow to automatically classify incoming ITSM tickets using Gemini AI, leverage a Qdrant RAG knowledge base for instant answers, and create incidents in ServiceNow.

Use this powerful n8n workflow to automatically convert support emails into structured Jira tickets, leverage OpenAI for intelligent resolution suggestions, and send real-time alerts via Slack.

Use this powerful n8n workflow to automate IT support ticket creation. Transcribe Telegram voice messages using OpenAI Whisper, extract structured data with a GPT n8n node, and instantly create JIRA tickets and send Slack notifications.

Use this powerful n8n workflow to automate AI-driven image editing (via Nano Banana) for real estate or e-commerce, generate smart captions with GPT-5, and instantly post the content to Instagram using Postiz. Start optimizing your content pipeline with n8n templates.

Use this powerful n8n workflow to automatically edit images using Nano Banana AI, generate captions with GPT-5, track status in Google Sheets, and instantly publish polished content to Instagram via Postiz.

Automation, AI and Analytics for Supply Chain & Business Optimization Helping businesses streamline operations using n8n, AI agents, and data science to enhance efficiency and sustainability. Linkedin: www.linkedin.com/in/samir-saci







































