지능형 Gmail 이메일 자동 정리기 (Google Sheets 규칙 포함)
이것은Ticket Management, Miscellaneous, Multimodal AI분야의자동화 워크플로우로, 17개의 노드를 포함합니다.주로 If, Code, Gmail, Merge, Slack 등의 노드를 사용하며. Gmail 이메일 자동 정리기, Google Sheets 규칙 포함
- •Google 계정 및 Gmail API 인증 정보
- •Slack Bot Token 또는 Webhook URL
- •Google Sheets API 인증 정보
{
"id": "z6QF6JvVLiEdA4Ij",
"meta": {
"instanceId": "50631c03cbd88440965b74e5a58aada5437cbc43e90372b516e36154908ad374",
"templateCredsSetupCompleted": true
},
"name": "Intelligent Gmail Email Auto Organizer with Google Sheets Rules",
"tags": [],
"nodes": [
{
"id": "a06719ac-b0f9-4f5d-927c-a7acfa2a1752",
"name": "일정 트리거",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-2416,
520
],
"parameters": {
"rule": {
"interval": [
{
"field": "minutes"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "fb2532f6-d850-4a11-b741-33b8d0a4503d",
"name": "Get many messages",
"type": "n8n-nodes-base.gmail",
"position": [
-2192,
400
],
"webhookId": "5d249991-7269-4e17-ae54-61d62f19a962",
"parameters": {
"filters": {
"labelIds": [
"INBOX"
]
},
"operation": "getAll"
},
"credentials": {
"gmailOAuth2": {
"id": "DCeq34r6AVUWvTDF",
"name": "Gmail account (omerfayyaz.engr@gmail.com)"
}
},
"typeVersion": 2.1
},
{
"id": "f2773ff3-af21-4a57-bf87-c58a8fb9272a",
"name": "항목 반복",
"type": "n8n-nodes-base.splitInBatches",
"position": [
-1744,
400
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "e9f96ccc-a1cc-497f-aceb-b3867dd39dd3",
"name": "Is marketing/automated email?",
"type": "n8n-nodes-base.if",
"position": [
-1520,
-16
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "or",
"conditions": [
{
"id": "d31b4425-e112-4c3d-8ed4-cba2fa7bb6db",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{\n(() => {\n const fromRaw = ($json[\"From\"] || \"\").toString().toLowerCase();\n const fromEmail = (fromRaw.match(/<([^>]+)>/)?.[1] || fromRaw).trim();\n const patterns = [\n // delete immediately\n \"ivan@mail.notion.so\", \"notifications@discord.com\",\n // promotions\n \"newsletter@\", \"mailer@\", \"bounce@\",\n \"@linkedin.com\", \"@e.linkedin.com\", \"@facebookmail.com\",\n \"@mail.instagram.com\", \"@slack.com\", \"@mailchimp.com\",\n \"info@e.atlassian.com\",\n \"x.com\",\n \"navicosoft.com\"\n ];\n return patterns.some(p => fromEmail.includes(p));\n})()\n}}",
"rightValue": ""
}
]
},
"looseTypeValidation": true
},
"typeVersion": 2.2
},
{
"id": "81a86b7e-0a23-45d4-9491-200fc7487156",
"name": "Promotional",
"type": "n8n-nodes-base.gmail",
"position": [
48,
-32
],
"webhookId": "6aaa1ffe-41a1-460c-8b60-86e9e1dd5be4",
"parameters": {
"labelIds": [
"CATEGORY_PROMOTIONS"
],
"messageId": "={{ $json.id }}",
"operation": "addLabels"
},
"credentials": {
"gmailOAuth2": {
"id": "DCeq34r6AVUWvTDF",
"name": "Gmail account (omerfayyaz.engr@gmail.com)"
}
},
"typeVersion": 2.1
},
{
"id": "f6d6425d-0474-49c2-b54b-e7c848fbb200",
"name": "Remove From Inbox",
"type": "n8n-nodes-base.gmail",
"position": [
272,
88
],
"webhookId": "4e7585b2-5803-48d8-b15e-0dd6df58b892",
"parameters": {
"labelIds": [
"INBOX"
],
"messageId": "={{ $json.id }}",
"operation": "removeLabels"
},
"credentials": {
"gmailOAuth2": {
"id": "DCeq34r6AVUWvTDF",
"name": "Gmail account (omerfayyaz.engr@gmail.com)"
}
},
"typeVersion": 2.1
},
{
"id": "7694b09a-a5f6-479e-9008-5b97e6693d6e",
"name": "Mark as read",
"type": "n8n-nodes-base.gmail",
"position": [
496,
160
],
"webhookId": "786d065e-a1fc-4747-8ec1-85e98b732cce",
"parameters": {
"messageId": "={{ $json.id }}",
"operation": "markAsRead"
},
"credentials": {
"gmailOAuth2": {
"id": "DCeq34r6AVUWvTDF",
"name": "Gmail account (omerfayyaz.engr@gmail.com)"
}
},
"typeVersion": 2.1
},
{
"id": "a571c442-ae22-4f4d-b5d9-7b50b9b3a880",
"name": "Add Label",
"type": "n8n-nodes-base.gmail",
"position": [
48,
184
],
"webhookId": "c5151d08-b9f8-470e-a578-3614e2a1f841",
"parameters": {
"labelIds": "={{ [$json.labelId].filter(Boolean) }}",
"messageId": "={{ $json.id }}",
"operation": "addLabels"
},
"credentials": {
"gmailOAuth2": {
"id": "DCeq34r6AVUWvTDF",
"name": "Gmail account (omerfayyaz.engr@gmail.com)"
}
},
"typeVersion": 2.1
},
{
"id": "a4d6f349-4fdf-4f00-b708-96b805f06f14",
"name": "Gmail Labels",
"type": "n8n-nodes-base.gmail",
"position": [
-848,
512
],
"webhookId": "a80079f4-f9c3-4e25-a70c-99ced1d6ca36",
"parameters": {
"resource": "label",
"returnAll": true
},
"credentials": {
"gmailOAuth2": {
"id": "DCeq34r6AVUWvTDF",
"name": "Gmail account (omerfayyaz.engr@gmail.com)"
}
},
"typeVersion": 2.1
},
{
"id": "33b24f3b-3e2a-4a37-8cf6-73d2bbf41f65",
"name": "is Label Exist?",
"type": "n8n-nodes-base.if",
"position": [
-176,
184
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "d31b4425-e112-4c3d-8ed4-cba2fa7bb6db",
"operator": {
"type": "string",
"operation": "notEmpty",
"singleValue": true
},
"leftValue": "={{ $json.labelId }}",
"rightValue": "extra"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "9848ff9b-22bc-4c6f-a023-3b379680f2f5",
"name": "병합",
"type": "n8n-nodes-base.merge",
"position": [
-624,
184
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "0fa625ab-3ebf-4568-a508-324bf1371b72",
"name": "Sheet Rules",
"type": "n8n-nodes-base.googleSheets",
"position": [
-1360,
160
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/11eTXs7UN8H0aqXxOvUvCEO_zDRyArBnibUYet0MhKrE/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "11eTXs7UN8H0aqXxOvUvCEO_zDRyArBnibUYet0MhKrE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/11eTXs7UN8H0aqXxOvUvCEO_zDRyArBnibUYet0MhKrE/edit?usp=drivesdk",
"cachedResultName": "Email Rules"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"id": "m7KJWht6snJWUiJc",
"name": "Google Sheets account"
}
},
"typeVersion": 4.7
},
{
"id": "2b4ef6c6-535e-47f1-8834-d5b9544ff690",
"name": "병합1",
"type": "n8n-nodes-base.merge",
"position": [
-1072,
184
],
"parameters": {
"mode": "chooseBranch"
},
"typeVersion": 3.2
},
{
"id": "f500be31-f1b5-46a4-bb49-1db7910ef748",
"name": "Parse Sender 이메일",
"type": "n8n-nodes-base.code",
"position": [
-1968,
400
],
"parameters": {
"jsCode": "return items.map(it => {\n const raw = String(it.json.From || \"\");\n const email = (raw.toLowerCase().match(/<([^>]+)>/)?.[1] || raw.toLowerCase()).trim();\n it.json._fromEmail = email;\n return it;\n});\n"
},
"typeVersion": 2
},
{
"id": "a12ff76d-5b4c-4f2e-8388-615a7ac24484",
"name": "Apply Sheet Rules",
"type": "n8n-nodes-base.code",
"position": [
-848,
184
],
"parameters": {
"jsCode": "// Use pre-parsed email\nconst fromEmail = (s) => String(s || '').toLowerCase();\n\n// Build rules from Google Sheet\nconst rows = $items('Sheet Rules', 0).map(i => i.json);\nconst rules = rows\n .filter(r => r.Pattern && r.Action)\n .map(r => ({\n pattern: String(r.Pattern).toLowerCase().trim(),\n action: String(r.Action).toUpperCase().trim(), // DELETE | PROMO | LABEL\n labelName: String(r.LabelName || '').trim(),\n labelId: r.LabelId ? String(r.LabelId).trim() : null,\n removeInbox: String(r.RemoveFromInbox || '').toUpperCase() === 'TRUE',\n }));\n\nreturn items.map(it => {\n const sender = fromEmail(it.json._fromEmail || it.json.From);\n const hit = rules.find(r => sender.includes(r.pattern));\n\n it.json.__rule = hit || null;\n\n // For downstream switches:\n if (!hit) {\n it.json.switchLable = 'extra';\n } else if (hit.action === 'LABEL') {\n it.json.switchLable = hit.labelName || 'extra';\n it.json.labelId = hit.labelId || null; // if provided in sheet\n } else if (hit.action === 'PROMO') {\n it.json.switchLable = 'PROMO';\n } else if (hit.action === 'DELETE') {\n it.json.switchLable = 'DELETE';\n }\n\n return it;\n});\n"
},
"typeVersion": 2
},
{
"id": "09790520-8c41-49d9-a818-1cc3e658b30c",
"name": "Map Label Name",
"type": "n8n-nodes-base.code",
"position": [
-400,
184
],
"parameters": {
"jsCode": "// Build name → id map from Gmail Labels node\nconst labels = $items('Gmail Labels', 0).map(i => i.json);\nconst map = Object.fromEntries(\n labels.filter(l => l && l.name && l.id)\n .map(l => [String(l.name).trim(), l.id])\n);\n\nreturn items.map(item => {\n const key = String(item.json.switchLable || '').trim();\n\n // Only look up when we don't already have an id and key is a real label name\n if (!item.json.labelId && key && key !== 'PROMO' && key !== 'DELETE' && key !== 'extra') {\n item.json.labelId = map[key] || null;\n }\n return item;\n});\n"
},
"typeVersion": 2
},
{
"id": "189627a3-e7c6-4835-ab1a-801a68fb74e1",
"name": "Completed Notification",
"type": "n8n-nodes-base.slack",
"position": [
-1376,
416
],
"webhookId": "0a1c0309-0a0b-4e37-972d-b229684c2d52",
"parameters": {
"text": "=✅ Email Organization completed",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "id",
"value": "C099YS0V3M2"
},
"otherOptions": {}
},
"credentials": {
"slackApi": {
"id": "VI4wP9VPIS3KDiow",
"name": "Slack account"
}
},
"executeOnce": true,
"typeVersion": 2.2
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "fd2cbb63-08c6-4841-aa0d-ee5c085b40a6",
"connections": {
"Merge": {
"main": [
[
{
"node": "09790520-8c41-49d9-a818-1cc3e658b30c",
"type": "main",
"index": 0
}
]
]
},
"Merge1": {
"main": [
[
{
"node": "a12ff76d-5b4c-4f2e-8388-615a7ac24484",
"type": "main",
"index": 0
}
]
]
},
"a571c442-ae22-4f4d-b5d9-7b50b9b3a880": {
"main": [
[
{
"node": "f6d6425d-0474-49c2-b54b-e7c848fbb200",
"type": "main",
"index": 0
}
]
]
},
"81a86b7e-0a23-45d4-9491-200fc7487156": {
"main": [
[
{
"node": "f6d6425d-0474-49c2-b54b-e7c848fbb200",
"type": "main",
"index": 0
}
]
]
},
"0fa625ab-3ebf-4568-a508-324bf1371b72": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 1
}
]
]
},
"a4d6f349-4fdf-4f00-b708-96b805f06f14": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"7694b09a-a5f6-479e-9008-5b97e6693d6e": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"09790520-8c41-49d9-a818-1cc3e658b30c": {
"main": [
[
{
"node": "33b24f3b-3e2a-4a37-8cf6-73d2bbf41f65",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[
{
"node": "189627a3-e7c6-4835-ab1a-801a68fb74e1",
"type": "main",
"index": 0
}
],
[
{
"node": "e9f96ccc-a1cc-497f-aceb-b3867dd39dd3",
"type": "main",
"index": 0
}
]
]
},
"33b24f3b-3e2a-4a37-8cf6-73d2bbf41f65": {
"main": [
[
{
"node": "a571c442-ae22-4f4d-b5d9-7b50b9b3a880",
"type": "main",
"index": 0
}
],
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "fb2532f6-d850-4a11-b741-33b8d0a4503d",
"type": "main",
"index": 0
},
{
"node": "a4d6f349-4fdf-4f00-b708-96b805f06f14",
"type": "main",
"index": 0
}
]
]
},
"a12ff76d-5b4c-4f2e-8388-615a7ac24484": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"fb2532f6-d850-4a11-b741-33b8d0a4503d": {
"main": [
[
{
"node": "Parse Sender Email",
"type": "main",
"index": 0
}
]
]
},
"f6d6425d-0474-49c2-b54b-e7c848fbb200": {
"main": [
[
{
"node": "7694b09a-a5f6-479e-9008-5b97e6693d6e",
"type": "main",
"index": 0
}
]
]
},
"Parse Sender Email": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"e9f96ccc-a1cc-497f-aceb-b3867dd39dd3": {
"main": [
[
{
"node": "81a86b7e-0a23-45d4-9491-200fc7487156",
"type": "main",
"index": 0
}
],
[
{
"node": "0fa625ab-3ebf-4568-a508-324bf1371b72",
"type": "main",
"index": 0
},
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
}
}
}이 워크플로우를 어떻게 사용하나요?
위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.
이 워크플로우는 어떤 시나리오에 적합한가요?
고급 - 티켓 관리, 기타, 멀티모달 AI
유료인가요?
이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.
관련 워크플로우 추천
Omer Fayyaz
@omerfayyazn8n Expert with deep experience in designing and implementing automation workflows that optimize business processes, reduce manual effort, and improve scalability. Skilled in integrating n8n with diverse platforms, APIs, and enterprise systems to deliver end-to-end automation solutions. With 13+ years of background in web development (PHP & JavaScript), I bring strong technical expertise to create custom, reliable, and efficient workflows.
이 워크플로우 공유