Use this efficient n8n workflow to schedule weekly execution to find and permanently delete all SPAM emails from your Gmail account, ensuring an automatically clean inbox.
Download this n8n workflow template and start using it instantly.
Users overwhelmed by accumulated junk and SPAM emails.
System administrators or individuals looking to maintain strict email storage limits.
Anyone seeking a reliable, automated digital hygiene solution using an n8n template.
n8n users who want an example of a scheduled n8n workflow.
Managing SPAM is a constant chore that consumes time and storage space. This purpose-built n8n workflow transforms this manual process into a set-and-forget automation. By leveraging the built-in Schedule n8n trigger, this solution guarantees that your SPAM folder is emptied on a consistent, predefined schedule, such as every Sunday night. This n8n workflow uses the Gmail n8n node's ability to fetch all messages tagged as SPAM and then iteratively deletes them, providing significant value in maintaining a clean and efficient inbox without manual intervention. This practical n8n template is quick to deploy and immediately effective.
This efficient n8n workflow starts with a scheduled n8n trigger. The default configuration sets the 'Trigger at Sunday midnight' n8n node to run every week.
getAll operation, specifically filtering for messages with the SPAM label ID, and uses the returnAll setting to ensure all existing junk messages are retrieved as separate items.delete operation. Crucially, it uses an expression (={{ $json.id }}) to dynamically target and delete the specific message ID passed from the previous Gmail n8n node, effectively purging all identified SPAM messages from your account. This entire n8n workflow runs autonomously.To deploy this n8n template, follow these steps:
Schedule Trigger (Trigger at Sunday midnight):
Function: Acts as the primary n8n trigger, defining when the n8n workflow executes.
Key Configuration: Set to run once every week (interval: [{"field":"weeks"}]). This can be customized by the user.
Gmail Node (Get all SPAM emails):
Function: Connects to Gmail to fetch a list of all messages currently sitting in the SPAM folder.
Key Configuration: Operation is getAll. Filters are set to labelIds: ["SPAM"]. returnAll is set to true to ensure comprehensive retrieval of all items, enabling the downstream delete action.
Gmail Node (Delete SPAM emails):
Function: Takes the list of message IDs from the previous node and executes a permanent deletion operation for each item.
* Key Configuration: Operation is delete. The messageId is dynamically pulled using the expression ={{ $json.id }} ensuring the correct email is targeted and removed by this n8n node.
Automate vertical video production using an n8n workflow. This powerful n8n template combines random quotes, background videos, and music, processes them with FFmpeg (via the n8n node), and uploads the final clip to YouTube automatically.

Instantly optimize your YouTube videos for SEO using this powerful n8n workflow. It leverages GPT-4o-mini to generate titles, tags, and descriptions from a transcript and automatically updates the video via the YouTube n8n node.

Use this robust n8n workflow template to automatically capture new Google Form leads and create detailed Trello cards, mapping data directly to Trello Custom Fields.

Use this robust n8n workflow to automatically classify GitHub API errors using GPT-4o, determining root cause, severity, and assigned team, then logging results in Airtable, Notion, and Slack. Accelerate DevOps response times with this advanced n8n automation.

Use this robust n8n workflow to identify Magento 2 products unsold for a year, request managerial approval via Gmail, and automatically disable inventory, keeping your catalog optimized.

Use this powerful n8n workflow template to automatically enrich HubSpot deal contacts using Surfe and dynamically defined criteria from Google Sheets, simplifying sales operations. This n8n automation ensures your CRM is always up-to-date.









































