This workflow corresponds to n8n.io template #9638 — we link there as the canonical source.
This workflow follows the Agent → 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": "pjLIqJYyE8diFDeq",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Daily Email Digest and Summary Bot",
"tags": [],
"nodes": [
{
"id": "b098a164-6c8a-4d51-9876-cfbde2e5da76",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-32,
272
],
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 0 8 * * *"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "2aa30690-0b1b-49eb-bae4-eb3c48bc840c",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-96,
-80
],
"parameters": {
"height": 304,
"content": "## Daily Email Digest Workflow\nThis workflow runs daily at 8 AM to analyze yesterday's emails and send a summary to Slack.\n\n**Setup Required:**\n- Configure Gmail credentials\n- Configure Slack credentials\n- Adjust schedule time if needed"
},
"typeVersion": 1
},
{
"id": "90dcdae6-5d2b-496f-8774-ee8d377bbd5a",
"name": "Gmail - Get Yesterday's Emails",
"type": "n8n-nodes-base.gmail",
"position": [
192,
272
],
"parameters": {
"filters": {
"receivedAfter": "={{ $now.minus({days: 1}).startOf('day').toISO() }}",
"receivedBefore": "={{ $now.startOf('day').toISO() }}"
},
"operation": "getAll"
},
"typeVersion": 2.1
},
{
"id": "96501595-c231-4d53-b028-cbe0915b0a5c",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
128,
464
],
"parameters": {
"color": 7,
"height": 256,
"content": "## Gmail Configuration\nRetrieves all emails from the previous day (midnight to midnight).\n\n**Credentials needed:**\n- Gmail OAuth2 connection\n- Grant necessary permissions for reading emails"
},
"typeVersion": 1
},
{
"id": "5fa53f71-b724-489b-8492-767fdd972a26",
"name": "AI Agent - Analyze Emails",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
864,
176
],
"parameters": {
"text": "=Analyze these emails from yesterday and create a concise daily digest summary:\n\nEmails to analyze:\n{{ JSON.stringify($json) }}\n\nCreate a structured summary that includes:\n1. Total number of emails received\n2. Important/urgent emails (if any)\n3. Key messages grouped by sender or topic\n4. Action items or requests that need attention\n5. Brief overview of main topics discussed\n\nFormat the output as a clean, readable summary suitable for Slack.",
"options": {
"systemMessage": "You are an intelligent email assistant that analyzes emails and creates concise, well-organized daily digest summaries. Focus on extracting the most important information, action items, and key messages. Group related emails together and highlight urgent matters. Keep the summary concise but comprehensive."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 2
},
{
"id": "888291d6-3791-4a85-bfba-39d00acced61",
"name": "OpenRouter Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
"position": [
864,
400
],
"parameters": {
"model": "openai/gpt-4o-mini",
"options": {
"maxTokens": 2000,
"temperature": 0.3
}
},
"typeVersion": 1
},
{
"id": "23577fe9-3338-4167-9edf-0acc4a77c5a0",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
1008,
400
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"type\": \"object\",\n \"properties\": {\n \"summary\": {\n \"type\": \"string\",\n \"description\": \"The complete daily email digest summary formatted for Slack\"\n },\n \"emailCount\": {\n \"type\": \"number\",\n \"description\": \"Total number of emails analyzed\"\n },\n \"urgentItems\": {\n \"type\": \"array\",\n \"description\": \"List of urgent or important items\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"actionItems\": {\n \"type\": \"array\",\n \"description\": \"List of action items or tasks\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\"summary\", \"emailCount\"]\n}"
},
"typeVersion": 1.2
},
{
"id": "d0ad860d-14d4-47f2-afef-4922e3bdf53e",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
864,
560
],
"parameters": {
"color": 7,
"height": 240,
"content": "## AI Processing\nThe AI Agent analyzes all emails from yesterday and creates a structured summary.\n\n**OpenRouter Credentials needed:**\n- API key from OpenRouter\n- Model: GPT-4o-mini for cost efficiency"
},
"typeVersion": 1
},
{
"id": "ec852ebf-1b9a-43a5-90c1-9f972bc101ad",
"name": "Format for Slack",
"type": "n8n-nodes-base.code",
"position": [
1216,
176
],
"parameters": {
"jsCode": "// Format the AI summary for Slack\nconst output = $input.first().json.output;\nconst today = new Date().toLocaleDateString('en-US', { \n weekday: 'long', \n year: 'numeric', \n month: 'long', \n day: 'numeric' \n});\n\nlet slackMessage = `:email: *Daily Email Digest for ${today}*\\n\\n`;\nslackMessage += `*Total Emails Analyzed:* ${output.emailCount}\\n\\n`;\n\nif (output.urgentItems && output.urgentItems.length > 0) {\n slackMessage += `:warning: *Urgent Items:*\\n`;\n output.urgentItems.forEach(item => {\n slackMessage += `\u2022 ${item}\\n`;\n });\n slackMessage += `\\n`;\n}\n\nif (output.actionItems && output.actionItems.length > 0) {\n slackMessage += `:clipboard: *Action Items:*\\n`;\n output.actionItems.forEach(item => {\n slackMessage += `\u2022 ${item}\\n`;\n });\n slackMessage += `\\n`;\n}\n\nslackMessage += `:memo: *Summary:*\\n${output.summary}`;\n\nreturn {\n message: slackMessage,\n emailCount: output.emailCount\n};"
},
"typeVersion": 2
},
{
"id": "1e20a30b-a265-47ac-850a-1b4ff962e271",
"name": "Slack - Send Summary",
"type": "n8n-nodes-base.slack",
"position": [
1440,
176
],
"parameters": {
"text": "={{ $json.message }}",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "list",
"value": "C09L12N8F45",
"cachedResultName": "test"
},
"otherOptions": {},
"authentication": "oAuth2"
},
"typeVersion": 2.2
},
{
"id": "4f1132de-0ac8-49e1-a0c5-a4dbff364a08",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1376,
336
],
"parameters": {
"color": 7,
"height": 352,
"content": "## Slack Configuration\nSends the formatted daily digest to your Slack channel.\n\n**Setup Required:**\n1. Configure Slack OAuth2 credentials\n2. Select the target channel (default: #general)\n3. Grant bot permissions to post messages\n\n**Note:** Adjust the channel name to your preference"
},
"typeVersion": 1
},
{
"id": "b116a4a7-eb4d-43c7-99ef-f0f55d985273",
"name": "Item Lists",
"type": "n8n-nodes-base.aggregate",
"position": [
640,
176
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData"
},
"typeVersion": 1
},
{
"id": "ccf5813b-4e0c-476c-99df-fae172256d3c",
"name": "If",
"type": "n8n-nodes-base.if",
"position": [
416,
272
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "ee3a0b33-70b2-482a-9d3b-3dfe751952e8",
"operator": {
"type": "number",
"operation": "gt"
},
"leftValue": "={{ $items().length }}",
"rightValue": 0
}
]
}
},
"typeVersion": 2.2
},
{
"id": "eb88744e-7214-4c49-975e-525d0bf3614b",
"name": "Slack - No Emails",
"type": "n8n-nodes-base.slack",
"position": [
640,
368
],
"parameters": {
"text": "=*:email: Daily Email Digest \u2014 No emails*\nTarget date (JST): {{$now.setZone('Asia/Tokyo').minus({days:1}).toFormat('yyyy-LL-dd (ccc)')}}\nNo emails were found for yesterday. The next digest will run as scheduled.",
"select": "channel",
"channelId": {
"__rl": true,
"mode": "list",
"value": "C09L12N8F45",
"cachedResultName": "test"
},
"otherOptions": {},
"authentication": "oAuth2"
},
"typeVersion": 2.3
}
],
"active": false,
"settings": {
"callerPolicy": "workflowsFromSameOwner",
"errorWorkflow": "E2fdCmZVIRZ1HURh",
"executionOrder": "v1"
},
"versionId": "3509e277-92f9-4748-8272-2ff915f900c6",
"connections": {
"If": {
"main": [
[
{
"node": "Item Lists",
"type": "main",
"index": 0
}
],
[
{
"node": "Slack - No Emails",
"type": "main",
"index": 0
}
]
]
},
"Item Lists": {
"main": [
[
{
"node": "AI Agent - Analyze Emails",
"type": "main",
"index": 0
}
]
]
},
"Format for Slack": {
"main": [
[
{
"node": "Slack - Send Summary",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "Gmail - Get Yesterday's Emails",
"type": "main",
"index": 0
}
]
]
},
"OpenRouter Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent - Analyze Emails",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "AI Agent - Analyze Emails",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"AI Agent - Analyze Emails": {
"main": [
[
{
"node": "Format for Slack",
"type": "main",
"index": 0
}
]
]
},
"Gmail - Get Yesterday's Emails": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Teams that start their day in Slack and want a concise, automated summary of yesterday’s emails—ops leads, PMs, founders, and anyone handling busy inboxes without writing code.
Source: https://n8n.io/workflows/9638/ — 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.
Automates financial risk evaluation by intelligently consolidating information from five critical sources: financial, operational, legal, insurance, and regulatory systems. Hourly triggers enable cont
This workflow automates competitive real estate pricing analysis by combining multiple MLS data sources with AI-powered market intelligence. Designed for real estate professionals, property managers,
This n8n template automatically processes your industry newsletters and creates AI-powered intelligence briefs that filter signal from noise. Perfect for busy professionals who need to stay informed w
Who is this for? Agencies, consultants, and service providers who conduct discovery calls and need to quickly turn conversations into professional proposals.
Created by: Peyton Leveillee Last updated: October 2025