{
  "name": "Generate and send AI newsletters with OpenAI, Tavily, Google Sheets and Gmail",
  "nodes": [
    {
      "id": "f97f8aad-e674-4c9a-8ac1-528785ff2a79",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1008,
        544
      ]
    },
    {
      "id": "0b8c2f23-f7a1-42df-a95b-5c4aac01b334",
      "name": "Structured Output Parser1",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        3232,
        368
      ]
    },
    {
      "id": "2f7807f3-84ab-4980-8afd-fc063434ab41",
      "name": "Generate Draft Topics (AI)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        864,
        320
      ]
    },
    {
      "id": "3c6aae50-ffdb-4a21-a3f3-7760fef62eb9",
      "name": "Split Topics",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1216,
        320
      ]
    },
    {
      "id": "94708b0f-eb07-40e8-9bbd-fa253ef6f1de",
      "name": "Generate Newsletter Content (AI)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1664,
        320
      ]
    },
    {
      "id": "ab67a2b7-553a-4134-ac4a-ba2a768e14e8",
      "name": "Merge Content Pieces",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1968,
        320
      ]
    },
    {
      "id": "7ac35b41-ce45-4bd3-9bff-f8aa926b1f6f",
      "name": "Convert Newsletter to HTML (AI)",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3088,
        160
      ]
    },
    {
      "id": "5f8ca3bc-9a8c-47bd-b224-b6e1c1681986",
      "name": "Save Newsletter Draft in Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3440,
        48
      ]
    },
    {
      "id": "e5212eee-c26a-4aa3-8e47-4c4a338912d5",
      "name": "Sending Emails to all the Subscribers",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3456,
        240
      ]
    },
    {
      "id": "c9ad18bd-00a2-4e8b-8f12-4bc61560c34d",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        864,
        544
      ]
    },
    {
      "id": "012f555e-6931-482c-8c90-d37e4d537985",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1664,
        528
      ]
    },
    {
      "id": "d463cedc-5d0d-4100-8d65-beba941dc1ad",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3088,
        368
      ]
    },
    {
      "id": "a7ed594d-450b-4f74-aaa1-93b391aea887",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        -64
      ],
      "parameters": {
        "width": 592,
        "height": 528,
        "content": "# 📨 AI Newsletter Automation Workflow\n\n## 🚀 Brief Overview (How It Works)\n\nThis workflow automates the complete process of generating and sending AI-powered newsletters. It starts with a form submissi"
      }
    },
    {
      "id": "b59b4147-a715-4202-9887-c629c259d403",
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        640,
        320
      ]
    },
    {
      "id": "fa0708d4-d3f9-4770-8364-df8647a82d5b",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        352,
        128
      ]
    },
    {
      "id": "0b7d6405-36ab-4971-b526-66d339255cbe",
      "name": "HTTP Request2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        800,
        -176
      ]
    },
    {
      "id": "9ae3a4e0-08aa-41b1-b0f4-bc4e761cd03f",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        960,
        -176
      ]
    },
    {
      "id": "07c1ee47-78ec-4a7e-8b89-49eac3725bab",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        2176,
        128
      ]
    },
    {
      "id": "afdb8cd7-5265-4f00-8393-272e98f67005",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2400,
        144
      ]
    },
    {
      "id": "7635573f-fd5b-4f26-96d7-6be8edab0021",
      "name": "Structured Output Parser2",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        1104,
        16
      ]
    },
    {
      "id": "0f7b7368-6586-4ed8-ab52-b23b3ad15d58",
      "name": "OpenAI Chat Model4",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        960,
        32
      ]
    },
    {
      "id": "132a6753-6b89-4e5a-8611-59b8124e4eb0",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2832,
        144
      ]
    },
    {
      "id": "c407e362-47dd-4006-9d84-a81d03ba4a4d",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2608,
        144
      ]
    },
    {
      "id": "4bd28f3b-afe8-42a6-9a89-aeef8eab5d92",
      "name": "Information Extractor1",
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "position": [
        976,
        -352
      ]
    },
    {
      "id": "99f732c1-03be-4f2d-9c2e-d00456a8b7e8",
      "name": "HTTP Request6",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        800,
        -352
      ]
    },
    {
      "id": "b245b36b-115e-445c-bb8d-d8b29a39f781",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        -16
      ],
      "parameters": {
        "width": 294,
        "height": 384,
        "content": "## Workflow Input (Form Trigger)\nThis section collects the required inputs from the user through a form submission."
      }
    },
    {
      "id": "d3aa0e66-2d2f-4830-8050-e0ac26520e3b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        -512
      ],
      "parameters": {
        "width": 1542,
        "height": 704,
        "content": "## Extract Brand Style & Colors\nThis block analyzes the provided brand website to determine the brand’s visual identity."
      }
    },
    {
      "id": "40e8a406-eb62-462f-8e20-fcb816672260",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        592,
        208
      ],
      "parameters": {
        "width": 1526,
        "height": 544,
        "content": "## Fetch News About Query\nThis section retrieves news about the query"
      }
    },
    {
      "id": "66720341-53b9-4de6-8eae-6603439e2877",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2128,
        -128
      ],
      "parameters": {
        "width": 1526,
        "height": 704,
        "content": "## AI Processing, HTML Generation & Email Delivery\nThis section handles the core content generation and delivery of the newsletter."
      }
    },
    {
      "id": "73674565-21c5-40bc-a16d-ee310a3b9909",
      "name": "Tavily",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1440,
        320
      ]
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Tavily": {
      "main": [
        [
          {
            "node": "Generate Newsletter Content (AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Generate Draft Topics (AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Topics": {
      "main": [
        [
          {
            "node": "Tavily",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request2": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request6": {
      "main": [
        [
          {
            "node": "Information Extractor1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Convert Newsletter to HTML (AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Draft Topics (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Request2",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Request6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Newsletter Content (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "Convert Newsletter to HTML (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "Information Extractor1",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Content Pieces": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Information Extractor1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Generate Draft Topics (AI)",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser1": {
      "ai_outputParser": [
        [
          {
            "node": "Convert Newsletter to HTML (AI)",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser2": {
      "ai_outputParser": [
        [
          {
            "node": "AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Generate Draft Topics (AI)": {
      "main": [
        [
          {
            "node": "Split Topics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Newsletter to HTML (AI)": {
      "main": [
        [
          {
            "node": "Save Newsletter Draft in Google Sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Sending Emails to all the Subscribers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Newsletter Content (AI)": {
      "main": [
        [
          {
            "node": "Merge Content Pieces",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sending Emails to all the Subscribers": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}