Skip to main content

Auto-Delete SPAM, Social, and Promotions Emails in Gmail

Workflow preview

Workflow preview
100%
Auto-Delete SPAM, Social, and Promotions Emails in Gmail preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Who is this for? This workflow is perfect for Gmail users who want a tidy inbox without manual effort. It’s especially great for those overwhelmed by SPAM, social media updates, or promotional emai...

Best for

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

Tools used

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

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Auto-Delete SPAM, Social, and Promotions Emails in Gmail
Workflow name
Auto-Delete SPAM, Social, and Promotions Emails in Gmail

Who is this for?

This workflow is perfect for Gmail users who want a tidy inbox without manual effort. It’s especially great for those overwhelmed by SPAM, social media updates, or promotional emails and want them automatically removed regularly.

What problem is this workflow solving?

Unwanted emails like SPAM, social notifications, and promotions can clutter your Gmail inbox, making it hard to focus on what matters. Manually deleting them is repetitive and time-consuming. This workflow automates the cleanup, keeping your inbox streamlined.

What this workflow does

Every 3 days, this workflow deletes emails from Gmail’s SPAM, Social, and Promotions categories. It uses n8n’s Gmail node to fetch these emails, merges them into a single list, splits out individual email IDs, and deletes each one. The scheduled process ensures consistent inbox maintenance.

Setup

  1. Set up valid Gmail OAuth2 credentials in n8n.
  2. Import the "Clean My Mail" workflow into your n8n instance.
  3. Confirm the Gmail nodes target SPAM, CATEGORY_SOCIAL, and CATEGORY_PROMOTIONS labels.
  4. Adjust the "Run Every 3 Days (Trigger)" node’s schedule if needed.
  5. Activate the workflow to begin automated cleaning.

How to customize this workflow to your needs

  • Change the Gmail node labels to target other categories or custom labels.
  • Adjust the schedule frequency in the trigger node.
  • Add filters to spare specific emails from deletion.
  • Extend functionality with nodes for archiving or notifications.

made by: khmuhtadin Need a custom? contact me on LinkedIn or Web

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 - Delete All Mails

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

Block 2 - Adjustments

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

Block 3 - Sticky Note

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

Block 4 - Sticky Note1

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

Block 5 - Sticky Note2

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

Block 6 - Run Every 3 Days (Trigger)

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

Block 7 - Fetch SPAM Emails

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

Block 8 - Fetch Social Emails

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

Block 9 - Fetch Promotion Emails

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

Block 10 - Combine All Fetched Emails

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 11 - Split Email IDs (One per item)

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

Block 12 - Sticky Note3

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

3. Summary Table

Workflow Auto-Delete SPAM, Social, and Promotions Emails in Gmail
Complexity intermediate
Nodes 12
Categories Personal Productivity
Author Khairul Muhtadin
Published 24 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4358/4358.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 Auto-Delete SPAM, Social, and Promotions Emails in Gmail do?

Who is this for? This workflow is perfect for Gmail users who want a tidy inbox without manual effort. It’s especially great for those overwhelmed by SPAM, social media updates, or promotional emai...

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.