The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"nodes": [
{
"name": "On clicking 'execute'",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-40,
240
],
"parameters": {},
"typeVersion": 1
},
{
"name": "Gmail",
"type": "n8n-nodes-base.gmail",
"position": [
150,
240
],
"parameters": {
"resource": "message",
"operation": "getAll",
"returnAll": true,
"additionalFields": {
"q": "-in:chats unsubscribe -license -key -password",
"format": "ids"
}
},
"credentials": {
"gmailOAuth2": "<your credential>"
},
"typeVersion": 1
},
{
"name": "Delete Old Gmail",
"type": "n8n-nodes-base.gmail",
"position": [
500,
410
],
"parameters": {
"resource": "message",
"messageId": "={{$json[\"id\"]}}",
"operation": "delete"
},
"credentials": {
"gmailOAuth2": "<your credential>"
},
"typeVersion": 1
},
{
"name": "SplitInBatches",
"type": "n8n-nodes-base.splitInBatches",
"position": [
310,
240
],
"parameters": {
"options": {},
"batchSize": 100
},
"typeVersion": 1
}
],
"connections": {
"Gmail": {
"main": [
[
{
"node": "SplitInBatches",
"type": "main",
"index": 0
}
]
]
},
"SplitInBatches": {
"main": [
[
{
"node": "Delete Old Gmail",
"type": "main",
"index": 0
}
]
]
},
"Delete Old Gmail": {
"main": [
[
{
"node": "SplitInBatches",
"type": "main",
"index": 0
}
]
]
},
"On clicking 'execute'": {
"main": [
[
{
"node": "Gmail",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
gmailOAuth2
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Manual Gmail. Uses manualTrigger, gmail, splitInBatches. Event-driven trigger; 4 nodes.
Source: https://github.com/Zie619/n8n-workflows — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Email Automation Suite. Uses gmailTrigger, supabase, gmail. Event-driven trigger; 12 nodes.
[](https://www.youtube.com/watch?v=jxT6XO4eUwI)
This workflow automatically scans food delivery platforms and restaurant websites to find the best deals and discounts. It helps you save money on meals by aggregating special offers and promotions in
This workflow sends an alert to the channel of your choice when an execution fails. Connect the tool where you want alerts to be sent (eg. Gmail, Slack, Teams, etc.) Save the workflow Turn on error no
🧠 5分鐘搞定n8n + Google OAuth. Uses googleDocs, googleDrive, googleSheets, googleCalendar. Event-driven trigger; 8 nodes.