Täglicher automatisierter E-Mail-Versand

Fortgeschritten

Dies ist ein Other, AI-Bereich Automatisierungsworkflow mit 12 Nodes. Hauptsächlich werden Code, Gmail, Aggregate, Agent, ScheduleTrigger und andere Nodes verwendet, kombiniert mit KI-Technologie für intelligente Automatisierung. Automatisierte tägliche E-Mail-Analyse und -Zusammenfassung mit GPT-4o und Gmail

Voraussetzungen
  • Google-Konto + Gmail API-Anmeldedaten
  • OpenAI 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": "Ucu10DYuMwYdLLVk",
  "meta": {
    "instanceId": "159ec2e1d690fe685084d28de8ca73848642bf563457a19b94cfc00f23a0d9a9",
    "templateCredsSetupCompleted": true
  },
  "name": "Scheduled Daily Email Pulse",
  "tags": [],
  "nodes": [
    {
      "id": "908a85db-7b15-4ece-8dab-19398e0c1871",
      "name": "Zeitplan-Auslöser",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -80,
        -80
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 18
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8cadc5e6-193e-42e9-b2fc-54a2025191c2",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        360,
        -80
      ],
      "webhookId": "6fbdcf54-7d41-4fb0-aa17-07edb33cd5d0",
      "parameters": {
        "simple": false,
        "filters": {
          "receivedAfter": "={{ $json.today}}",
          "receivedBefore": "={{ $json.tomorrow }}"
        },
        "options": {},
        "operation": "getAll"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "gUrhTlOlNSEw7OKA",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1,
      "alwaysOutputData": true
    },
    {
      "id": "62ab4e36-b42f-4aff-8ec5-4456f4827ca3",
      "name": "Datums-Transformer",
      "type": "n8n-nodes-base.code",
      "position": [
        140,
        -80
      ],
      "parameters": {
        "jsCode": "const now = new Date();\nconst today = new Date(now.getFullYear(), now.getMonth(), now.getDate());\nconst tomorrow = new Date(today);\ntomorrow.setDate(today.getDate() + 1);\n\nconst isoDate = (d) => d.toISOString().split('.')[0] + 'Z';\n\nreturn [\n  {\n    json: {\n      today: isoDate(today),\n      tomorrow: isoDate(tomorrow),\n    },\n  },\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "c25a964f-6d41-4c97-b90f-f5ce15cadaa7",
      "name": "KI-Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1020,
        160
      ],
      "parameters": {
        "text": "You are an AI Chief of Staff for a small business owner. Your job is to review a day’s worth of emails, texts, and calls and produce a concise, structured summary that helps them stay focused and effective.\n\nYou must only surface tasks, people, and opportunities that appear in the message content. Do not invent next steps, leads, or strategy notes.\n\nIf a section has no relevant content, leave it out entirely. It’s better to report nothing than to guess.",
        "options": {
          "systemMessage": "=Below is a transcript of today’s messages — including email, text, and call summaries.\n\nAnalyze the content and generate a markdown-formatted **Daily Business Pulse**, using only what appears in the messages. Do not assume, extrapolate, or fabricate any details.\n\nMessages:\n{{ $json.combinedText }}\n\nUse the structure below. Omit any section that has no relevant content.\n\n---\n\n👋 **Here’s what matters from your day**\n\n---\n\n📝 **Open Loops / Pending Follow-Ups**  \n_List any conversations that require a response or action._\n\n---\n\n🚀 **Next Steps You've Committed To**  \n_List anything the user said they would do._\n\n---\n\n🧲 **Leads or Conversations Worth Following Up On**  \n_Only include if the person expressed interest or asked for help._\n\n---\n\n🛑 **Conversations That Aren’t Leading Anywhere**  \n_Include if there are back-and-forths with no progress, spam, or promotional threads._\n\n---\n\n🧠 **Strategy Notes**  \n_Only add notes if there are clear, recurring themes or opportunities based on the content._\n\n---\n\n✅ **Top 3 Tasks for Tomorrow**  \n_If tasks were mentioned and clearly matter, list the top 3. Otherwise, leave this out._"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "fe2552ce-48be-44bd-b975-cde379b46b51",
      "name": "OpenAI Chat-Modell",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1020,
        360
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "qiPWoGhtEMQi7AWs",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d2410164-fde8-46f1-8df1-6cbf3874d397",
      "name": "Aggregator",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        580,
        60
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "headers.from"
            },
            {
              "fieldToAggregate": "headers.subject"
            },
            {
              "fieldToAggregate": "text"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9c3c28f5-35d5-4164-a694-8a9bc26354d5",
      "name": "Notizzettel",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        -120
      ],
      "parameters": {
        "color": 4,
        "width": 620,
        "height": 200,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "476d2f5a-c0da-4683-89a2-9cbe9d93c638",
      "name": "Notizzettel1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        520,
        40
      ],
      "parameters": {
        "color": 6,
        "width": 420,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "f9301bfa-2cd7-4eaf-9798-729604a6b49a",
      "name": "Notizzettel2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        980,
        140
      ],
      "parameters": {
        "width": 540,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "5cdda71c-ba41-41ba-aae1-66d39caf75c9",
      "name": "E-Mail-Bereinigung",
      "type": "n8n-nodes-base.code",
      "position": [
        780,
        60
      ],
      "parameters": {
        "jsCode": "const cleanMessages = items.map(item => {\n  const from = item.json.header?.from || \"Unknown sender\";\n  const subject = item.json.header?.subject || \"No subject\";\n  const rawBody = item.json.text || \"\"; // fall back to empty string\n  const body = String(rawBody); // ensure it's a string\n\n  const cleaned = body\n    .replace(/<\\/?[^>]+(>|$)/g, \"\")             // Remove HTML\n    .replace(/(Unsubscribe|View in browser)/gi, \"\") // Strip only promo triggers\n    .replace(/\\n{3,}/g, \"\\n\\n\")                 // Collapse excess breaks\n    .trim();                                    // Clean up\n\n  return `📩 **From:** ${from}\\n**Subject:** ${subject}\\n**Preview:**\\n${cleaned}\\n\\n---\\n`;\n});\n\nreturn [{\n  json: {\n    combinedText: cleanMessages.join('\\n')\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "0807cef5-876f-433d-a94a-2db7f86d844d",
      "name": "HTML-Formatierung",
      "type": "n8n-nodes-base.code",
      "position": [
        1380,
        160
      ],
      "parameters": {
        "jsCode": "const markdown = $input.all().map((item) => item.json.output);\nlet html = markdown.map((md) =>\n  md\n    .replace(/(\\*\\*|__)(.*?)\\1/g, \"<b>$2</b>\")\n    .replace(/(\\*|_)(.*?)\\1/g, \"<i>$2</i>\")\n    .replace(/~~(.*?)~~/g, \"<del>$1</del>\")\n    .replace(/`([^`\\n]+)`/g, \"<code>$1</code>\")\n    .replace(/!\\[([^\\]]+)\\]\\(([^\\)]+)\\)/g, '<img src=\"$2\" alt=\"$1\">')\n    .replace(/\\[([^\\]]+)\\]\\(([^\\)]+)\\)/g, '<a href=\"$2\">$1</a>')\n    .replace(/(\\r\\n|\\n|\\r)/gm, \"<br>\"),\n);\n\nreturn { html };\n"
      },
      "typeVersion": 2
    },
    {
      "id": "bfc39659-9e36-4dde-9536-558d491f965c",
      "name": "Nachricht senden",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1580,
        320
      ],
      "webhookId": "39d8fc4a-0fa4-4a13-a123-2f1373787a79",
      "parameters": {
        "sendTo": "zawagner@gmail.com",
        "message": "={{ $json.html[0] }}",
        "options": {},
        "subject": "Here's Your Daily Pulse"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "gUrhTlOlNSEw7OKA",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "fa9af357-4a58-4540-94d4-7228678ea75b",
  "connections": {
    "8cadc5e6-193e-42e9-b2fc-54a2025191c2": {
      "main": [
        [
          {
            "node": "d2410164-fde8-46f1-8df1-6cbf3874d397",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "c25a964f-6d41-4c97-b90f-f5ce15cadaa7": {
      "main": [
        [
          {
            "node": "0807cef5-876f-433d-a94a-2db7f86d844d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d2410164-fde8-46f1-8df1-6cbf3874d397": {
      "main": [
        [
          {
            "node": "5cdda71c-ba41-41ba-aae1-66d39caf75c9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0807cef5-876f-433d-a94a-2db7f86d844d": {
      "main": [
        [
          {
            "node": "bfc39659-9e36-4dde-9536-558d491f965c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5cdda71c-ba41-41ba-aae1-66d39caf75c9": {
      "main": [
        [
          {
            "node": "c25a964f-6d41-4c97-b90f-f5ce15cadaa7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "62ab4e36-b42f-4aff-8ec5-4456f4827ca3": {
      "main": [
        [
          {
            "node": "8cadc5e6-193e-42e9-b2fc-54a2025191c2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "908a85db-7b15-4ece-8dab-19398e0c1871": {
      "main": [
        [
          {
            "node": "62ab4e36-b42f-4aff-8ec5-4456f4827ca3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fe2552ce-48be-44bd-b975-cde379b46b51": {
      "ai_languageModel": [
        [
          {
            "node": "c25a964f-6d41-4c97-b90f-f5ce15cadaa7",
            "type": "ai_languageModel",
            "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?

Fortgeschritten - Sonstiges, Künstliche Intelligenz

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
Fortgeschritten
Anzahl der Nodes12
Kategorie2
Node-Typen7
Schwierigkeitsbeschreibung

Für erfahrene Benutzer, mittelkomplexe Workflows mit 6-15 Nodes

Externe Links
Auf n8n.io ansehen

Diesen Workflow teilen

Kategorien

Kategorien: 34