Verwende Gemini AI und Google Workspace, um tägliche E-Mail- und Kalenderzusammenfassungen an Slack zu senden

Experte

Dies ist ein Miscellaneous, AI Summarization, Multimodal AI-Bereich Automatisierungsworkflow mit 20 Nodes. Hauptsächlich werden Code, Cron, Gmail, Merge, Slack und andere Nodes verwendet. Tägliche E-Mail- und Kalenderzusammenfassung an Slack mit Gemini AI und Google Workspace

Voraussetzungen
  • Google-Konto + Gmail API-Anmeldedaten
  • Slack Bot Token oder Webhook URL
  • Google Sheets API-Anmeldedaten
  • Google Gemini API Key
Workflow-Vorschau
Visualisierung der Node-Verbindungen, mit Zoom und Pan
Workflow exportieren
Kopieren Sie die folgende JSON-Konfiguration und importieren Sie sie in n8n
{
  "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-Job",
      "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-Modell",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        576,
        -176
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "4339797c-3b99-41a2-b66d-d41b604a7efc",
      "name": "KI-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": "Get many events in Google Kalender",
      "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": "KI-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": "Get weekly unread emails",
      "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": "Get Names, emails and subject",
      "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": "Restructure the data from spread sheet",
      "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": "Filter the emails",
      "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": "Restructure the code from the AI agent",
      "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": "Restructure the code from AI agent",
      "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": "Append mails and events",
      "type": "n8n-nodes-base.merge",
      "position": [
        1552,
        -48
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "9ad25b6a-fe2e-487c-a232-bdd36585ae8b",
      "name": "Haftnotiz",
      "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": "Haftnotiz1",
      "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": "Haftnotiz2",
      "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": "Haftnotiz3",
      "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": "Haftnotiz4",
      "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": "Haftnotiz5",
      "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": "Send a message",
      "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": "Restructure the code into slack block",
      "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": {
    "Cron": {
      "main": [
        [
          {
            "node": "7cd241f5-05b8-4fcd-a0fb-941a1db50c78",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "20bd2254-88a0-4238-ad91-fcd6708b9def",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent1": {
      "main": [
        [
          {
            "node": "a809c2be-4563-48fe-b096-2126d67dbde0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1bc739a9-0082-417a-b60e-88069bc2742c": {
      "main": [
        [
          {
            "node": "AI Agent1",
            "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
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "AI Agent1",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "bcd7209d-94a7-4fbb-9b3c-dc54d6572cc3": {
      "main": [
        [
          {
            "node": "783b5790-812d-4688-9a49-b8e7f77ae24c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many events in Google Calendar": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "20bd2254-88a0-4238-ad91-fcd6708b9def": {
      "main": [
        [
          {
            "node": "e6c0ad9c-0da5-4e59-bfdf-7f8381e1f241",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "20be74e9-31be-44f9-aca9-28db494ea197": {
      "main": [
        [
          {
            "node": "09162e4b-5d61-420b-a906-475ab749f6e3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a809c2be-4563-48fe-b096-2126d67dbde0": {
      "main": [
        [
          {
            "node": "e6c0ad9c-0da5-4e59-bfdf-7f8381e1f241",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "783b5790-812d-4688-9a49-b8e7f77ae24c": {
      "main": [
        [
          {
            "node": "1bc739a9-0082-417a-b60e-88069bc2742c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Häufig gestellte Fragen

Wie verwende ich diesen Workflow?

Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.

Für welche Szenarien ist dieser Workflow geeignet?

Experte - Verschiedenes, KI-Zusammenfassung, Multimodales KI

Ist es kostenpflichtig?

Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.

Workflow-Informationen
Schwierigkeitsgrad
Experte
Anzahl der Nodes20
Kategorie3
Node-Typen10
Schwierigkeitsbeschreibung

Für fortgeschrittene Benutzer, komplexe Workflows mit 16+ Nodes

Autor
Sayone Technologies

Sayone Technologies

@sayonetech

SayOne 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.

Externe Links
Auf n8n.io ansehen

Diesen Workflow teilen

Kategorien

Kategorien: 34