{
  "name": "Daily newsletter service using Excel, Outlook and AI",
  "nodes": [
    {
      "id": "c3a9ba81-3a7e-4afe-be8b-cf482cbb88c2",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1040,
        -540
      ]
    },
    {
      "id": "f63d035c-5a7b-4cf4-8730-5fa7dff6f94b",
      "name": "Get Subscribers",
      "type": "n8n-nodes-base.microsoftExcel",
      "position": [
        -860,
        -540
      ]
    },
    {
      "id": "e93aa8de-5c68-4a01-ae60-beb141e0a430",
      "name": "Get Unique Categories",
      "type": "n8n-nodes-base.set",
      "position": [
        -400,
        -160
      ]
    },
    {
      "id": "a874ae4e-d67e-4019-9e5c-03ea677468ae",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        760,
        80
      ]
    },
    {
      "id": "bc9c7578-3b6f-45fb-9f93-94637774d125",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1180,
        40
      ]
    },
    {
      "id": "ae83c9e2-a267-463c-a606-b4d101f93f92",
      "name": "Collect Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        980,
        -60
      ]
    },
    {
      "id": "8ca1ea7e-9098-4e82-919b-ba98ae7d7574",
      "name": "Categories to Items",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -220,
        -160
      ]
    },
    {
      "id": "eb6d74b8-f1ed-4ab2-8c5f-7e6c6361b055",
      "name": "For Each Category",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        320,
        -160
      ]
    },
    {
      "id": "8640ffac-9df6-4154-bcd5-dfa90c3843d4",
      "name": "Workflows to Items",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        500,
        -60
      ]
    },
    {
      "id": "4456a43b-df26-4bb8-a62d-b9f05eff4479",
      "name": "Workflow Summarizer",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        660,
        -60
      ]
    },
    {
      "id": "5f4a5921-c954-4523-8925-90401d8dbf22",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        660,
        -460
      ]
    },
    {
      "id": "f95fb28c-875c-4105-aa83-9fea257ea440",
      "name": "Fetch Latest 10 per Category",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -40,
        -160
      ]
    },
    {
      "id": "4dda6cbc-e53f-452d-b257-df9ef18abd75",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1560,
        -460
      ]
    },
    {
      "id": "881337d8-3ca8-43d2-931f-9cfec16cc367",
      "name": "Get Relevant Workflows",
      "type": "n8n-nodes-base.set",
      "position": [
        1380,
        -280
      ]
    },
    {
      "id": "b3ad0e26-e495-4dae-bfdd-f65961178acc",
      "name": "Flatten Workflows",
      "type": "n8n-nodes-base.set",
      "position": [
        500,
        -280
      ]
    },
    {
      "id": "05f72731-f8b0-4d8f-ba78-66ef8fbaf059",
      "name": "Remove Already Seen",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        1740,
        -280
      ]
    },
    {
      "id": "3904d2a2-9a95-4e11-883e-b2e88c6a884f",
      "name": "Workflow to Items",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1560,
        -280
      ]
    },
    {
      "id": "d416dee7-df0f-4579-a25f-6baed16453e8",
      "name": "Combine Workflows",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1920,
        -280
      ]
    },
    {
      "id": "3797dd21-3144-47e8-9359-841b97073001",
      "name": "Has New Workflows?",
      "type": "n8n-nodes-base.if",
      "position": [
        1380,
        -600
      ]
    },
    {
      "id": "0cd6ce35-c083-4db6-bc87-9d21e70a3bab",
      "name": "With User Reference",
      "type": "n8n-nodes-base.set",
      "position": [
        2100,
        -280
      ]
    },
    {
      "id": "b3a616c7-615f-49ff-8e6f-530324a98be4",
      "name": "Generate HTML Template",
      "type": "n8n-nodes-base.html",
      "position": [
        1740,
        -720
      ]
    },
    {
      "id": "0c9865c7-9352-4fda-a943-34c8f524de6c",
      "name": "Parse Rows",
      "type": "n8n-nodes-base.set",
      "position": [
        -660,
        -540
      ]
    },
    {
      "id": "f5fbd7f2-65e5-4dd7-8e43-38a8a99e3321",
      "name": "Send Daily Digest",
      "type": "n8n-nodes-base.microsoftOutlook",
      "position": [
        1920,
        -720
      ]
    },
    {
      "id": "e81ba3a0-e3f6-4231-8870-8ef03edf41e1",
      "name": "Append Category",
      "type": "n8n-nodes-base.set",
      "position": [
        140,
        -160
      ]
    },
    {
      "id": "e1c2c743-a560-47e8-b906-a2e8fd17622f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1060,
        -740
      ],
      "parameters": {
        "width": 440,
        "height": null,
        "content": "## 1. Get Subscribers from Excel\n[Learn more about the Excel node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.microsoftexcel)\n\nExcel can be an easy way to store a simple list of"
      }
    },
    {
      "id": "e10a23be-2af7-4b92-9b5f-df855e6ee349",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -420
      ],
      "parameters": {
        "width": 620,
        "height": 220,
        "content": "## 2. Fetch Latest Templates from n8n\n[Learn more about the HTTP Request node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest)\n\nUsing the HTTP request node, we can call"
      }
    },
    {
      "id": "0ee0b2ca-0247-4471-a6f5-920fd8e67f96",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        260
      ],
      "parameters": {
        "width": 580,
        "height": 180,
        "content": "## 3. Generate AI Summary For Each Template\n[Read more about the Basic LLM node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm)\n\nWhen building our emai"
      }
    },
    {
      "id": "ab234694-2878-440b-aeb5-37573ebe517e",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1680,
        -60
      ],
      "parameters": {
        "width": 580,
        "height": 200,
        "content": "## 4. Filter Relevant Templates for Subscriber\n[Read more about the Split Out node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.splitout)\n\nFor each subscriber, we want to filter"
      }
    },
    {
      "id": "460a8b3d-c125-41c3-95c5-afdfe63c7561",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1740,
        -960
      ],
      "parameters": {
        "width": 580,
        "height": 200,
        "content": "## 5. Generate Daily Digest and Send Via Outlook\n[Read more about the Outlook node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.microsoftoutlook)\n\nFinally, we can construct our d"
      }
    },
    {
      "id": "c79a2775-6276-41df-a9f0-64017e88a8c7",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        0
      ],
      "parameters": {
        "width": 200,
        "height": 120,
        "content": "### Execute Once\nThis node has been set to execute once rather than for each subscriber."
      }
    },
    {
      "id": "5290822e-b63b-4b73-8511-6a12e2387656",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -940,
        -360
      ],
      "parameters": {
        "width": 280,
        "height": 120,
        "content": "### Columns\n- name *(text)*\n- email *(text)*\n- categories *(text, comma-delimited)*"
      }
    },
    {
      "id": "56acbd11-7fa5-44b8-b031-fcdeb6e44839",
      "name": "For Each Subscriber",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1180,
        -460
      ]
    },
    {
      "id": "6aef7efc-1bc7-4a1d-b0cb-459484b3d179",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        -1400
      ],
      "parameters": {
        "width": 500,
        "height": 1000,
        "content": "## Try It Out!\n### This n8n template builds a newsletter (\"daily digest\") delivery service which pulls and summarises the latest n8n.io template in select categories defined by subscribers.\n\nIt's sche"
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "For Each Subscriber",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "For Each Category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Rows": {
      "main": [
        [
          {
            "node": "Get Unique Categories",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect Fields": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Category": {
      "main": [
        [
          {
            "node": "For Each Category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Subscribers": {
      "main": [
        [
          {
            "node": "Parse Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Subscribers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine Workflows": {
      "main": [
        [
          {
            "node": "With User Reference",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Flatten Workflows": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "For Each Category": {
      "main": [
        [
          {
            "node": "Flatten Workflows",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Workflows to Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Workflow Summarizer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Workflow to Items": {
      "main": [
        [
          {
            "node": "Remove Already Seen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Has New Workflows?": {
      "main": [
        [
          {
            "node": "Generate HTML Template",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflows to Items": {
      "main": [
        [
          {
            "node": "Workflow Summarizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Categories to Items": {
      "main": [
        [
          {
            "node": "Fetch Latest 10 per Category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "For Each Subscriber": {
      "main": [
        [
          {
            "node": "Has New Workflows?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Relevant Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Already Seen": {
      "main": [
        [
          {
            "node": "Combine Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "With User Reference": {
      "main": [
        [
          {
            "node": "For Each Subscriber",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Summarizer": {
      "main": [
        [
          {
            "node": "Collect Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Unique Categories": {
      "main": [
        [
          {
            "node": "Categories to Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate HTML Template": {
      "main": [
        [
          {
            "node": "Send Daily Digest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Relevant Workflows": {
      "main": [
        [
          {
            "node": "Workflow to Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Latest 10 per Category": {
      "main": [
        [
          {
            "node": "Append Category",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}