{
  "name": "Automate email classification & summary with Gmail, GPT-4o-mini & Notion",
  "nodes": [
    {
      "id": "cba3ea9b-89d2-4ef4-a5fd-6cd4c06fd71c",
      "name": "Get Unread Emails",
      "type": "n8n-nodes-base.gmail",
      "position": [
        48,
        -32
      ]
    },
    {
      "id": "cb5df628-43a2-4946-8227-3597ce9a85a3",
      "name": "Split Emails",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        272,
        -32
      ]
    },
    {
      "id": "abc26329-6683-4e9a-a1f7-c95e104d051d",
      "name": "Format Summary",
      "type": "n8n-nodes-base.code",
      "position": [
        1120,
        -32
      ]
    },
    {
      "id": "84ca122e-fcf1-4a84-89dc-b486d8f001b2",
      "name": "Aggregate Summary",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1344,
        -32
      ]
    },
    {
      "id": "b2ca17b9-343c-4a90-99da-b0abcb54e492",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        720,
        -32
      ]
    },
    {
      "id": "2706328f-d171-429b-9352-b29dc493fb42",
      "name": "Azure OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        816,
        192
      ]
    },
    {
      "id": "61f74b7f-dd74-44ab-bb31-8e460098d7a1",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -176,
        -32
      ]
    },
    {
      "id": "bb021292-df71-4e01-a7de-2650a6444347",
      "name": "Send to Notion",
      "type": "n8n-nodes-base.notion",
      "position": [
        1584,
        -32
      ]
    },
    {
      "id": "16aa3045-abeb-49c6-be2a-a2c9b802f92b",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        496,
        -32
      ]
    },
    {
      "id": "1c75cd51-b5ce-43bf-88f0-d1bef310917a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -416,
        -288
      ],
      "parameters": {
        "width": null,
        "height": 256,
        "content": "🚀 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 test"
      }
    },
    {
      "id": "7e9c4c9f-3254-4e98-ad38-82a675926aaa",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        -416
      ],
      "parameters": {
        "width": null,
        "height": 352,
        "content": "📊 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"
      }
    },
    {
      "id": "779afae0-f16d-4478-8398-089da6229916",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -416
      ],
      "parameters": {
        "width": null,
        "height": 368,
        "content": "🤖 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 intellige"
      }
    },
    {
      "id": "b6ae2c79-b46d-425e-94b1-0583a11e244f",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        -400
      ],
      "parameters": {
        "width": null,
        "height": 352,
        "content": "✏️ 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: Prepare"
      }
    },
    {
      "id": "e37b3942-dce1-4cd7-94fa-72daab915960",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        -368
      ],
      "parameters": {
        "width": null,
        "height": 320,
        "content": "🔄 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 indi"
      }
    },
    {
      "id": "fc4e9bbc-76fd-4d28-8834-b891f122a48d",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -368
      ],
      "parameters": {
        "width": null,
        "height": 320,
        "content": "📧 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 sour"
      }
    },
    {
      "id": "1aa60f5e-187d-42c9-b824-ea3478e42d1b",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        -416
      ],
      "parameters": {
        "width": null,
        "height": 352,
        "content": "📈 INTELLIGENCE CONSOLIDATOR\n\nPurpose: Combines individual email summaries into comprehensive batch report.\n\nFunction: Merges multiple email insights, identifies patterns, creates overview dashboard.\n\n"
      }
    },
    {
      "id": "a51c16db-0caa-47ad-b7df-0df25e1f7558",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        528,
        240
      ],
      "parameters": {
        "width": null,
        "height": 368,
        "content": "🧠 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\nCritica"
      }
    },
    {
      "id": "bb3b9be7-7154-4070-8616-c8a16c6e43f7",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1664,
        -416
      ],
      "parameters": {
        "width": null,
        "height": 368,
        "content": "📝 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 lo"
      }
    }
  ],
  "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 ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get Unread Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}