{
  "name": "Create AI-summarized email digests from Gmail labels with OpenAI O4-Mini",
  "nodes": [
    {
      "id": "6e739c6d-8fe0-46ba-9f92-c88adff879cf",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -260,
        440
      ]
    },
    {
      "id": "572ca84c-f3b8-478d-aa51-4d63ae462671",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -40,
        260
      ]
    },
    {
      "id": "8f6dafea-8cf6-47d5-b117-58f748de860e",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        80,
        280
      ]
    },
    {
      "id": "ae79599f-c03c-4ca3-a074-89348c1d7d4e",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        180,
        460
      ]
    },
    {
      "id": "646ced0e-cd43-449b-917c-bd376b748c15",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        40,
        660
      ]
    },
    {
      "id": "d7c20f5e-f388-474a-975b-413292a1ad60",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        460,
        240
      ]
    },
    {
      "id": "7681c2c6-ccbc-4675-8f5d-9ebfe52e1788",
      "name": "Combine Subject and Body",
      "type": "n8n-nodes-base.code",
      "position": [
        680,
        240
      ]
    },
    {
      "id": "b39f8459-49b0-47e9-8848-71d76aac8149",
      "name": "Summarization Mails",
      "type": "@n8n/n8n-nodes-langchain.chainSummarization",
      "position": [
        -20,
        40
      ]
    },
    {
      "id": "5176a79f-2d9b-43c9-a20a-819e60bda044",
      "name": "Send Digested mail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        900,
        240
      ]
    },
    {
      "id": "67798876-7912-4597-9959-000bf8f870af",
      "name": "Get mails (last 24h)",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -480,
        440
      ]
    },
    {
      "id": "de4aab88-76ea-4688-8385-47406e01c2e5",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -680,
        440
      ]
    },
    {
      "id": "d45213a8-e076-48ac-8593-55a12ec18245",
      "name": "Main Workflow Explanation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1180,
        0
      ],
      "parameters": {
        "width": 460,
        "height": 800,
        "content": "## Daily Email Digest with AI Summarization\n### This n8n workflow automatically creates AI-powered summaries of labeled emails and sends them as a daily digest.\n\nPerfect for staying on top of newslett"
      }
    },
    {
      "id": "4bfbdef6-39fd-464e-9ccf-1d1bd71e2372",
      "name": "Email Retrieval Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -700,
        580
      ],
      "parameters": {
        "width": 300,
        "height": 300,
        "content": "## 1. Scheduled Email Retrieval\n[Read more about Schedule Trigger](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/)\n[Read more about Gmail node](https://docs.n8n.io"
      }
    },
    {
      "id": "290e0ef6-60a0-4f0a-8040-31ed41a91af8",
      "name": "AI Processing Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -260
      ],
      "parameters": {
        "width": 520,
        "height": 360,
        "content": "## 2. AI-Powered Email Summarization\n[Read more about LangChain nodes](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainSummarization/)\n\nEach email is process"
      }
    },
    {
      "id": "4a78b0ba-cdea-4da8-9929-a955eafbefa5",
      "name": "Formatting and Output Section",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        -80
      ],
      "parameters": {
        "width": 580,
        "height": 700,
        "content": "## 3. Content Formatting and Email Delivery\n[Read more about Code node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code/)\n\nThe summarized emails are combined into a single dige"
      }
    },
    {
      "id": "75c6d291-083b-416d-b8fa-ecfe24b875d7",
      "name": "Conditional Processing",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        580
      ],
      "parameters": {
        "width": 280,
        "height": 200,
        "content": "## Smart Processing\n[Read more about If node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.if/)\n\nThe workflow intelligently checks if any emails were found. If no emails match th"
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Summarization Mails",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Combine Subject and Body",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get mails (last 24h)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Summarization Mails",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Summarization Mails",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Summarization Mails": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get mails (last 24h)": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Subject and Body": {
      "main": [
        [
          {
            "node": "Send Digested mail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}