{
  "name": "Generate cold outreach drafts from Google Sheets with GPT-4o-mini & Gmail",
  "nodes": [
    {
      "id": "453c01a0-07fe-4600-bd60-aee0a280a5ec",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        192,
        192
      ]
    },
    {
      "id": "ee2275f1-e698-4b18-b10c-50b6fe7535b9",
      "name": "Read Business Data",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        416,
        192
      ]
    },
    {
      "id": "c5473567-81d4-48b4-8583-990606c1c245",
      "name": "Filter Unsent Emails",
      "type": "n8n-nodes-base.if",
      "position": [
        640,
        192
      ]
    },
    {
      "id": "7a91c4fc-cc55-4553-af95-03a07955f541",
      "name": "Prepare Sheet Update",
      "type": "n8n-nodes-base.set",
      "position": [
        1760,
        192
      ]
    },
    {
      "id": "e7b61a8c-4733-41bc-a130-809ecd8b3779",
      "name": "Update Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1984,
        96
      ]
    },
    {
      "id": "aed9100b-9cce-422c-8ed9-077e9717180a",
      "name": "Rate Limit Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        1984,
        288
      ]
    },
    {
      "id": "4f545b68-2162-4491-8127-6f1baa66166e",
      "name": "Personalize Email (ChatGPT)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        864,
        96
      ]
    },
    {
      "id": "959f7d3f-d91a-4c6e-8ae1-4f0a8ac03d14",
      "name": "Generate Subject (ChatGPT)",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        864,
        288
      ]
    },
    {
      "id": "5d8e3519-744f-4b61-8681-e87c746b4e20",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -512,
        -656
      ],
      "parameters": {
        "width": 672,
        "height": 944,
        "content": "## How It Works\n1. Starts with a Manual Trigger\n\n2. Reads lead list from Google Sheet\n\n3. Filter rows where email wasn’t sent\n\n4. Generate personalized email body (AI)\n\n5. Generate email subject line "
      }
    },
    {
      "id": "78c99319-eb37-4add-b2a8-abe70aa47d49",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        -16
      ],
      "parameters": {
        "width": 560,
        "height": 368,
        "content": "## Phase 1:\nManually trigger the worklfow, read business data from a google sheet and filter the emails which have not already been sent\n# ->"
      }
    },
    {
      "id": "925dfa2b-ff58-45ac-ac2a-d35b0b454828",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        -48
      ],
      "parameters": {
        "width": 496,
        "height": 512,
        "content": "## Phase 2:\nCreate email subject and body using an http request to OpenAI's ChatGPT 4o-mini\n# ->"
      }
    },
    {
      "id": "ac4ced8a-b8b6-4403-8ab6-e7cdaa727846",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        -48
      ],
      "parameters": {
        "width": 400,
        "height": 400,
        "content": "## Phase 3\nPrepare fields and create the draft email\n# ->"
      }
    },
    {
      "id": "2d821218-7e6e-46f5-8376-af267ec0dd14",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        -32
      ],
      "parameters": {
        "width": 448,
        "height": 480,
        "content": "## Phase 4\nPrepare the fields (Set) and update google sheet.\n(Wait node is for API usage limit management)"
      }
    },
    {
      "id": "b0fa3264-5cdd-45c8-8ca7-0c79a04ace73",
      "name": "Prepare Email Draft",
      "type": "n8n-nodes-base.set",
      "position": [
        1312,
        192
      ]
    },
    {
      "id": "fc1a66a3-555d-4711-8b37-e75422b3c5d2",
      "name": "Create Email Draft",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1536,
        192
      ]
    },
    {
      "id": "e19bd5b5-7c68-4b1d-9026-36ff868af095",
      "name": "Merge Subject and Body",
      "type": "n8n-nodes-base.merge",
      "position": [
        1088,
        192
      ]
    }
  ],
  "connections": {
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Read Business Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Email Draft": {
      "main": [
        [
          {
            "node": "Prepare Sheet Update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Business Data": {
      "main": [
        [
          {
            "node": "Filter Unsent Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Email Draft": {
      "main": [
        [
          {
            "node": "Create Email Draft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Unsent Emails": {
      "main": [
        [
          {
            "node": "Personalize Email (ChatGPT)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate Subject (ChatGPT)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Sheet Update": {
      "main": [
        [
          {
            "node": "Update Google Sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Rate Limit Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Subject and Body": {
      "main": [
        [
          {
            "node": "Prepare Email Draft",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Subject (ChatGPT)": {
      "main": [
        [
          {
            "node": "Merge Subject and Body",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Personalize Email (ChatGPT)": {
      "main": [
        [
          {
            "node": "Merge Subject and Body",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}