This workflow corresponds to n8n.io template #7276 — we link there as the canonical source.
This workflow follows the Chainllm → Gmail 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 →
{
"id": "RGhw0UmEtucowCuk",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Auto-Triage Personal Inbox",
"tags": [],
"nodes": [
{
"id": "cba3ea9b-89d2-4ef4-a5fd-6cd4c06fd71c",
"name": "Get Unread Emails",
"type": "n8n-nodes-base.gmail",
"position": [
48,
-32
],
"parameters": {
"resource": "message",
"operation": "getAll",
"additionalFields": {
"labelIds": [
"UNREAD",
"INBOX"
]
}
},
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "cb5df628-43a2-4946-8227-3597ce9a85a3",
"name": "Split Emails",
"type": "n8n-nodes-base.splitInBatches",
"position": [
272,
-32
],
"parameters": {
"options": {}
},
"typeVersion": 3
},
{
"id": "abc26329-6683-4e9a-a1f7-c95e104d051d",
"name": "Format Summary",
"type": "n8n-nodes-base.code",
"position": [
1120,
-32
],
"parameters": {
"jsCode": "// Get the AI classification output (e.g., \"Important\")\nconst classification = $input.first().json.text.trim();\n\n// Get original email data from the \"Split Emails\" node\nconst email = $('Split Emails').first().json;\n\n// Fallbacks in case fields are missing\nconst subject = email.headers?.subject || email.subject || \"No Subject\";\nconst from = email.headers?.from || email.from || \"Unknown Sender\";\n\n// Build the summary line\nconst summary = `**${classification}**: ${subject} (from: ${from})`;\n\n// Return the structured result\nreturn [{\n json: {\n classification,\n subject,\n from,\n summary\n }\n}];"
},
"typeVersion": 2
},
{
"id": "84ca122e-fcf1-4a84-89dc-b486d8f001b2",
"name": "Aggregate Summary",
"type": "n8n-nodes-base.aggregate",
"position": [
1344,
-32
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData"
},
"typeVersion": 1
},
{
"id": "b2ca17b9-343c-4a90-99da-b0abcb54e492",
"name": "Basic LLM Chain",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
720,
-32
],
"parameters": {
"text": "=Email Details:\n{{ $json.Subject }}\n{{ $json.From }}\nSnippet: {{ $json.Text }}\n\nClassify this email into one of the following:\nImportant, Ignore, Delegate, or Reply Later.\n\nRespond with only one word.",
"batching": {},
"messages": {
"messageValues": [
{
"message": "=You are an intelligent email assistant trained to triage emails into four categories:\n\n1. Important \u2013 Action required soon or time-sensitive \n2. Ignore \u2013 Irrelevant, spam, or low-priority \n3. Delegate \u2013 Should be forwarded to someone else \n4. Reply Later \u2013 Requires a thoughtful or delayed response \n\nBe concise. Respond with **only one word**: Important, Ignore, Delegate, or Reply Later."
}
]
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "2706328f-d171-429b-9352-b29dc493fb42",
"name": "Azure OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
"position": [
816,
192
],
"parameters": {
"model": "gpt-4o-mini",
"options": {}
},
"credentials": {
"azureOpenAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "61f74b7f-dd74-44ab-bb31-8e460098d7a1",
"name": "When clicking \u2018Execute workflow\u2019",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-176,
-32
],
"parameters": {},
"typeVersion": 1
},
{
"id": "bb021292-df71-4e01-a7de-2650a6444347",
"name": "Send to Notion",
"type": "n8n-nodes-base.notion",
"position": [
1584,
-32
],
"parameters": {
"title": "=Inbox Digest - {{ $now.format('D HH:mm') }} {{ $json.data[0].classification }}",
"pageId": {
"__rl": true,
"mode": "url",
"value": "https://www.notion.so/Welcome-to-Notion-248f839f1184803d9846ce0ace27c700"
},
"blockUi": {
"blockValues": [
{
"textContent": "={{ $json.data[0].summary }}"
}
]
},
"options": {}
},
"credentials": {
"notionApi": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "16aa3045-abeb-49c6-be2a-a2c9b802f92b",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
496,
-32
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b86137b4-b6f4-42f5-957d-a37ba2c5d056",
"name": "Subject",
"type": "string",
"value": "={{ $json.headers.subject }}"
},
{
"id": "33d19af9-5def-4fa2-8b8c-bcbec69bbb28",
"name": "=From",
"type": "string",
"value": "={{ $json.headers.from }}"
},
{
"id": "bc276088-30e2-4494-baae-93c810dc8002",
"name": "=Text",
"type": "string",
"value": "={{ $json.text }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "1c75cd51-b5ce-43bf-88f0-d1bef310917a",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-416,
-288
],
"parameters": {
"height": 256,
"content": "\ud83d\ude80 WORKFLOW INITIATOR\n\nPurpose: Manually starts the email processing and analysis workflow.\n\nFunction: Triggers the automated email retrieval and AI processing pipeline.\n\nCritical: Entry point for testing workflow functionality and on-demand execution."
},
"typeVersion": 1
},
{
"id": "7e9c4c9f-3254-4e98-ad38-82a675926aaa",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1088,
-416
],
"parameters": {
"color": 6,
"height": 352,
"content": "\ud83d\udcca INSIGHT FORMATTER\n\nPurpose: Transforms AI analysis into structured, actionable summary format\n\nFunction: Creates professional email summaries with key points and recommendations.\n\nCritical: Converts raw AI output into user-friendly, business-ready insights.\n\nOutput: Standardized format suitable for reporting and decision-making."
},
"typeVersion": 1
},
{
"id": "779afae0-f16d-4478-8398-089da6229916",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
800,
-416
],
"parameters": {
"color": 5,
"height": 368,
"content": "\ud83e\udd16 AI EMAIL ANALYZER\n\nPurpose: Processes email content using advanced language model analysis.\n\nFunction: Extracts insights, sentiment, key topics, and actionable information.\n\nCritical: Core intelligence engine - transforms raw email into structured insights.\n\nModel: Configured for email content analysis, summarization, and categorization."
},
"typeVersion": 1
},
{
"id": "b6ae2c79-b46d-425e-94b1-0583a11e244f",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
496,
-400
],
"parameters": {
"color": 4,
"height": 352,
"content": "\u270f\ufe0f DATA STRUCTURE OPTIMIZER\n\nPurpose: Standardizes and cleans email data fields for AI processing\n\nFunction: Formats email content, extracts key metadata, removes unnecessary fields\n\nCritical: Prepares clean, structured data input for LLM analysis\nEnhancement: Ensures consistent data format across different email sources"
},
"typeVersion": 1
},
{
"id": "e37b3942-dce1-4cd7-94fa-72daab915960",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
192,
-368
],
"parameters": {
"color": 3,
"height": 320,
"content": "\ud83d\udd04 EMAIL BATCH PROCESSOR\n\nPurpose: Separates bulk email retrieval into individual email items\nFunction: Converts email array into separate workflow items for parallel processing\n\nCritical: Enables individual email analysis and prevents batch processing bottlenecks\n\nOptimization: Allows concurrent processing of multiple emails simultaneously"
},
"typeVersion": 1
},
{
"id": "fc4e9bbc-76fd-4d28-8834-b891f122a48d",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-112,
-368
],
"parameters": {
"color": 2,
"height": 320,
"content": "\ud83d\udce7 EMAIL RETRIEVAL ENGINE\n\nPurpose: Fetches unread emails from Gmail inbox using Gmail API\nFunction: Retrieves email metadata, content, attachments, and sender information.\n\nCritical: Primary data source - ensures all unread emails are captured for processing.\n\nConfiguration: Set appropriate filters and limits to prevent API overload."
},
"typeVersion": 1
},
{
"id": "1aa60f5e-187d-42c9-b824-ea3478e42d1b",
"name": "Sticky Note6",
"type": "n8n-nodes-base.stickyNote",
"position": [
1360,
-416
],
"parameters": {
"color": 7,
"height": 352,
"content": "\ud83d\udcc8 INTELLIGENCE CONSOLIDATOR\n\nPurpose: Combines individual email summaries into comprehensive batch report.\n\nFunction: Merges multiple email insights, identifies patterns, creates overview dashboard.\n\nCritical: Provides holistic view of email communications and trending topics.\n\nAnalytics: Generates metrics on email volume, sentiment trends, and priority items."
},
"typeVersion": 1
},
{
"id": "a51c16db-0caa-47ad-b7df-0df25e1f7558",
"name": "Sticky Note7",
"type": "n8n-nodes-base.stickyNote",
"position": [
528,
240
],
"parameters": {
"color": 5,
"height": 368,
"content": "\ud83e\udde0 ENTERPRISE AI ENGINE\n\nPurpose: Powers the LLM Chain with Azure OpenAI's advanced language capabilities.\n\nFunction: Provides natural language understanding, content analysis, and generation.\n\nCritical: Ensures high-quality, consistent AI processing with enterprise-grade reliability.\n\nConfiguration: Optimized for email content analysis and business communication patterns"
},
"typeVersion": 1
},
{
"id": "bb3b9be7-7154-4070-8616-c8a16c6e43f7",
"name": "Sticky Note8",
"type": "n8n-nodes-base.stickyNote",
"position": [
1664,
-416
],
"parameters": {
"color": 2,
"height": 368,
"content": "\ud83d\udcdd KNOWLEDGE BASE INTEGRATION\n\nPurpose: Archives processed email insights into Notion workspace.\n\nFunction: Creates searchable database entries with structured email intelligence.\n\nCritical: Ensures long-term storage and retrieval of email insights for reference.\n\nOrganization: Maintains historical records and enables trend analysis over time."
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "026fe437-68d1-4647-9f04-9543c2e04a8d",
"connections": {
"Edit Fields": {
"main": [
[
{
"node": "Basic LLM Chain",
"type": "main",
"index": 0
}
]
]
},
"Split Emails": {
"main": [
[],
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Format Summary": {
"main": [
[
{
"node": "Aggregate Summary",
"type": "main",
"index": 0
}
]
]
},
"Send to Notion": {
"main": [
[
{
"node": "Split Emails",
"type": "main",
"index": 0
}
]
]
},
"Basic LLM Chain": {
"main": [
[
{
"node": "Format Summary",
"type": "main",
"index": 0
}
]
]
},
"Aggregate Summary": {
"main": [
[
{
"node": "Send to Notion",
"type": "main",
"index": 0
}
]
]
},
"Get Unread Emails": {
"main": [
[
{
"node": "Split Emails",
"type": "main",
"index": 0
}
]
]
},
"Azure OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Basic LLM Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "Get Unread Emails",
"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.
azureOpenAiApigmailOAuth2notionApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Description: Automate your personal email management with this AI-powered inbox triage system built entirely in n8n. This template connects Gmail, Azure OpenAI (GPT-4o-mini), and Notion to classify, summarize, and store your incoming emails—helping you focus only on what…
Source: https://n8n.io/workflows/7276/ — 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.
This workflow automates the candidate rejection process after interviews. It retrieves interview feedback from Google Sheets, uses AI to structure and score candidate data, applies a scoring threshold
Use cases Automatically detect and classify sponsorship inquiries from your Gmail inbox Extract company name, contact, budget, campaign type, and channel from emails using AI Log every deal to a Notio
Monthly Invoice Summarizer. Uses googleDriveTrigger, googleDrive, lmChatOpenAi, outputParserStructured. Event-driven trigger; 28 nodes.
This workflow automates personalized candidate communication for both shortlisted and rejected applicants. It fetches candidate details, processes resumes, checks for errors, and uses GPT-4o to genera
This workflow automates Zendesk ticket handling with AI-powered auto-replies. It pulls in new support tickets, checks against a Google Sheets FAQ database, and generates accurate responses using GPT-4