{
  "name": "Sync leads from Google Sheets to instantly email campaigns with data tables",
  "nodes": [
    {
      "id": "d9b2217b-b45a-4db6-8cc7-b68e78e51005",
      "name": "When clicking 'Execute workflow'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        688,
        416
      ]
    },
    {
      "id": "529ec24f-9d4a-4ed6-aefa-dcd35760498b",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        912,
        416
      ]
    },
    {
      "id": "263f1adf-0b26-41fc-92e1-f32c1e100d7f",
      "name": "Create a lead",
      "type": "n8n-nodes-instantly.instantly",
      "position": [
        1360,
        640
      ]
    },
    {
      "id": "b58654f2-d495-48fe-979b-d78a6ef62001",
      "name": "Get row(s)",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        912,
        712
      ]
    },
    {
      "id": "54706dc1-33aa-4133-b5ad-a8628bf398a8",
      "name": "Update row(s)",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1584,
        712
      ]
    },
    {
      "id": "6b3ee2b0-becc-4be0-b123-9b8e4a9aa5b5",
      "name": "Loop Over Items1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1136,
        712
      ]
    },
    {
      "id": "35d42df5-1699-4d3a-b76d-a094e9f7b9d8",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1136,
        416
      ]
    },
    {
      "id": "a679401b-7118-4473-9b05-889121744bd6",
      "name": "Update row(s)1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1360,
        416
      ]
    },
    {
      "id": "d1564c42-4f8c-4cc3-b3cc-e3802fdbecb5",
      "name": "Sticky Note - Main Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        -144
      ],
      "parameters": {
        "width": 480,
        "height": 2800,
        "content": "### Automated Lead Management: Google Sheets → Instantly + n8n Data Tables\n\n@[youtube](c8iv1u_jxDY)\n\n## 📋 Overview\n\nThis workflow automates lead management by syncing data from Google Sheets to Instan"
      }
    },
    {
      "id": "2fae1102-0410-43e8-85c2-0027fb44cb56",
      "name": "Sticky Note - Enrichment Flow",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        16
      ],
      "parameters": {
        "width": 380,
        "height": 320,
        "content": "## 📊 Data TransferFlow\n\n**Purpose:** Transfer lead records from Gsheets to N8N DataTable\n\n**Process:**\n1. Fetches all leads from Google Sheets\n2. Processes in batches of 30 (configurable)\n3. Extracts "
      }
    },
    {
      "id": "12ddfb56-524e-4fe9-84c8-1bf8f3bada57",
      "name": "Sticky Note - Instantly Sync",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        400
      ],
      "parameters": {
        "width": 380,
        "height": 360,
        "content": "## 🚀 Instantly Campaign Sync\n\n**Purpose:** Sends qualified leads to Instantly email campaigns\n\n**Process:**\n1. Queries leads where `campaign = \"start\"`\n2. Processes one lead at a time\n3. Creates lead "
      }
    },
    {
      "id": "d6290b10-be6b-4e09-8646-411345998514",
      "name": "Sticky Note - Configuration",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        -32
      ],
      "parameters": {
        "width": 320,
        "height": 440,
        "content": "### 🔧 Configuration Notes\n\n**Google Sheets:**\n- Template: [View Here](https://docs.google.com/spreadsheets/d/1eFXld6aiZvnQXg1lgt1COFyUh-zcy9VGx2GmFXwmYzM/edit?usp=sharing)\n- Sheet: \"instantly leads\"\n-"
      }
    },
    {
      "id": "54ec470a-0751-4071-bf71-4005cf847c03",
      "name": "Sticky Note - Batch Size",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        240
      ],
      "parameters": {
        "width": null,
        "height": 120,
        "content": "⚙️ **Batch Size: 30**\n\nProcesses 30 leads at a time to avoid overwhelming APIs and prevent timeouts.\n\nAdjust `batchSize` parameter if needed."
      }
    },
    {
      "id": "722857e3-f8fb-4f0d-a53b-378b917a4516",
      "name": "Sticky Note - Filter",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        864
      ],
      "parameters": {
        "width": null,
        "height": 120,
        "content": "🔍 **Lead Filter**\n\nOnly fetches leads where:\n`campaign = \"start\"`\n\nThis ensures only new, unprocessed leads are sent to Instantly."
      }
    },
    {
      "id": "7476128b-1ecc-421c-b41e-dedf700ca792",
      "name": "Sticky Note - Loop",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        864
      ],
      "parameters": {
        "width": null,
        "height": 200,
        "content": "🔄 **Individual Loop**\n\nProcesses leads one at a time through Instantly to ensure:\n- Proper API rate limiting\n- Accurate status updates\n- No partial batch failures"
      }
    },
    {
      "id": "f5acade0-7310-4a2f-a9b9-774a46ca7f0f",
      "name": "Sticky Note - Update",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1552,
        896
      ],
      "parameters": {
        "width": null,
        "height": 120,
        "content": "✅ **Status Update**\n\nMarks campaign as:\n`\"added to instantly\"`\n\nPrevents duplicate sends on subsequent runs."
      }
    },
    {
      "id": "acdfba6c-c728-4c96-afd7-ed116a43cfb5",
      "name": "Sticky Note - Schema",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1616,
        -32
      ],
      "parameters": {
        "width": 280,
        "height": 420,
        "content": "### 📋 Data Tables Schema\n\n**Leads Table:**\n```\nFirstname  | string\nEmail      | string\nWebsite    | string\ncampaign   | string\n```\n\n**John Instantly Table:**\n```\nFirstname  | string\nLastname   | strin"
      }
    },
    {
      "id": "24e571c4-bcb1-43d2-967b-60e5ed3d1351",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        688,
        712
      ]
    }
  ],
  "connections": {
    "Get row(s)": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a lead": {
      "main": [
        [
          {
            "node": "Update row(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row(s)": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update row(s)1": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Update row(s)1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [],
        [
          {
            "node": "Create a lead",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking 'Execute workflow'": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}