Skip to main content

πŸ—œοΈ Automate image compression in Google Drive with Tinify API and email reports

Workflow preview

Workflow preview
100%
πŸ—œοΈ Automate image compression in Google Drive with Tinify API and email reports preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Tags: Image Compression, Tinify API, TinyPNG, SEO Optimisation, E commerce, Marketing Context Hi! I’m Samir Saci, Supply Chain Engineer, Data Scientist based in Paris, and ...

Best for

  • File Management automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.googledrive, n8n-nodes-base.scheduletrigger, n8n-nodes-base.httprequest, n8n-nodes-base.splitinbatches, n8n-nodes-base.set, n8n-nodes-base.datatable, n8n-nodes-base.code, n8n-nodes-base.gmail

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Samir Saci.

Original n8n.io source

1.1 Workflow description

Title
πŸ—œοΈ Automate image compression in Google Drive with Tinify API and email reports
Workflow name
πŸ—œοΈ Automate image compression in Google Drive with Tinify API and email reports

Tags: Image Compression, Tinify API, TinyPNG, SEO Optimisation, E-commerce, Marketing

Context

Hi! I’m Samir Saci, Supply Chain Engineer, Data Scientist based in Paris, and founder of LogiGreen.

I built this workflow for an agency specialising in e-commerce to automate the daily compression of their images stored in a Google Drive folder.

This is particularly useful when managing large libraries of product photos, website assets or marketing visuals that need to stay lightweight for SEO, website performance or storage optimisation.

> Test this workflow with the free tier of the API!

πŸ“¬ For business inquiries, you can find me on LinkedIn

Who is this template for?

This template is designed for:

  • E-commerce managers who need to keep product images optimised
  • Marketing teams handling large volumes of visuals
  • Website owners wanting automatic image compression for SEO
  • Anyone using Google Drive to store images that gradually become too heavy

What does this workflow do?

This workflow acts as an automated image compressor and reporting system using Tinify, Google Drive, and Gmail.

  1. Runs every day at 08:00 using a Schedule Trigger
  2. Fetches all images from the Google Drive Input folder
  3. Downloads each file and sends it to the Tinify API for compression
  4. Downloads the optimised image and saves it to the Compressed folder
  5. Moves the original file to the Original Images archive
  6. Logs: fileName, originalSize, compressedSize, imageId, outputUrl and processingId into a Data Table
  7. After processing, it retrieves all logs for the current batch
  8. Generates a clean HTML report summarising the compression results
  9. Sends the report via Gmail, including total space saved

Here is an example from my personal folder:

Here is the report generated for these images:

P.S.: You can customise the report to match your company branding or visual identity.

πŸŽ₯ Tutorial

A complete tutorial (with explanations of every node) is available on YouTube:

Next Steps

Before running the workflow, follow the sticky notes and configure the following:

  • Get your Tinify API key for the free tier here: Get your key
  • Replace Google Drive folder IDs in: Input, Compressed, and Original Images
  • Replace the Data Table reference with your own (fields required: fileName, originalSize, compressedSize, imageId, outputUrl, processingId)
  • Add your Tinify API key in the HTTP Basic Auth credentials
  • Set up your Gmail credentials and recipient email
  • (Optional) Customise the HTML report in the Generate Report Code node
  • (Optional) Adjust the daily schedule to your preferred time

Submitted: 18 November 2025
Template designed with n8n version 1.116.2

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Save to Remove Background

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 2 - Get all files

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 3 - Daily at 08:00 am

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 4 - Tiny URL API Call

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - Load Raw Image

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 6 - Download Compressed Image

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 7 - Move Files to the Folder /Original

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 8 - Loop Over Processed Files

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 9 - Loop Over Original Files

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 10 - Generate Processing Id

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 11 - Processing Logs

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 12 - Generate Report

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - Collect Logs

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 14 - Send Report

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 15 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note10

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note11

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow πŸ—œοΈ Automate image compression in Google Drive with Tinify API and email reports
Complexity advanced
Nodes 20
Categories File Management
Author Samir Saci
Published 18 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10982/10982.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does πŸ—œοΈ Automate image compression in Google Drive with Tinify API and email reports do?

Tags: Image Compression, Tinify API, TinyPNG, SEO Optimisation, E commerce, Marketing Context Hi! I’m Samir Saci, Supply Chain Engineer, Data Scientist based in Paris, and ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your File Management use case.