This workflow follows the Gmail Trigger → Google Sheets recipe pattern — see all workflows that pair these two integrations.
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 →
{
"name": "Gmail Success Cases Export",
"nodes": [
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyHour"
}
]
},
"filters": {
"labelIds": [
"Label_XXXXXXXXXX"
]
},
"options": {
"maxResults": 50
}
},
"id": "gmail-trigger",
"name": "Gmail Trigger - Success Cases",
"type": "n8n-nodes-base.gmailTrigger",
"typeVersion": 1,
"position": [
240,
300
],
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "// Format email data for storage\nconst email = $input.item.json;\n\nconst formatted = {\n messageId: email.id || '',\n threadId: email.threadId || '',\n from: email.From || email.from || '',\n to: email.To || email.to || '',\n subject: email.Subject || email.subject || '',\n date: email.Date || email.date || new Date().toISOString(),\n snippet: email.snippet || '',\n body: email.text || email.textPlain || email.html || '',\n labels: (email.labelIds || []).join(', '),\n exportedAt: new Date().toISOString()\n};\n\nreturn { json: formatted };"
},
"id": "format-email",
"name": "Format Email Data",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
460,
300
]
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"value": "13iOvpUd6OjZPgMeFKL42RlPk326JCLNzT8tyEM-SY8I",
"mode": "id"
},
"sheetName": {
"__rl": true,
"value": "Success Cases",
"mode": "name"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"Message ID": "={{ $json.messageId }}",
"Thread ID": "={{ $json.threadId }}",
"From": "={{ $json.from }}",
"To": "={{ $json.to }}",
"Subject": "={{ $json.subject }}",
"Date": "={{ $json.date }}",
"Snippet": "={{ $json.snippet }}",
"Body": "={{ $json.body }}",
"Labels": "={{ $json.labels }}",
"Exported At": "={{ $json.exportedAt }}"
}
},
"options": {}
},
"id": "google-sheets",
"name": "Save to Google Sheets",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
680,
300
],
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"content": "## Gmail Success Cases Export\n\n### \u8a2d\u5b9a\u624b\u9806\n\n1. **Gmail\u3067\u30e9\u30d9\u30eb\u4f5c\u6210**\n - \u300csuccess-cases\u300d\u30e9\u30d9\u30eb\u3092\u4f5c\u6210\n - \u6210\u529f\u4e8b\u4f8b\u306e\u30e1\u30fc\u30eb\u306b\u3053\u306e\u30e9\u30d9\u30eb\u3092\u4ed8\u3051\u308b\n\n2. **\u30e9\u30d9\u30ebID\u3092\u53d6\u5f97**\n - Gmail Trigger\u30ce\u30fc\u30c9\u3092\u30af\u30ea\u30c3\u30af\n - \u300cParameters\u300d\u2192\u300cFilters\u300d\u2192\u300cLabel IDs\u300d\n - \u300cFetch Labels\u300d\u3067\u53d6\u5f97\u53ef\u80fd\n\n3. **Google Sheets\u306e\u6e96\u5099**\n - \u300cSuccess Cases\u300d\u30b7\u30fc\u30c8\u3092\u4f5c\u6210\n - \u30d8\u30c3\u30c0\u30fc\u884c: Message ID, Thread ID, From, To, Subject, Date, Snippet, Body, Labels, Exported At\n\n4. **\u8a8d\u8a3c\u8a2d\u5b9a**\n - Gmail\u8a8d\u8a3c\n - Google Sheets\u8a8d\u8a3c",
"height": 400,
"width": 350
},
"id": "sticky-note",
"name": "Setup Instructions",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
240,
-100
]
}
],
"connections": {
"Gmail Trigger - Success Cases": {
"main": [
[
{
"node": "Format Email Data",
"type": "main",
"index": 0
}
]
]
},
"Format Email Data": {
"main": [
[
{
"node": "Save to Google Sheets",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
}
}
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.
gmailOAuth2googleSheetsOAuth2Api
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Gmail Success Cases Export. Uses gmailTrigger, googleSheets. Event-driven trigger; 4 nodes.
Source: https://gist.github.com/athearthapp/6366619f81741ab1b1666ef4eb9ba3c5 — 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.
Receive any business document via email. The attachment is automatically classified (Invoice, Contract, or Purchase Order) using easybits Extractor, then routed down the correct path where a second Ex
The goal is to reduce inbox noise and automatically organize repetitive types of emails so that imprtant messages remain visible while unsolicited or promotional emails are handled automatically. When
Automatically convert Gmail emails and Slack messages into Zendesk support tickets with intelligent priority detection, comprehensive Google Sheets tracking, and real-time team notifications. Streamli
📘 Description
This n8n workflow is designed for IT security professionals, email administrators, and organizations that want to automatically scan URLs received in emails for potential security threats. It provides