This workflow follows the Discord → HTTP Request 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 →
{
"active": true,
"activeVersion": {
"updatedAt": "2026-08-05T03:09:32.000Z",
"createdAt": "2026-08-05T03:08:35.887Z",
"versionId": "2be5b6b0-0f5e-4c4c-9462-0036a1a53ff1",
"workflowId": "IZrBQeoIs0kMV58z",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 0 12 * * *"
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.3,
"position": [
96,
0
],
"id": "9d1b7743-1107-4cce-8388-680426373c3b",
"name": "Schedule Trigger"
},
{
"parameters": {
"operation": "getAll",
"filters": {
"q": "newer_than:1d"
}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.2,
"position": [
272,
0
],
"id": "203f8d28-598b-49b7-9605-47c71cf058b4",
"name": "Get many messages",
"webhookId": "9b9ff082-5116-46d1-9832-785f957060b1",
"credentials": {
"gmailOAuth2": {
"id": "hy5NphlEnoPcBGft",
"name": "Gmail account"
}
}
},
{
"parameters": {
"resource": "message",
"guildId": {
"__rl": true,
"value": "REDACTED_DISCORD_ID",
"mode": "list",
"cachedResultName": "REDACTED_SERVER_NAME",
"cachedResultUrl": "REDACTED_URL"
},
"channelId": {
"__rl": true,
"value": "REDACTED_DISCORD_ID",
"mode": "list",
"cachedResultName": "REDACTED_SERVER_NAME",
"cachedResultUrl": "REDACTED_URL"
},
"content": "={{ $('Code in JavaScript').item.json.content }}",
"options": {}
},
"type": "n8n-nodes-base.discord",
"typeVersion": 2,
"position": [
928,
208
],
"id": "3dccf9d2-c596-445c-86de-f4a1255ecbf2",
"name": "Send a message",
"webhookId": "df0bc20d-a8f8-491c-a3b8-2b7f9ffdba13",
"credentials": {
"discordBotApi": {
"id": "fhok9sVCnsdabq5q",
"name": "Discord Bot account"
}
}
},
{
"parameters": {
"aggregate": "aggregateAllItemData",
"options": {}
},
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
96,
224
],
"id": "8361a7f7-32c1-46e6-bcaf-e2779eb3b5c7",
"name": "Aggregate"
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "gemma4:12b",
"mode": "id"
},
"messages": {
"values": [
{
"content": "=Summarize the emails in this list, and tell me which ones are the most important that I should check out. Summarize the following emails and tell me which are the most important. Note: Job emails and order emails are the most important. I need to know if an order has shipped, or if a new job is available/I have an interview offer.\nDo this for every single email on the list, including the duplicate emails, or ones from the same sender. DO NOT MISS ANY EMAILS.\n\nUse this template for how you output your results(but change the information to be applicable to the current email list): \n**Priority Emails:**\nSender: Subject and summary of email\n\n---\n\n**Other Emails:**\n\nCategory:\nSender: Subject and summary of email\n\nAn example for how \"Sender: Subject and summary of email\" should appear is the following:\nIndeed | Entry Level Developer @ Silver Digital Bus LLC | A specific job alert for an Entry Level Developer position.\n\nImportant Note: Make sure to include bullet points before every sender for better readability.\n{{\n$json.data\n.map(email =>\n`From: ${email.From}\nSubject: ${email.Subject}\nSnippet: ${email.Snippet}`\n)\n.join('\\n\\n')\n}}"
}
]
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.ollama",
"typeVersion": 1,
"position": [
256,
224
],
"id": "5850e866-6cee-4b04-9bdf-d669c9a3d34a",
"name": "Message a model",
"credentials": {
"ollamaApi": {
"id": "XtrQxfNV3t379C3x",
"name": "Ollama account"
}
}
},
{
"parameters": {
"jsCode": "const text = $input.first().json.content || \"\";\nconst maxChunkSize = 1950;\nif (text.length > maxChunkSize) {\n const chunks = [];\n \n // Cut the text into clear 2000-character chunks\n for (let i = 0; i < text.length; i += maxChunkSize) {\n chunks.push(text.substring(i, i + maxChunkSize));\n }\n \n // Turn chunks into n8n objects\n return chunks.map((chunk, index) => {\n return {\n json: {\n itemNumber: index + 1,\n content: chunk\n }\n };\n });\n}\n\nreturn $input.all();"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
736,
208
],
"id": "933ba473-b896-4f0d-9661-508caf9138e2",
"name": "Code in JavaScript"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "f522c6af-917d-497e-9bb8-bea69f537010",
"leftValue": "={{$json.content}}",
"rightValue": "={{ null }}",
"operator": {
"type": "string",
"operation": "notEquals"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
528,
224
],
"id": "c52c964f-39db-47f5-a308-19736506b423",
"name": "If"
},
{
"parameters": {
"events": [
"update"
]
},
"type": "n8n-nodes-base.n8nTrigger",
"typeVersion": 1,
"position": [
496,
768
],
"id": "af38829c-70b5-453c-86bb-a584a22a3cac",
"name": "n8n Trigger"
},
{
"parameters": {},
"id": "f495f742-e1a1-4a96-9ac1-12f67fa06430",
"name": "On clicking 'execute'",
"type": "n8n-nodes-base.manualTrigger",
"position": [
496,
608
],
"typeVersion": 1,
"disabled": true
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "8d513345-6484-431f-afb7-7cf045c90f4f",
"name": "Done",
"type": "boolean",
"value": true
}
]
},
"options": {}
},
"id": "4bdaca0b-8f56-410b-b455-6e2524fe1cf7",
"name": "Return",
"type": "n8n-nodes-base.set",
"position": [
2048,
1696
],
"typeVersion": 3.3
},
{
"parameters": {
"url": "={{ $json.download_url }}",
"options": {}
},
"id": "27a53300-94b4-4eca-8171-5a1f27641627",
"name": "Get File",
"type": "n8n-nodes-base.httpRequest",
"position": [
1168,
1168
],
"typeVersion": 4.2
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"combinator": "and",
"conditions": [
{
"id": "45ce825e-9fa6-430c-8931-9aaf22c42585",
"operator": {
"type": "string",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $json.content }}",
"rightValue": ""
},
{
"id": "9619a55f-7fb1-4f24-b1a7-7aeb82365806",
"operator": {
"type": "string",
"operation": "notExists",
"singleValue": true
},
"leftValue": "={{ $json.error }}",
"rightValue": ""
}
]
},
"options": {}
},
"id": "647c3847-e0c2-4783-9b9b-10f7bad99ba2",
"name": "If file too large",
"type": "n8n-nodes-base.if",
"position": [
944,
1184
],
"typeVersion": 2
},
{
"parameters": {
"jsCode": "// ---------- DEEP SANITIZATION ----------\nfunction deepSanitize(obj) {\n // Helper to check if a string looks like a genuine email\n function isEmail(str) {\n if (typeof str !== 'string') return false;\n const atIndex = str.indexOf('@');\n if (atIndex === -1) return false;\n const dotIndex = str.lastIndexOf('.');\n // Must have a dot after @ and at least 2 chars after the dot\n if (dotIndex < atIndex + 2) return false;\n if (dotIndex === str.length - 1) return false;\n // Exclude strings that start with '@' (like node types) or contain '/'\n if (str.startsWith('@') || str.includes('/')) return false;\n return true;\n }\n\n if (Array.isArray(obj)) {\n return obj.map(item => deepSanitize(item));\n } else if (obj && typeof obj === 'object') {\n const sanitized = {};\n for (const [key, value] of Object.entries(obj)) {\n // 1. Redact user/author IDs\n if (['userId', 'creatorId', 'authors'].includes(key)) {\n sanitized[key] = 'Redacted';\n continue;\n }\n\n // 2. Redact Discord Guild & Channel data\n if (key === 'guildId' || key === 'channelId') {\n if (value && typeof value === 'object') {\n sanitized[key] = {\n ...value,\n value: 'REDACTED_DISCORD_ID',\n cachedResultName: 'REDACTED_SERVER_NAME',\n cachedResultUrl: 'REDACTED_URL'\n };\n } else {\n sanitized[key] = 'REDACTED_DISCORD_ID';\n }\n continue;\n }\n\n // 3. Redact email-like strings ONLY if they are genuine emails\n if (typeof value === 'string' && isEmail(value)) {\n sanitized[key] = 'redacted@example.com';\n continue;\n }\n\n // 4. Recursively sanitize nested objects/arrays\n sanitized[key] = deepSanitize(value);\n }\n return sanitized;\n }\n return obj;\n}\n\n// ---------- ORDERING HELPER ----------\nconst orderJsonKeys = (jsonObj) => {\n const ordered = {};\n Object.keys(jsonObj).sort().forEach(key => {\n ordered[key] = jsonObj[key];\n });\n return ordered;\n};\n\n// ---------- MAIN LOGIC ----------\nconst githubItem = $input.all()[0].json;\nconst n8nWorkflow = $input.all()[1].json;\n\nlet origWorkflow = null;\n\nif (Object.keys(githubItem).includes('content')) {\n origWorkflow = JSON.parse(Buffer.from(githubItem.content, 'base64').toString());\n} else if (Object.keys(githubItem).includes('data')) {\n origWorkflow = JSON.parse(githubItem.data);\n} else {\n origWorkflow = null; // new file\n}\n\n// Sanitize ONLY the local workflow\nconst sanitizedN8n = deepSanitize(n8nWorkflow);\nconst orderedActual = orderJsonKeys(sanitizedN8n);\n\n// Compare with the ORIGINAL remote (unsanitized)\nconst orderedOriginal = origWorkflow ? orderJsonKeys(origWorkflow) : null;\n\nif (orderedOriginal === null) {\n githubItem.github_status = 'new';\n githubItem.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\n} else if (JSON.stringify(orderedOriginal) === JSON.stringify(orderedActual)) {\n githubItem.github_status = 'same';\n} else {\n githubItem.github_status = 'different';\n githubItem.n8n_data_stringy = JSON.stringify(orderedActual, null, 2);\n}\n\n// Optional: keep decoded original for debugging\ngithubItem.content_decoded = origWorkflow;\n\nreturn [{ json: githubItem }];"
},
"id": "32f705f6-7d8f-4bd0-be47-0c47b00b2ee3",
"name": "isDiffOrNew",
"type": "n8n-nodes-base.code",
"position": [
1168,
1440
],
"typeVersion": 1
},
{
"parameters": {},
"id": "b235de57-434d-4cce-8643-191c252b635b",
"name": "Same file - Do nothing",
"type": "n8n-nodes-base.noOp",
"position": [
1600,
1616
],
"typeVersion": 1
},
{
"parameters": {},
"id": "a21685c6-defd-4433-83a2-9632845330e8",
"name": "File is different",
"type": "n8n-nodes-base.noOp",
"position": [
1600,
1440
],
"typeVersion": 1
},
{
"parameters": {},
"id": "a4c92351-4660-4b62-b4cd-873309404ca9",
"name": "File is new",
"type": "n8n-nodes-base.noOp",
"position": [
1600,
1264
],
"typeVersion": 1
},
{
"parameters": {
"resource": "file",
"owner": {
"__rl": true,
"value": "Codswell",
"mode": "name"
},
"repository": {
"__rl": true,
"value": "GmailSummarizer",
"mode": "name"
},
"filePath": "={{$('Switch').first().json.id}}.json",
"fileContent": "={{$('isDiffOrNew').item.json[\"n8n_data_stringy\"]}}",
"commitMessage": "={{$('Switch').first().json.name}} ({{$json.github_status}})"
},
"id": "bfbc52cb-c589-4987-86db-d06053e13eca",
"name": "Create new file",
"type": "n8n-nodes-base.github",
"position": [
1824,
1264
],
"webhookId": "93cca36a-a5f4-4919-b655-e0fa2cc2ca36",
"typeVersion": 1,
"credentials": {
"githubApi": {
"id": "ylUk4KF7JYWDLv5q",
"name": "GitHub account"
}
}
},
{
"parameters": {
"resource": "file",
"operation": "edit",
"owner": {
"__rl": true,
"value": "Codswell",
"mode": "name"
},
"repository": {
"__rl": true,
"value": "GmailSummarizer",
"mode": "name"
},
"filePath": "={{$('Switch').first().json.id}}.json",
"fileContent": "={{$('isDiffOrNew').item.json[\"n8n_data_stringy\"]}}",
"commitMessage": "={{$('Switch').first().json.name}} ({{$json.github_status}})"
},
"id": "a44891b3-79cc-4704-8558-7cdd5b9b1ae7",
"name": "Edit existing file",
"type": "n8n-nodes-base.github",
"position": [
1824,
1440
],
"webhookId": "286cabce-a3ec-4202-9d94-d005502d73cc",
"typeVersion": 1,
"credentials": {
"githubApi": {
"id": "ylUk4KF7JYWDLv5q",
"name": "GitHub account"
}
}
},
{
"parameters": {
"options": {
"reset": "={{ $node[\"Loop Over Items\"].context[\"done\"] }}"
}
},
"id": "b60272ac-8657-4d91-b4e1-2e4d282856d4",
"name": "Loop Over Items",
"type": "n8n-nodes-base.splitInBatches",
"position": [
1824,
768
],
"typeVersion": 3
},
{
"parameters": {
"content": "## Backup to GitHub \nThis workflow will backup all instance workflows to GitHub and also deleted it if was deleted in n8n.\n\nThe files are saved `ID.json` for the filename.\n\n### Setup\nOpen `Globals` node and update the values below \ud83d\udc47\n\n- **repo.owner:** your Github username\n- **repo.name:** the name of your repository\n\n\nIf your username was `john-doe` and your repository was called `n8n-backups`:\n\n- repo.owner - john-doe\n- repo.name - n8n-backups\n\n\nThe workflow calls itself using a subworkflow, to help reduce memory usage.",
"height": 601,
"width": 371,
"color": 4
},
"id": "84105d52-6a80-40aa-87f3-dc524eb9bd97",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
16,
496
],
"typeVersion": 1
},
{
"parameters": {
"resource": "file",
"operation": "get",
"owner": {
"__rl": true,
"value": "Codswell",
"mode": "name"
},
"repository": {
"__rl": true,
"value": "GmailSummarizer",
"mode": "name"
},
"filePath": "={{ $('Switch').item.json.id }}.json",
"asBinaryProperty": false,
"additionalParameters": {}
},
"id": "6869ecfe-0293-46d4-aac6-d0829508e49f",
"name": "Get file data",
"type": "n8n-nodes-base.github",
"position": [
720,
1184
],
"webhookId": "5cf07ee9-70c6-48bf-b370-534315f2d48e",
"typeVersion": 1,
"alwaysOutputData": true,
"credentials": {
"githubApi": {
"id": "ylUk4KF7JYWDLv5q",
"name": "GitHub account"
}
},
"continueOnFail": true
},
{
"parameters": {
"inputSource": "passthrough"
},
"id": "f68b22a2-de4f-4845-afbb-db9a6fadfe6c",
"name": "Execute Workflow Trigger",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
144,
1568
],
"typeVersion": 1.1
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "6cf546c5-5737-4dbd-851b-17d68e0a3780",
"name": "repo.owner",
"type": "string",
"value": "Codswell"
},
{
"id": "452efa28-2dc6-4ea3-a7a2-c35d100d0382",
"name": "repo.name",
"type": "string",
"value": "gmailSummarizer"
}
]
},
"options": {}
},
"id": "4539b79d-bdb6-401b-be5f-ee43f5f1830e",
"name": "Globals",
"type": "n8n-nodes-base.set",
"position": [
720,
768
],
"typeVersion": 3.4
},
{
"parameters": {
"resource": "file",
"operation": "list",
"owner": {
"__rl": true,
"value": "Codswell",
"mode": "name"
},
"repository": {
"__rl": true,
"value": "GmailSummarizer",
"mode": "name"
}
},
"id": "5a263a71-bf1c-4754-bddc-ae6dfa1d2b30",
"name": "List files",
"type": "n8n-nodes-base.github",
"position": [
1376,
864
],
"webhookId": "244ea8da-851f-4afb-980c-5e5973b6a1af",
"executeOnce": true,
"typeVersion": 1.1,
"credentials": {
"githubApi": {
"id": "ylUk4KF7JYWDLv5q",
"name": "GitHub account"
}
}
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"combinator": "and",
"conditions": [
{
"id": "8f6b31b0-a75c-4299-a530-d15b3ff65c9a",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.origin }}",
"rightValue": "n8n"
}
]
},
"renameOutput": true,
"outputKey": "n8n"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"combinator": "and",
"conditions": [
{
"id": "09e36861-1120-4343-8d38-4797e9d67eec",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.origin }}",
"rightValue": "github"
}
]
},
"renameOutput": true,
"outputKey": "github"
}
]
},
"options": {}
},
"id": "0894d4ed-bf9b-431e-a135-b93693c0eb7c",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
368,
1568
],
"typeVersion": 3.2
},
{
"parameters": {
"aggregate": "aggregateAllItemData",
"options": {}
},
"id": "17a54ccd-f1aa-411e-9fe7-12e4c5bcadf1",
"name": "Workflows",
"type": "n8n-nodes-base.aggregate",
"position": [
1168,
864
],
"typeVersion": 1
},
{
"parameters": {},
"id": "ff6a5ed4-1392-4a40-a971-d5e32e99ee5c",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"position": [
944,
1440
],
"typeVersion": 3.2
},
{
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"combinator": "and",
"conditions": [
{
"id": "aea200f9-9f83-4e4e-a965-65fddcbb6a5f",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{$json.github_status}}",
"rightValue": "new"
}
]
},
"renameOutput": true,
"outputKey": "new"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"combinator": "and",
"conditions": [
{
"id": "706ebf35-6f74-43b6-9f98-94cf14107947",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{$json.github_status}}",
"rightValue": "different"
}
]
},
"renameOutput": true,
"outputKey": "different"
},
{
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"combinator": "and",
"conditions": [
{
"id": "30c8c5a8-269f-424a-93ed-d2cbe52acf7c",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{$json.github_status}}",
"rightValue": "same"
}
]
},
"renameOutput": true,
"outputKey": "same"
}
]
},
"options": {}
},
"id": "b2db80cf-9d85-484b-93f5-1f3252995be6",
"name": "Check Status",
"type": "n8n-nodes-base.switch",
"position": [
1376,
1440
],
"typeVersion": 3.2
},
{
"parameters": {
"jsCode": "const workflows = $input.first().json.workflows;\nconst filename = $input.first().json.name;\n\n// ----------------------------\n// PROTECTED FILES - NEVER DELETE\n// ----------------------------\nconst protectedFiles = ['README.md', '.gitignore', 'LICENSE', 'CHANGELOG.md'];\nif (protectedFiles.includes(filename)) {\n return [{ json: { isDeleted: false } }];\n}\n\n// -------------------------------------------\n// ONLY process .json backup files\n// -------------------------------------------\nif (!filename.endsWith('.json')) {\n return [{ json: { isDeleted: false } }];\n}\n\n// Extract workflow ID from filename (remove .json extension)\nconst id = filename.split('.')[0];\nconst exists = workflows.some(wf => wf.id === id);\n\nreturn [{ json: { isDeleted: !exists } }];"
},
"id": "eef574c0-383f-47a9-bebf-52a712565b9d",
"name": "isDeleted",
"type": "n8n-nodes-base.code",
"position": [
1168,
1760
],
"typeVersion": 2
},
{
"parameters": {
"resource": "file",
"operation": "delete",
"owner": {
"__rl": true,
"value": "Codswell",
"mode": "name"
},
"repository": {
"__rl": true,
"value": "GmailSummarizer",
"mode": "name"
},
"filePath": "={{$('Switch').first().json.name}}",
"commitMessage": "={{$('Switch').first().json.name}} (deleted)"
},
"id": "51407390-ac2c-41e8-a366-3f919e2ca9a7",
"name": "Delete a file",
"type": "n8n-nodes-base.github",
"position": [
1824,
1888
],
"webhookId": "592f888e-3e41-49ce-b88a-d73f8756eac8",
"typeVersion": 1.1,
"credentials": {
"githubApi": {
"id": "ylUk4KF7JYWDLv5q",
"name": "GitHub account"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "5e73d2e7-4b1a-4180-8af2-047e52eb8a0a",
"name": "repo.owner",
"type": "string",
"value": "={{ $('Globals').item.json.repo.owner }}"
},
{
"id": "22445c28-5431-45a5-86ca-0ab2ff26cff5",
"name": "repo.name",
"type": "string",
"value": "={{ $('Globals').item.json.repo.name }}"
},
{
"id": "232d9947-a43f-48a9-b385-da1aa8f5139e",
"name": "origin",
"type": "string",
"value": "n8n"
}
]
},
"includeOtherFields": true,
"options": {}
},
"id": "d0a6d0c8-b336-4409-b34d-97d9bc689c23",
"name": "n8n",
"type": "n8n-nodes-base.set",
"position": [
1600,
656
],
"typeVersion": 3.4
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "5e73d2e7-4b1a-4180-8af2-047e52eb8a0a",
"name": "repo.owner",
"type": "string",
"value": "={{ $('Globals').item.json.repo.owner }}"
},
{
"id": "22445c28-5431-45a5-86ca-0ab2ff26cff5",
"name": "repo.name",
"type": "string",
"value": "={{ $('Globals').item.json.repo.name }}"
},
{
"id": "232d9947-a43f-48a9-b385-da1aa8f5139e",
"name": "origin",
"type": "string",
"value": "github"
},
{
"id": "456ec816-8c15-498b-bbc5-a96abce95d59",
"name": "workflows",
"type": "array",
"value": "={{ $('Workflows').item.json.data }}"
}
]
},
"includeOtherFields": true,
"options": {}
},
"id": "0d9e6d74-de6c-44fc-acce-f2dbf8635485",
"name": "github",
"type": "n8n-nodes-base.set",
"position": [
1600,
864
],
"typeVersion": 3.4
},
{
"parameters": {
"content": "## Edit this node \ud83d\udc47",
"height": 80,
"width": 150,
"color": 4
},
"id": "c9b1dbcb-9640-403e-8dec-e13bc15a986e",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
704,
624
],
"typeVersion": 1
},
{
"parameters": {
"content": "## Main workflow loop",
"height": 601,
"width": 1831,
"color": 7
},
"id": "0a6fb860-b3b3-4e3f-96d5-be4de15f3f22",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
416,
496
],
"typeVersion": 1
},
{
"parameters": {
"content": "## Subworkflow",
"height": 941,
"width": 2231,
"color": 6
},
"id": "affcb169-4969-4985-b399-5187a8c6b597",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
16,
1120
],
"typeVersion": 1
},
{
"parameters": {
"operation": "get",
"workflowId": {
"__rl": true,
"value": "IZrBQeoIs0kMV58z",
"mode": "list",
"cachedResultName": "Gmail Summarizer (#IZrBQeoIs0kMV58z)"
},
"requestOptions": {
"allowUnauthorizedCerts": true
}
},
"id": "9488c383-3b96-4b3a-b621-0b19607854a8",
"name": "Get a workflow",
"type": "n8n-nodes-base.n8n",
"position": [
928,
768
],
"typeVersion": 1,
"credentials": {
"n8nApi": {
"id": "c3igpXSsIXx4hv4r",
"name": "n8n account"
}
}
},
{
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 7
}
]
}
},
"id": "ebb17c30-d395-4e9c-8a66-d5bd2cf6cfbe",
"name": "Schedule Trigger1",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
496,
912
],
"typeVersion": 1.2,
"disabled": true
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 2
},
"combinator": "and",
"conditions": [
{
"id": "bb927e0c-f27b-4dce-80df-8d7611467045",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ $json.isDeleted }}",
"rightValue": ""
}
]
},
"options": {}
},
"id": "34c7816c-30e2-4a0b-bc4b-f4fcb386d422",
"name": "If1",
"type": "n8n-nodes-base.if",
"position": [
1376,
1760
],
"typeVersion": 2.2
},
{
"parameters": {
"content": "## Gmail Summarizer \n",
"height": 528,
"width": 1136,
"color": "#014652"
},
"type": "n8n-nodes-base.stickyNote",
"position": [
16,
-64
],
"typeVersion": 1,
"id": "6ced7bb5-149e-47ad-8e1e-9d8550413847",
"name": "Sticky Note4"
},
{
"parameters": {
"workflowId": {
"__rl": true,
"value": "IZrBQeoIs0kMV58z",
"mode": "list",
"cachedResultUrl": "/workflow/IZrBQeoIs0kMV58z",
"cachedResultName": "Gmail Summarizer"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {},
"matchingColumns": [],
"schema": [],
"attemptToConvertTypes": false,
"convertFieldsToString": true
},
"mode": "each",
"options": {}
},
"id": "255a0b8c-5516-4534-bdbc-03736f380c40",
"name": "Call 'Gmail Summarizer Subworkflow'",
"type": "n8n-nodes-base.executeWorkflow",
"position": [
2048,
768
],
"typeVersion": 1.2
}
],
"connections": {
"Schedule Trigger": {
"main": [
[
{
"node": "Get many messages",
"type": "main",
"index": 0
}
]
]
},
"Get many messages": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Message a model",
"type": "main",
"index": 0
}
]
]
},
"Message a model": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript": {
"main": [
[
{
"node": "Send a message",
"type": "main",
"index": 0
}
]
]
},
"Send a message": {
"main": [
[]
]
},
"If": {
"main": [
[
{
"node": "Code in JavaScript",
"type": "main",
"index": 0
}
],
[
{
"node": "Get many messages",
"type": "main",
"index": 0
}
]
]
},
"n8n Trigger": {
"main": [
[
{
"node": "Globals",
"type": "main",
"index": 0
}
]
]
},
"On clicking 'execute'": {
"main": [
[
{
"node": "Globals",
"type": "main",
"index": 0
}
]
]
},
"Get File": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"If file too large": {
"main": [
[
{
"node": "Get File",
"type": "main",
"index": 0
}
],
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"isDiffOrNew": {
"main": [
[
{
"node": "Check Status",
"type": "main",
"index": 0
}
]
]
},
"Same file - Do nothing": {
"main": [
[
{
"node": "Return",
"type": "main",
"index": 0
}
]
]
},
"File is different": {
"main": [
[
{
"node": "Edit existing file",
"type": "main",
"index": 0
}
]
]
},
"File is new": {
"main": [
[
{
"node": "Create new file",
"type": "main",
"index": 0
}
]
]
},
"Create new file": {
"main": [
[
{
"node": "Return",
"type": "main",
"index": 0
}
]
]
},
"Edit existing file": {
"main": [
[
{
"node": "Return",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Call 'Gmail Summarizer Subworkflow'",
"type": "main",
"index": 0
}
]
]
},
"Get file data": {
"main": [
[
{
"node": "If file too large",
"type": "main",
"index": 0
}
]
]
},
"Execute Workflow Trigger": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Globals": {
"main": [
[
{
"node": "Get a workflow",
"type": "main",
"index": 0
}
]
]
},
"List files": {
"main": [
[
{
"node": "github",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Get file data",
"type": "main",
"index": 0
},
{
"node": "Merge",
"type": "main",
"index": 1
}
],
[
{
"node": "isDeleted",
"type": "main",
"index": 0
}
]
]
},
"Workflows": {
"main": [
[
{
"node": "List files",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "isDiffOrNew",
"type": "main",
"index": 0
}
]
]
},
"Check Status": {
"main": [
[
{
"node": "File is new",
"type": "main",
"index": 0
}
],
[
{
"node": "File is different",
"type": "main",
"index": 0
}
],
[
{
"node": "Same file - Do nothing",
"type": "main",
"index": 0
}
]
]
},
"isDeleted": {
"main": [
[
{
"node": "If1",
"type": "main",
"index": 0
}
]
]
},
"Delete a file": {
"main": [
[
{
"node": "Return",
"type": "main",
"index": 0
}
]
]
},
"n8n": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"github": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Get a workflow": {
"main": [
[
{
"node": "Workflows",
"type": "main",
"index": 0
},
{
"node": "n8n",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger1": {
"main": [
[
{
"node": "Globals",
"type": "main",
"index": 0
}
]
]
},
"If1": {
"main": [
[
{
"node": "Delete a file",
"type": "main",
"index": 0
}
],
[
{
"node": "Return",
"type": "main",
"index": 0
}
]
]
},
"Call 'Gmail Summarizer Subworkflow'": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
}
},
"nodeGroups": [],
"authors": "Redacted",
"name": "Version 1.5",
"description": "Name change",
"autosaved": true,
"workflowPublishHistory": [
{
"createdAt": "2026-08-05T03:09:32.277Z",
"id": 64,
"workflowId": "IZrBQeoIs0kMV58z",
"versionId": "2be5b6b0-0f5e-4c4c-9462-0036a1a53ff1",
"event": "activated",
"userId": "Redacted"
}
]
},
"activeVersionId": "2be5b6b0-0f5e-4c4c-9462-0036a1a53ff1",
"connections": {
"Schedule Trigger": {
"main": [
[
{
"node": "Get many messages",
"type": "main",
"index": 0
}
]
]
},
"Get many messages": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Message a model",
"type": "main",
"index": 0
}
]
]
},
"Message a model": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Code in JavaScript": {
"main": [
[
{
"node": "Send a message",
"type": "main",
"index": 0
}
]
]
},
"Send a message": {
"main": [
[]
]
},
"If": {
"main": [
[
{
"node": "Code in JavaScript",
"type": "main",
"index": 0
}
],
[
{
"node": "Get many messages",
"type": "main",
"index": 0
}
]
]
},
"n8n Trigger": {
"main": [
[
{
"node": "Globals",
"type": "main",
"index": 0
}
]
]
},
"On clicking 'execute'": {
"main": [
[
{
"node": "Globals",
"type": "main",
"index": 0
}
]
]
},
"Get File": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"If file too large": {
"main": [
[
{
"node": "Get File",
"type": "main",
"index": 0
}
],
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"isDiffOrNew": {
"main": [
[
{
"node": "Check Status",
"type": "main",
"index": 0
}
]
]
},
"Same file - Do nothing": {
"main": [
[
{
"node": "Return",
"type": "main",
"index": 0
}
]
]
},
"File is different": {
"main": [
[
{
"node": "Edit existing file",
"type": "main",
"index": 0
}
]
]
},
"File is new": {
"main": [
[
{
"node": "Create new file",
"type": "main",
"index": 0
}
]
]
},
"Create new file": {
"main": [
[
{
"node": "Return",
"type": "main",
"index": 0
}
]
]
},
"Edit existing file": {
"main": [
[
{
"node": "Return",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items": {
"main": [
[],
[
{
"node": "Call 'Gmail Summarizer Subworkflow'",
"type": "main",
"index": 0
}
]
]
},
"Get file data": {
"main": [
[
{
"node": "If file too large",
"type": "main",
"index": 0
}
]
]
},
"Execute Workflow Trigger": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Globals": {
"main": [
[
{
"node": "Get a workflow",
"type": "main",
"index": 0
}
]
]
},
"List files": {
"main": [
[
{
"node": "github",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Get file data",
"type": "main",
"index": 0
},
{
"node": "Merge",
"type": "main",
"index": 1
}
],
[
{
"node": "isDeleted",
"type": "main",
"index": 0
}
]
]
},
"Workflows": {
"main": [
[
{
"node": "List files",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "isDiffOrNew",
"type": "main",
"index": 0
}
]
]
},
"Check Status": {
"main": [
[
{
"node": "File is new",
"type": "main",
"index": 0
}
],
[
{
"node": "File is different",
"type": "main",
"index": 0
}
],
[
{
"node": "Same file - Do nothing",
"type": "main",
"index": 0
}
]
]
},
"isDeleted": {
"main": [
[
{
"node": "If1",
"type": "main",
"index": 0
}
]
]
},
"Delete a file": {
"main": [
[
{
"node": "Return",
"type": "main",
"index": 0
}
]
]
},
"n8n": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"github": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
},
"Get a workflow": {
"main": [
[
{
"node": "Workflows",
"type": "main",
"index": 0
},
{
"node": "n8n",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger1": {
"main": [
[
{
"node": "Globals",
"type": "main",
"index": 0
}
]
]
},
"If1": {
"main": [
[
{
"node": "Delete a file",
"type": "main",
"index": 0
}
],
[
{
"node": "Return",
"type": "main",
"index": 0
}
]
]
},
"Call 'Gmail Summarizer Subworkflow'": {
"main": [
[
{
"node": "Loop Over Items",
"type": "main",
"index": 0
}
]
]
}
},
"createdAt": "2026-08-01T07:36:23.644Z",
"description": null,
"id": "IZrBQeoIs0kMV58z",
"isArchived": false,
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Gmail Summarizer",
"nodeGroups": [],
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 0 12 * * *"
}
]
}
},
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.3,
"position": [
96,
0
],
"id": "9d1b7743-1107-4cce-8388-680426373c3b",
"name": "Schedule Trigger"
},
{
"parameters": {
"operation": "getAll",
"filters": {
"q": "newer_than:1d"
}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.2,
"position": [
272,
0
],
"id": "203f8d28-598b-49b7-9605-47c71cf058b4",
"name": "Get many messages",
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"resource": "message",
"guildId": {
"__rl": true,
"value": "REDACTED_DISCORD_ID",
"mode": "list",
"cachedResultName": "REDACTED_SERVER_NAME",
"cachedResultUrl": "REDACTED_URL"
},
"channelId": {
"__rl": true,
"value": "REDACTED_DISCORD_ID",
"mode": "list",
"cachedResultName": "REDACTED_SERVER_NAME",
"cachedResultUrl": "REDACTED_URL"
},
"content": "={{ $('Code in JavaScript').item.json.content }}",
"options": {}
},
"type": "n8n-nodes-base.discord",
"typeVersion": 2,
"position": [
928,
208
],
"id": "3dccf9d2-c596-445c-86de-f4a1255ecbf2",
"name": "Send a message",
"credentials": {
"discordBotApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"aggregate": "aggregateAllItemData",
"options": {}
},
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
96,
224
],
"id": "8361a7f7-32c1-46e6-bcaf-e2779eb3b5c7",
"name": "Aggregate"
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "gemma4:12b",
"mode": "id"
},
"messages": {
"values": [
{
"content": "=Summarize the emails in this list, and tell me which ones are the most important that I should check out. Summarize the following emails and tell me which are the most important. Note: Job emails and order emails are the most important. I need to know if an order has shipped, or if a new job is available/I have an interview offer.\nDo this for every single email on the list, including the duplicate emails, or ones from the same sender. DO NOT MISS ANY EMAILS.\n\nUse this template for how you output your results(but change the information to be applicable to the current email list): \n**Priority Emails:**\nSender: Subject and summary of email\n\n---\n\n**Other Emails:**\n\nCategory:\nSender: Subject and summary of email\n\nAn example for how \"Sender: Subject and summary of email\" should appear is the following:\nIndeed | Entry Level Developer @ Silver Digital Bus LLC | A specific job alert for an Entry Level Developer position.\n\nImportant Note: Make sure to include bullet points before every sender for better readability.\n{{\n$json.data\n.map(email =>\n`From: ${email.From}\nSubject: ${email.Subject}\nSnippet: ${email.Snippet}`\n)\n.join('\\n\\n')\n}}"
}
]
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.ollama",
"typeVersion": 1,
"position": [
256,
224
],
"id": "5850e866-6cee-4b04-9bdf-d669c9a3d34a",
"name": "Message a model",
"credentials": {
"ollamaApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "const text = $input.first().json.content || \"\";\nconst maxChunkSize = 1950;\nif (text.length > maxChunkSize) {\n const chunks = [];\n \n // Cut the text into clear 2000-character chunks\n for (let i = 0; i < text.length; i += maxChunkSize) {\n chunks.push(text.substring(i, i + maxChunkSize));\n }\n \n // Turn chunks into n8n objects\n return chunks.map((chunk, index) => {\n return {\n json: {\n itemNumber: index + 1,\n content: chunk\n }\n };\n });\n}\n\nreturn $input.all();"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
736,
208
],
"id": "933ba473-b896-4f0d-9661-508caf9138e2",
"name": "Code in JavaScript"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "f522c6af-917d-497e-9bb8-bea69f537010",
"leftValue": "={{$json.content}}",
"rightValue": "={{ null }}",
"operator": {
"type": "string",
"operation": "notEquals"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
528,
224
],
"id": "c52c964f-39db-47f5-a308-19736506b423",
"name": "If"
},
{
"parameters": {
"events": [
"update"
]
},
"type": "n8n-nodes-base.n8nTrigger",
"typeVersion": 1,
"position": [
496,
768
],
"id": "af38829c-70b5-453c-86bb-a584a22a3cac",
"name": "n8n Trigger"
},
{
"parameters": {},
"id": "f495f742-e1a1-4a96-9ac1-12f67fa06430",
"name": "On clicking 'execute'",
"type": "n8n-nodes-base.manualTrigger",
"position": [
496,
608
],
"typeVersion": 1,
"disabled": true
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "8d513345-6484-431f-afb7-7cf045c90f4f",
"name": "Done",
"type": "boolean",
"value": true
}
]
},
"options": {}
},
"id": "4bdaca0b-8f56-410b-b455-6e2524fe1cf7",
"name": "Return",
"type": "n8n-nodes-base.set",
"position": [
2048,
1696
],
"typeVersion": 3.3
},
{
"parameters": {
"url": "={{ $json.download_url }}",
"options": {}
},
"id": "27a53300-94b4-4eca-8171-5a1f27641627",
"name": "Get File",
"type": "n8n-nodes-base.httpRequest",
"position": [
1168,
1168
],
"typeVersion": 4.2
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 1
},
"combinator": "and",
"conditions": [
{
"id": "45ce825e-9fa6-430c-8931-9aaf22c42585",
"operator": {
"type": "string",
"operation": "empty",
"singleValue": true
},
"leftValue": "={{ $json.content }}",
"rightValue": ""
},
{
"id": "9619a55f-7fb1-4f24-b1a7-7aeb82365806",
"operator": {
"type": "string",
"operation": "notExists",
"singleValue": true
},
"leftValue": "={{ $json.error }}",
"rightValue": ""
}
]
},
"options": {}
},
"id": "647c3847-e0c2-4783-9b9b-10f7bad99ba2",
"name": "If file too large",
"type": "n8n-nodes-base.if",
"position": [
944,
1184
],
"typeVersion": 2
},
{
"parameters": {
"jsCode": "// ---------- DEEP SANITIZATION ----------\nfunction deepSanitize(obj) {\n // Helper to check if a string looks like a genuine email\n function isEmail(str) {\n if (typeof str !== 'string') return false;\n const atIndex = str.indexOf('@');\n if (atIndex === -1) return false;\n const dotIndex = str.lastIndexOf('.');\n // Must have a dot after @ and at least 2 chars after the dot\n if (dotIndex < atIndex + 2) return false;\n if (dotIndex === str.length - 1) return false;\n // Exclude strings that start with '@' (like node types) or contain '/'\n if (str.startsWith('@') || str.includes('/')) return false;\n return true;\n }\n\n if (Array.isArray(obj)) {\n return obj.map(item => deepSanitize(item));\n } else if (obj && typeof obj === 'object') {\n const sanitized = {};\n for (const [key, value] of Object.entries(obj)) {\n // 1. Redact user/author IDs\n if (['userId', 'creatorId', 'authors'].includes(key)) {\n sanitized[key] = 'Redacted';\n continue;\n }\n\n // 2. Redact Discord Guild & Channel data\n if (key === 'guildId' || key === 'channelId') {\n if (value && typeof value === 'object') {\n sanitized[key] = {\n ...value,\n value: 'REDACTED_DISCORD_ID',\n cachedResultName: 'REDACTED_SERVER_NAME',\n cachedResultUrl: 'REDACTED_URL'\n };\n } else {\n sanitized[key] = 'REDACTED_DISCORD_ID';\n }\n continue;\n }\n\n // 3. Redact email-like strings ONLY if they are genuine emails\n if (typeof value === 'string' && isEmail(value)) {\n sanitized[key] = 'redac
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.
discordBotApigithubApigmailOAuth2n8nApiollamaApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Gmail Summarizer. Uses gmail, discord, ollama, n8nTrigger. Scheduled trigger; 40 nodes.
Source: https://github.com/Codswell/GmailSummarizer/blob/main/IZrBQeoIs0kMV58z.json — 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.
[](https://youtu.be/sKJAypXDTLA)
This n8n workflow automatically generates AI-powered content about local news and publishes it across multiple social media platforms. The workflow runs on a schedule, fetches the latest news about a
This n8n workflow automatically fetches RSS articles, extracts featured images, and publishes them across multiple social media platforms. The workflow runs on a schedule, processes news articles from
Aggregates communication data from Slack, Microsoft Teams, Gmail, GitHub, and Confluence into a single, unified AI-powered analysis workflow designed for quality review and automated documentation upd
This workflow automates tax compliance monitoring and revenue analysis for accounting teams and finance managers handling multi-source income data. It solves the critical problem of manually tracking