{
  "name": "Automate newsletter creation & client delivery with GPT-4O, Google Sheets",
  "nodes": [
    {
      "id": "88924d6c-0524-45c6-8982-b43bc79951c6",
      "name": "When clicking 'Test workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -40,
        -180
      ]
    },
    {
      "id": "d386375c-ecac-4335-a29a-cd39d9233f07",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -40,
        230
      ]
    },
    {
      "id": "ca49af2b-0d7f-4aa1-b63c-dc828bfeb7d6",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        840,
        230
      ]
    },
    {
      "id": "2208eb0e-a0aa-4082-905b-166fa521b75a",
      "name": "Get topic from newsletter sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        180,
        -180
      ]
    },
    {
      "id": "2b47d026-a70e-40d5-a2c4-4f07551f0eef",
      "name": "Validate Status as Pending",
      "type": "n8n-nodes-base.if",
      "position": [
        400,
        -180
      ]
    },
    {
      "id": "448be138-181b-4bda-95dd-66d632635256",
      "name": "Create HTML for Newsletter",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        620,
        -180
      ]
    },
    {
      "id": "f552d84a-9d14-4cb1-89d7-d99bc9784a5e",
      "name": "Prepare Data to create word doc",
      "type": "n8n-nodes-base.code",
      "position": [
        996,
        -180
      ]
    },
    {
      "id": "f2421bc4-2045-46c9-beab-ff5459b4a17c",
      "name": "Upload doc to google drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1216,
        -180
      ]
    },
    {
      "id": "6b39c176-25cf-4b47-a25c-8b886f0709ba",
      "name": "Send an email to admin",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1436,
        -180
      ]
    },
    {
      "id": "8e7c42de-3fd8-4acc-afdb-83491674bf7b",
      "name": "Update Status as Generated",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1656,
        -180
      ]
    },
    {
      "id": "0f6f5d15-dbd9-415b-923d-81809708542d",
      "name": "Validate Status as Approved",
      "type": "n8n-nodes-base.if",
      "position": [
        400,
        230
      ]
    },
    {
      "id": "f03eed28-1c06-401e-8c4b-ba5b5891b048",
      "name": "Pick records to send email to client",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        180,
        230
      ]
    },
    {
      "id": "23ae0b93-f121-493b-a0d1-80fc748137a2",
      "name": "Get Client email address",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        620,
        230
      ]
    },
    {
      "id": "4281a45c-5af5-4311-bca6-aaee14152afc",
      "name": "Send email to client",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1060,
        280
      ]
    },
    {
      "id": "c2634a85-88f6-49b5-bd14-6e03336a49f2",
      "name": "Update status as Sent",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1060,
        80
      ]
    }
  ],
  "connections": {
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Update status as Sent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send email to client",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Pick records to send email to client",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send email to client": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send an email to admin": {
      "main": [
        [
          {
            "node": "Update Status as Generated",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Client email address": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create HTML for Newsletter": {
      "main": [
        [
          {
            "node": "Prepare Data to create word doc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload doc to google drive": {
      "main": [
        [
          {
            "node": "Send an email to admin",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Status as Pending": {
      "main": [
        [
          {
            "node": "Create HTML for Newsletter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Status as Approved": {
      "main": [
        [
          {
            "node": "Get Client email address",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Test workflow'": {
      "main": [
        [
          {
            "node": "Get topic from newsletter sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get topic from newsletter sheet": {
      "main": [
        [
          {
            "node": "Validate Status as Pending",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Data to create word doc": {
      "main": [
        [
          {
            "node": "Upload doc to google drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pick records to send email to client": {
      "main": [
        [
          {
            "node": "Validate Status as Approved",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}