Skip to main content

Scheduled Gmail cleanup - auto-delete spam, promotions, social & trash

Workflow preview

Workflow preview
100%
Scheduled Gmail cleanup - auto-delete spam, promotions, social & trash preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Scheduled Gmail Cleanup – Auto Delete Spam, Promotions, Social & Trash to save the Gmail space and time Managing Gmail manually can be tedious and time consuming. Spam, Promotions, Social, and Tras...

Best for

  • Personal Productivity automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.gmail, n8n-nodes-base.scheduletrigger

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Scheduled Gmail cleanup - auto-delete spam, promotions, social & trash
Workflow name
Scheduled Gmail cleanup - auto-delete spam, promotions, social & trash

Scheduled Gmail Cleanup – Auto-Delete Spam, Promotions, Social & Trash to save the Gmail space and time

Managing Gmail manually can be tedious and time-consuming. Spam, Promotions, Social, and Trash folders quickly fill up with unwanted emails, taking up valuable storage and creating clutter. This workflow provides a simple yet powerful Gmail automation for efficient email management, helping you maintain a cleaner inbox with zero daily effort.

This workflow is triggered by a Schedule node that runs once per day (customizable). It then uses multiple Gmail nodes to:

  1. Fetch Spam Emails – Identify all emails in the Spam folder.
  2. Fetch Promotions Emails – Collect promotional messages from Gmail’s Promotions category.
  3. Fetch Social Emails – Pull emails from the Social tab.
  4. Fetch Trash Emails – Find all items already marked as trash.
  5. Delete Fetched Emails – Automatically delete the emails retrieved from these categories.

By default, the workflow deletes the selected emails permanently. Once removed, they are not recoverable.


Key Benefits

  • Automatically deletes junk, spam, and promotional emails daily
  • Keeps Gmail storage under control and prevents hitting Google’s limits
  • Saves time by eliminating manual cleanup tasks
  • Helps you achieve and maintain Inbox Zero
  • Simple “set and forget” automation — once activated, it runs in the background

How to Use

  1. Import this workflow into your n8n account.
  2. Connect your Gmail account using Gmail OAuth2 credentials.
  3. Open each Gmail node and select your Gmail credential.
  4. Adjust the Schedule Trigger if you want to run it more or less frequently (default: once per day).
  5. Save and activate the workflow.

Once set up, your Gmail inbox will automatically stay clean and organized every day.


Who Is This For?

  • Professionals who want to focus only on important emails
  • Productivity enthusiasts striving for Inbox Zero
  • Users approaching Gmail’s 15GB storage limit
  • Teams managing shared inboxes with heavy email flow

Customising this workflow

  • Schedule: Adjust the Schedule Trigger to run hourly, daily, or weekly.
  • Categories: Remove nodes for folders you want to keep, or add filters to only delete emails older than a certain number of days.
  • Deletion Settings: Modify the Gmail Delete node to move emails to Trash instead of permanent deletion if you prefer a safer cleanup.

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 - Sticky Note

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

Block 2 - Sticky Note1

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

Block 3 - Get all Social Mails

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

Block 4 - Get all Trash Mails

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

Block 5 - Get all Promotional Mails

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

Block 6 - Get all SPAM Mails

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

Block 7 - Sticky Note2

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

Block 8 - Sticky Note3

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

Block 9 - Sticky Note4

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

Block 10 - Sticky Note5

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

Block 11 - Sticky Note6

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

Block 12 - Delete Mails

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

Block 13 - Trigger every day at midnight

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

3. Summary Table

Workflow Scheduled Gmail cleanup - auto-delete spam, promotions, social & trash
Complexity intermediate
Nodes 13
Categories Personal Productivity
Author Tejas Ambalia
Published 27 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7952/7952.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 Scheduled Gmail cleanup - auto-delete spam, promotions, social & trash do?

Scheduled Gmail Cleanup – Auto Delete Spam, Promotions, Social & Trash to save the Gmail space and time Managing Gmail manually can be tedious and time consuming. Spam, Promotions, Social, and Tras...

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 Personal Productivity use case.