Automatically delete spam emails in Gmail on schedule
Who is this for?
If you hate SPAM emails or don't want to clean them up frequently.
What problem is this workflow solving?
It automatically deletes SPAM emails for you, so you don't have to. Save a bit of your time.
What this workflow does
- You can specify when to execute the workflow: daily, weekly, or monthly.
Setup
- Select the preferred execution time
- Configure credentials for Gmail OAuth2
How to customize this workflow to your needs
- There's no need. It just works!
Automatically Delete Spam Emails in Gmail on Schedule
This n8n workflow automates the process of identifying and deleting spam emails in your Gmail account on a recurring schedule. It helps keep your inbox clean and free from unwanted messages without manual intervention.
What it does
- Triggers on a Schedule: The workflow starts at predefined intervals (e.g., daily, hourly) to check for new spam.
- Accesses Gmail: It connects to your Gmail account to perform email operations.
- Processes Emails: It's designed to interact with your Gmail messages, likely to search for and delete emails matching specific criteria (though the provided JSON only shows the Gmail node without specific operations configured).
Prerequisites/Requirements
- n8n Account: An active n8n instance (cloud or self-hosted).
- Gmail Account: A Google account with access to Gmail.
- Google OAuth2 Credential: You will need to set up a Google OAuth2 credential in n8n to allow the workflow to access your Gmail account.
Setup/Usage
- Import the Workflow:
- Copy the provided JSON code.
- In your n8n instance, click "New" in the workflows section.
- Click the three dots menu (...) and select "Import from JSON".
- Paste the JSON code and click "Import".
- Configure Gmail Credential:
- Click on the "Gmail" node.
- In the node settings, select an existing "Google OAuth2" credential or click "Create New" to set one up. Follow the on-screen instructions to authenticate with your Google account.
- Configure Schedule Trigger:
- Click on the "Schedule Trigger" node.
- Adjust the "Interval" and "Time" settings to your preferred schedule (e.g., once a day, every 6 hours).
- Configure Gmail Operation (Important):
- The current "Gmail" node is present but not configured with a specific operation (e.g., "Get", "Delete").
- You will need to configure the "Gmail" node to perform the desired action. For example:
- Set the "Operation" to "Delete".
- Specify the "Resource" as "Message".
- Add a "Query" to filter for spam emails. A common query for spam is
is:spamorin:spam. You might also want to filter by age, sender, or subject. - TEST CAREFULLY: Before activating, ensure your query is correct to avoid deleting legitimate emails.
- Activate the Workflow:
- Once configured, save the workflow and toggle the "Active" switch in the top right corner to enable it.
This workflow provides the foundational components for automating spam deletion. Remember to carefully configure the Gmail node's operation and filters to match your specific spam management needs.
Related Templates
Validate emails in a table using Mailcheck
This workflow allows you to validate emails stored in a table using the Mailcheck node. Airtable node: This node will list all the records from a table. Based on your use case, you might want to replace this node. Mailcheck node: This node will check the emails that got returned by the previous node. Set node: We will use the Set node to ensure that only the data that we set in this node gets passed on to the next nodes in the workflow. Airtable1 node: This node will update the Valid field in the table. Based on your use case, you might want to replace this node.
Load data into Snowflake
This workflow automatically downloads a CSV from the web, and parses it in a format that n8n can access. It then ensures that the data from the CSV is matched to the names of the columns in the database, and inserts this data as new rows in Snowflake. Prerequisites: A CSV with data A Snowflake account and credentials A Snowflake database to upload your CSV to Nodes: A HTTP Request node to download the CSV file A Spreadsheet File node to access the data from the CSV A Set node to ensure the data from the CSV is mapped to the column names of the Snowflake database A Snowflake node to insert these new rows into the database.
Add a task to Google Tasks
No description available.