毎日のメールとカレンダー要約をSlackにGemini AIとGoogle Workspaceで送る
これはMiscellaneous, AI Summarization, Multimodal AI分野の自動化ワークフローで、20個のノードを含みます。主にCode, Cron, Gmail, Merge, Slackなどのノードを使用。 毎日のメールとカレンダー要約をSlackに送信(Gemini AI、Google Workspace)
- •Googleアカウント + Gmail API認証情報
- •Slack Bot Token または Webhook URL
- •Google Sheets API認証情報
- •Google Gemini API Key
{
"id": "86qWVU9iA1LQM3pC",
"meta": {
"instanceId": "bbc3fa3cd7d64d8ff0c4877d98dee68ce7dadacc5e089546680c915b3e5a212b"
},
"name": "Daily Email & Calendar Summaries to Slack with Gemini AI & Google Workspace",
"tags": [],
"nodes": [
{
"id": "766a5fc5-00d7-4874-ac0d-c3727476a708",
"name": "Cron",
"type": "n8n-nodes-base.cron",
"position": [
-1216,
-96
],
"parameters": {
"triggerTimes": {
"item": [
{
"hour": 8
}
]
}
},
"typeVersion": 1
},
{
"id": "83f5136b-f441-4419-b31e-9c7e31705777",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
576,
-176
],
"parameters": {
"options": {}
},
"typeVersion": 1
},
{
"id": "4339797c-3b99-41a2-b66d-d41b604a7efc",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
576,
256
],
"parameters": {
"text": "=You are an assistant that summarizes calendar data clearly. \n\n### Task\n1. Summarize the calendar events. \n - Use the format: [Date | Time] → [Event Title] – [Short Notes/Details]. \n\n### Formatting Rules\n- Each summary should be on a new line with no markdown symbols. \n- Maximum of 5 sentences and minimum of 1 sentence. \n- Add a prefix and suffix star for the heading Calendar. \n- Do not include links in the emails. \n\nSummary: \n\n### Example Output\n*Calendar Summary:* \n2025-08-26 | 10:00 AM - 10:30 AM → Team Standup – Daily sync-up \n2025-08-26 | 12:00 PM - 12:30 PM → Team Standup – n8n meeting ",
"options": {},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "44707b49-2c51-4295-b1b5-431199ceacc9",
"name": "Google カレンダーから複数のイベントを取得",
"type": "n8n-nodes-base.googleCalendarTool",
"position": [
688,
448
],
"parameters": {
"options": {},
"timeMax": "={{$today.plus({days: 1}).toISO()}}",
"timeMin": "={{$today.toISO()}}",
"calendar": {
"__rl": true,
"mode": "id",
"value": ""
},
"operation": "getAll"
},
"typeVersion": 1.3
},
{
"id": "cee7ac7f-54ef-4240-a87f-755ae7bc8407",
"name": "AI Agent1",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
640,
-336
],
"parameters": {
"text": "=You are an assistant that summarizes email messages from the provided JSON array {{ $json.text }}.\n\nInstructions:\n- For each email in the array, generate a summary in exactly 3 sentences.\n- Each summary must include:\n • Sender (from the \"{{ $json.from.value[0].name }}\" field)\n • Subject (from the \"{{ $json.subject }}\" field)\n • Brief summary of the \"{{ $json.text }}\" content \n- Do not use bullet points or markdown. \n- Keep the tone professional and concise, suitable for sending to Slack. \n- Output summaries one after another, separated by a blank line.\n- Send this as Json\n{\n\"from\":\"[sender email]\"\n\"subject\": \"[subject line]\"\n\"summary\":\"[3 sentence summary]\"\n}\n\n\nDon't use \\n should send in a format that can parse as json using JavaScript or Python",
"options": {},
"promptType": "define"
},
"typeVersion": 2.2
},
{
"id": "7cd241f5-05b8-4fcd-a0fb-941a1db50c78",
"name": "未読メールを週次で取得",
"type": "n8n-nodes-base.gmail",
"position": [
-720,
-336
],
"webhookId": "26acee9e-eb01-479e-812d-44974d9430dc",
"parameters": {
"limit": 100,
"simple": false,
"filters": {
"labelIds": [
"INBOX"
],
"readStatus": "unread",
"receivedAfter": "={{ $today.minus({ days: 7 }).toISODate() }}"
},
"options": {},
"operation": "getAll"
},
"typeVersion": 2.1
},
{
"id": "bcd7209d-94a7-4fbb-9b3c-dc54d6572cc3",
"name": "名前、メールアドレス、件名を取得",
"type": "n8n-nodes-base.googleSheets",
"position": [
-464,
-336
],
"parameters": {
"sheetName": {
"__rl": true,
"mode": "list",
"value": "",
"cachedResultUrl": "",
"cachedResultName": ""
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "="
}
},
"executeOnce": true,
"typeVersion": 4.7
},
{
"id": "783b5790-812d-4688-9a49-b8e7f77ae24c",
"name": "スプレッドシートからデータを再構築",
"type": "n8n-nodes-base.code",
"position": [
-48,
-336
],
"parameters": {
"jsCode": "const items = $input.all().map(i => i.json);\n\nconst result = {\n emails: [],\n name: [],\n subjects: []\n};\n\nfor (const row of items) {\n if (row.Email && row.Email.trim() !== \"\") {\n result.emails.push(row.Email);\n }\n if (row.Name && row.Name.trim() !== \"\") {\n result.name.push(row.Name);\n }\n if (row.Subject && row.Subject.trim() !== \"\") {\n result.subjects.push(row.Subject);\n }\n}\n\n// Return as array of one item\nreturn [{ json: result }];\n"
},
"executeOnce": true,
"typeVersion": 2
},
{
"id": "1bc739a9-0082-417a-b60e-88069bc2742c",
"name": "メールをフィルタリング",
"type": "n8n-nodes-base.code",
"position": [
208,
-336
],
"parameters": {
"jsCode": "const emails = $input.first().json.emails; // list of blocked emails\nconst subjects = $input.first().json.subjects;\nconst names = $input.first().json.name;// list of blocked subjects\n\nreturn $('Get weekly unread emails').all().filter(item => {\n const email = item.json.from.value[0].address; \n const subject = item.json.subject; \n const name = item.json.from.value[0].name; \n\n return emails.includes(email) || subjects.includes(subject) ||names.includes(name) ;\n});"
},
"typeVersion": 2
},
{
"id": "a809c2be-4563-48fe-b096-2126d67dbde0",
"name": "AIエージェントからのコードを再構築",
"type": "n8n-nodes-base.code",
"position": [
960,
-336
],
"parameters": {
"jsCode": "// Get all input items\nlet items = $input.all();\n\n// Initialize Slack blocks\nlet blocks = [];\n\nfor (let item of items) {\n let raw = item.json.output; // raw string with ```json ... ```\n\n // Clean backticks and parse\n let cleaned = raw.replace(/```json\\n?/, \"\").replace(/```$/, \"\");\n let parsed = JSON.parse(cleaned);\n\n // Add Slack blocks\n blocks.push({ type: \"divider\" });\n blocks.push({\n type: \"section\",\n text: {\n type: \"mrkdwn\",\n text: `*${parsed.from}*\\n*${parsed.subject}*\\n${parsed.summary}`\n }\n });\n}\n\n// Return one Slack message with all blocks\nreturn [\n {\n json: {\n blocks: blocks\n }\n }\n];\n"
},
"executeOnce": false,
"typeVersion": 2
},
{
"id": "20bd2254-88a0-4238-ad91-fcd6708b9def",
"name": "AIエージェントからのコードを再構築",
"type": "n8n-nodes-base.code",
"position": [
992,
256
],
"parameters": {
"jsCode": "// Get all input items\nlet items = $input.all();\n\n// Initialize Slack blocks\nlet blocks = [];\n\nfor (let item of items) {\n let text = item.json.output;\n\n blocks.push({ type: \"divider\" });\n blocks.push({\n type: \"section\",\n text: {\n type: \"mrkdwn\",\n text: `${text}`\n }\n });\n}\n\nreturn [\n {\n json: {\n blocks: blocks\n }\n }\n];\n"
},
"typeVersion": 2
},
{
"id": "e6c0ad9c-0da5-4e59-bfdf-7f8381e1f241",
"name": "メールとイベントを追加",
"type": "n8n-nodes-base.merge",
"position": [
1552,
-48
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "9ad25b6a-fe2e-487c-a232-bdd36585ae8b",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
-832,
-432
],
"parameters": {
"color": 3,
"width": 544,
"height": 288,
"content": "## Get the unread emails for the past one week\n\n"
},
"typeVersion": 1
},
{
"id": "50ae9ce1-1bc5-42bd-bbe0-a16fd1c513d0",
"name": "付箋1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-176,
-480
],
"parameters": {
"width": 576,
"height": 336,
"content": "## Filter out emails based on Name, Email, Subject\n**Users can configure the name, email and subject in the Excel sheet. Emails will then be filtered based on these parameters, allowing users to retrieve only the emails they need.** "
},
"typeVersion": 1
},
{
"id": "0fe896b9-abe0-4134-b285-838206b9bb37",
"name": "付箋2",
"type": "n8n-nodes-base.stickyNote",
"position": [
512,
-480
],
"parameters": {
"width": 608,
"height": 464,
"content": "\n## Summarizing emails\n**Emails are summarized using an AI agent. The agent reads each email individually, generates a concise summary with Gemini AI, and restructures the output to seamlessly merge with event data.** "
},
"typeVersion": 1
},
{
"id": "2a4fe129-be9f-4e12-8379-ca6ba058e9e9",
"name": "付箋3",
"type": "n8n-nodes-base.stickyNote",
"position": [
480,
80
],
"parameters": {
"color": 4,
"width": 704,
"height": 496,
"content": "\n## Summarizing Events\n**Read Google calendar and get events for the data and summarize it and restructure t**"
},
"typeVersion": 1
},
{
"id": "57547082-e53f-4372-8f48-24dba3f768bf",
"name": "付箋4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1456,
-224
],
"parameters": {
"color": 6,
"width": 688,
"height": 400,
"content": "## Send the event summary and Email summary to slack\n"
},
"typeVersion": 1
},
{
"id": "b595b001-08cf-4497-a5aa-afd3bba4d496",
"name": "付箋5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1824,
-928
],
"parameters": {
"width": 592,
"height": 576,
"content": "## 📩 Daily Email & 🗓️ Calendar Summary → 📢 Slack Notification System\n\n\n\n\n**What it does** \n- Reads unread emails from the last 7 days.\n- Retrieves events from calendar for the current day.\n- Filters emails based on **Name, Email, and Subject** \n- Pulls Name, Email, and Subject from Google Sheets. \n- Summarizes emails and events using an AI model.\n- Sends a Slack notification to a designated channel every morning.\n\n**Requirements** \n- Google Sheet with columns: **Name, Email, Subject**. \n- Gmail account to fetch unread emails.\n- Gemini AI model to summarize the data.\n- Slack with a dedicated channel to receive notifications.\n\n**Setup Instructions** \n- Create a Google Sheet with the required columns (**Name, Email, Subject**).\n- Set up Google Sheets and Gmail credentials.\n- Replace the sheet name and file name in the Google Sheets node. \n- Update email addresses in the notification nodes. \n- Set up Gemini with credentials.\n- Set up Slack with an API key and define the channel.\n"
},
"typeVersion": 1
},
{
"id": "09162e4b-5d61-420b-a906-475ab749f6e3",
"name": "メッセージを送信",
"type": "n8n-nodes-base.slack",
"position": [
1952,
-48
],
"webhookId": "b0de3b56-3196-4d08-bfe7-b90db5a2ac9a",
"parameters": {
"select": "channel",
"blocksUi": "={{ '{ \"blocks\": ' + JSON.stringify($json.blocks) + ' }' }}",
"channelId": {
"__rl": true,
"mode": "id",
"value": ""
},
"messageType": "block",
"otherOptions": {
"includeLinkToWorkflow": false
},
"authentication": "oAuth2"
},
"typeVersion": 2.3
},
{
"id": "20be74e9-31be-44f9-aca9-28db494ea197",
"name": "コードをslackブロックに再構築",
"type": "n8n-nodes-base.code",
"position": [
1760,
-48
],
"parameters": {
"jsCode": "const allInputs = $input.all();\n\nconst mergedBlocks = allInputs.flatMap(item => item.json.blocks || []);\n\nreturn {\n json: {\n blocks: mergedBlocks\n }\n};\n"
},
"executeOnce": false,
"typeVersion": 2
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "5e78ad2b-6bb6-4432-b4ce-59cd0fa02804",
"connections": {
"766a5fc5-00d7-4874-ac0d-c3727476a708": {
"main": [
[
{
"node": "7cd241f5-05b8-4fcd-a0fb-941a1db50c78",
"type": "main",
"index": 0
},
{
"node": "4339797c-3b99-41a2-b66d-d41b604a7efc",
"type": "main",
"index": 0
}
]
]
},
"4339797c-3b99-41a2-b66d-d41b604a7efc": {
"main": [
[
{
"node": "20bd2254-88a0-4238-ad91-fcd6708b9def",
"type": "main",
"index": 0
}
]
]
},
"cee7ac7f-54ef-4240-a87f-755ae7bc8407": {
"main": [
[
{
"node": "20bd2254-88a0-4238-ad91-fcd6708b9def",
"type": "main",
"index": 0
}
]
]
},
"1bc739a9-0082-417a-b60e-88069bc2742c": {
"main": [
[
{
"node": "cee7ac7f-54ef-4240-a87f-755ae7bc8407",
"type": "main",
"index": 0
}
]
]
},
"e6c0ad9c-0da5-4e59-bfdf-7f8381e1f241": {
"main": [
[
{
"node": "20be74e9-31be-44f9-aca9-28db494ea197",
"type": "main",
"index": 0
}
]
]
},
"7cd241f5-05b8-4fcd-a0fb-941a1db50c78": {
"main": [
[
{
"node": "bcd7209d-94a7-4fbb-9b3c-dc54d6572cc3",
"type": "main",
"index": 0
}
]
]
},
"83f5136b-f441-4419-b31e-9c7e31705777": {
"ai_languageModel": [
[
{
"node": "4339797c-3b99-41a2-b66d-d41b604a7efc",
"type": "ai_languageModel",
"index": 0
},
{
"node": "cee7ac7f-54ef-4240-a87f-755ae7bc8407",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"bcd7209d-94a7-4fbb-9b3c-dc54d6572cc3": {
"main": [
[
{
"node": "783b5790-812d-4688-9a49-b8e7f77ae24c",
"type": "main",
"index": 0
}
]
]
},
"44707b49-2c51-4295-b1b5-431199ceacc9": {
"ai_tool": [
[
{
"node": "4339797c-3b99-41a2-b66d-d41b604a7efc",
"type": "ai_tool",
"index": 0
}
]
]
},
"20bd2254-88a0-4238-ad91-fcd6708b9def": {
"main": [
[
{
"node": "e6c0ad9c-0da5-4e59-bfdf-7f8381e1f241",
"type": "main",
"index": 0
}
]
]
},
"20be74e9-31be-44f9-aca9-28db494ea197": {
"main": [
[
{
"node": "09162e4b-5d61-420b-a906-475ab749f6e3",
"type": "main",
"index": 0
}
]
]
},
"783b5790-812d-4688-9a49-b8e7f77ae24c": {
"main": [
[
{
"node": "1bc739a9-0082-417a-b60e-88069bc2742c",
"type": "main",
"index": 0
}
]
]
}
}
}このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
上級 - その他, AI要約, マルチモーダルAI
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
Sayone Technologies
@sayonetechSayOne Technologies is a digital transformation and IT services company headquartered in India, with a strong focus on web, mobile, and AI-driven solutions for the retail tech space. With over a decade of experience, SayOne partners with global businesses to build scalable applications, optimize inventory and operations using next-gen AI, and deliver customer-centric digital products.
このワークフローを共有