{
  "name": "Nurture and email leads from Google Sheets with GPT‑4.1 Mini and Gmail",
  "nodes": [
    {
      "id": "63f3ae8a-c85d-4203-a323-69effe6b4031",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3792,
        3312
      ]
    },
    {
      "id": "c8c9b20d-3378-40da-947c-917ccd76b266",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        3584,
        3312
      ]
    },
    {
      "id": "ec4681fe-1cad-434c-8936-fd0e3a08a013",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        4448,
        3376
      ]
    },
    {
      "id": "9ca1eba8-d2d9-4a2e-acc4-8f5833777c32",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        4016,
        3312
      ]
    },
    {
      "id": "5aeacd57-5b47-4a28-af73-8a4ea6c7c02e",
      "name": "Parse AI",
      "type": "n8n-nodes-base.code",
      "position": [
        5408,
        3392
      ]
    },
    {
      "id": "921325b2-e393-4eb2-8bd7-4de8472426b0",
      "name": "Save Message",
      "type": "n8n-nodes-base.code",
      "position": [
        6416,
        3136
      ]
    },
    {
      "id": "e941f7e1-f4d9-4f0b-a7cf-2faf81f03dec",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        6640,
        3136
      ]
    },
    {
      "id": "803d5adc-264f-4375-872b-2ebf179f1e9b",
      "name": "Update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        6896,
        3136
      ]
    },
    {
      "id": "c735bc31-f6f2-4ec6-87b9-8d0dbd0ac520",
      "name": "AI-Follow-up",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        6160,
        3728
      ]
    },
    {
      "id": "8efb5838-fe40-4b52-9fd7-95b14457dd86",
      "name": "Parse Follow-up",
      "type": "n8n-nodes-base.code",
      "position": [
        6576,
        3728
      ]
    },
    {
      "id": "8179a28f-d1aa-45b3-8b4f-fd3bf87e1c41",
      "name": "Send a message1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        6832,
        3728
      ]
    },
    {
      "id": "f52f324e-1426-4ec7-a564-bc25c346d396",
      "name": "Update row in sheet1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7040,
        3728
      ]
    },
    {
      "id": "7f8cf390-a465-4038-b9e9-1a67a5f8bc71",
      "name": "AI-Lead-Analysis",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        5072,
        3392
      ]
    },
    {
      "id": "20d28269-194f-40db-8640-798db0bf150a",
      "name": "First AI mail",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        6080,
        3136
      ]
    },
    {
      "id": "58abc29d-35e6-422a-bc8a-dcaeecd75d1d",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        4688,
        3376
      ]
    },
    {
      "id": "ae6ab323-256e-41f5-8e0b-bb09457acb0c",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        5680,
        3376
      ]
    },
    {
      "id": "b07303ca-7ba1-4dc2-a1c8-0b7fd58aa912",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5984,
        3424
      ],
      "parameters": {
        "width": 1888,
        "height": 608,
        "content": "## Step 5 – Follow-up and pipeline completion\n\nCreates and sends follow-up emails, updates CRM progression, and marks leads as closed once the outreach sequence is complete.\n"
      }
    },
    {
      "id": "63a5a026-3835-49a4-88ac-87f0fd9feceb",
      "name": "If1",
      "type": "n8n-nodes-base.if",
      "position": [
        7440,
        3728
      ]
    },
    {
      "id": "c473aba9-b1ce-478d-b669-1f9b085116cb",
      "name": "Update row in sheet2",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        7664,
        3712
      ]
    },
    {
      "id": "d260f58c-3eae-48fa-9fa2-c90f248eeb6b",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2880,
        2880
      ],
      "parameters": {
        "width": 512,
        "height": 1152,
        "content": "### AI lead nurturing and cold email automation with Google Sheets and OpenAI\n\nAutomate lead qualification, personalized outreach, and follow-ups using AI and a Google Sheets CRM.\n\n**What it does**\n• "
      }
    },
    {
      "id": "9f86540d-d1c5-44cf-9045-690582fae9de",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3408,
        2880
      ],
      "parameters": {
        "width": 832,
        "height": 1152,
        "content": "## Step 1 – Trigger and lead intake\n\nRuns on a schedule, fetches leads from Google Sheets, and filters only records that need outreach based on Status or NextActionDate.\n"
      }
    },
    {
      "id": "de49b9e8-2d9d-41d4-99c3-f691e63aae17",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5008,
        2880
      ],
      "parameters": {
        "width": 880,
        "height": 1152,
        "content": "## Step 3 – AI lead scoring and routing\n\nAnalyzes each lead using OpenAI to assign score, priority, and channel, then routes leads based on outreach step (new, follow-up, closed).\n"
      }
    },
    {
      "id": "ade06f21-816a-4df9-b618-1749fcaf7cb9",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4272,
        2880
      ],
      "parameters": {
        "width": 704,
        "height": 1152,
        "content": "## Step 2 – Data preparation and batching\n\nNormalizes lead fields (email, phone, company, person) and processes leads in batches to ensure scalability and avoid rate limits.\n"
      }
    },
    {
      "id": "59f85b03-59ba-4e3f-8869-b2b2aa24a266",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5984,
        2880
      ],
      "parameters": {
        "width": 1872,
        "height": 512,
        "content": "## Step 4 – First outreach automation\n\nGenerates and sends a personalized cold email, then updates CRM with Step, Status, AI insights, and next action date.\n"
      }
    },
    {
      "id": "2e76fa5c-1572-4cef-9e17-c1aeddfddd6d",
      "name": "Wait1",
      "type": "n8n-nodes-base.wait",
      "position": [
        7232,
        3728
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If1": {
      "main": [
        [
          {
            "node": "Update row in sheet2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait1": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "First AI mail",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI-Follow-up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI-Follow-up": {
      "main": [
        [
          {
            "node": "Parse Follow-up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Message": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "First AI mail": {
      "main": [
        [
          {
            "node": "Save Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message": {
      "main": [
        [
          {
            "node": "Update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "AI-Lead-Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Follow-up": {
      "main": [
        [
          {
            "node": "Send a message1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send a message1": {
      "main": [
        [
          {
            "node": "Update row in sheet1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI-Lead-Analysis": {
      "main": [
        [
          {
            "node": "Parse AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet1": {
      "main": [
        [
          {
            "node": "Wait1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row in sheet2": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}