{
  "name": "Generate cold email icebreakers and subject lines with Google Sheets and OpenAI",
  "nodes": [
    {
      "id": "231d850b-d5b1-4717-99dc-96d91a5ecfaf",
      "name": "Rate Limit Delay",
      "type": "n8n-nodes-base.wait",
      "position": [
        2384,
        -208
      ]
    },
    {
      "id": "114f3b67-0ad5-4445-a380-29beae9fae3c",
      "name": "Write Results to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2160,
        -272
      ]
    },
    {
      "id": "81607b05-c805-470c-8dc4-b253592d974b",
      "name": "Filter Empty Rows",
      "type": "n8n-nodes-base.filter",
      "position": [
        912,
        -208
      ]
    },
    {
      "id": "df47db5f-686e-45f1-a7eb-949c8685574a",
      "name": "Limit to 200 Leads",
      "type": "n8n-nodes-base.limit",
      "position": [
        1136,
        -208
      ]
    },
    {
      "id": "77ee3852-5a6e-431d-822e-6d954cab755b",
      "name": "Read Lead Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        688,
        -208
      ]
    },
    {
      "id": "c675c220-32dc-4b26-b6df-25ad6f0f2023",
      "name": "Process One by One",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1360,
        -208
      ]
    },
    {
      "id": "32f41cbd-9d24-4134-8771-58a3285ef318",
      "name": "Needs Icebreaker?",
      "type": "n8n-nodes-base.if",
      "position": [
        1584,
        -272
      ]
    },
    {
      "id": "e5a3e768-1d2a-47cf-a4a3-639320297eda",
      "name": "Generate Icebreaker",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1808,
        -288
      ]
    },
    {
      "id": "00868a39-6667-44e8-9da1-048b83233df1",
      "name": "When clicking 'Execute workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        448,
        -208
      ]
    },
    {
      "id": "5a9fb0d0-fe01-4e38-b094-b769bc07692c",
      "name": "Main Description",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -896
      ],
      "parameters": {
        "width": 528,
        "height": 876,
        "content": "## Email List Personalization - Icebreaker & Subject Line Generator\n\nReads an enriched lead list from Google Sheets, generates a personalized icebreaker and subject line for each lead using OpenAI, an"
      }
    },
    {
      "id": "c9f6417f-5511-4dc1-ad6c-b9f01ea1ab39",
      "name": "Section - Load",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        -384
      ],
      "parameters": {
        "width": 888,
        "height": 360,
        "content": "### Load leads\nReads the enriched lead sheet, filters to rows missing icebreakers or subject lines, and caps at 200 per run."
      }
    },
    {
      "id": "dc14ec18-a02d-415e-abac-b5c93d4d7817",
      "name": "Section - Generate",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        -384
      ],
      "parameters": {
        "width": 776,
        "height": 360,
        "content": "### Generate icebreakers\nLoops through each lead one by one. Checks the row still needs an icebreaker, then calls OpenAI with few-shot examples to produce personalized copy."
      }
    },
    {
      "id": "d074dc09-9b38-4257-a1da-d60725335e6d",
      "name": "Section - Save",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2112,
        -384
      ],
      "parameters": {
        "width": 432,
        "height": 360,
        "content": "### Save & loop\nWrites the generated icebreaker and subject line back to the same row via row_number match. Waits 1s between calls to avoid API throttling, then loops to the next lead."
      }
    },
    {
      "id": "0a3c0cbb-e401-41a8-92d3-5af3376b36e2",
      "name": "Warning",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        -496
      ],
      "parameters": {
        "width": 336,
        "height": 100,
        "content": "**Dont forget to** Connect your Google Sheets and OpenAI credentials, and set the correct spreadsheet ID in both sheet nodes before running."
      }
    }
  ],
  "connections": {
    "Read Lead Sheet": {
      "main": [
        [
          {
            "node": "Filter Empty Rows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rate Limit Delay": {
      "main": [
        [
          {
            "node": "Process One by One",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Empty Rows": {
      "main": [
        [
          {
            "node": "Limit to 200 Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Needs Icebreaker?": {
      "main": [
        [
          {
            "node": "Generate Icebreaker",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit to 200 Leads": {
      "main": [
        [
          {
            "node": "Process One by One",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process One by One": {
      "main": [
        [],
        [
          {
            "node": "Needs Icebreaker?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Icebreaker": {
      "main": [
        [
          {
            "node": "Write Results to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Results to Sheet": {
      "main": [
        [
          {
            "node": "Rate Limit Delay",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Execute workflow'": {
      "main": [
        [
          {
            "node": "Read Lead Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}