{
  "name": "Scrape LinkedIn B2B leads with Apify and GPT-4 and approve emails in Sheets",
  "nodes": [
    {
      "id": "a686b9b4-09c6-4f5e-9917-6d590648e4f9",
      "name": "post Apify data scrap",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        304,
        0
      ]
    },
    {
      "id": "0f495a64-b00e-46cf-b3f9-69beb2a32dbf",
      "name": "Get Apify recent run data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        592,
        0
      ]
    },
    {
      "id": "bde68ef5-7b9f-48c8-b3e3-5215c50290ba",
      "name": "generate Ai email",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        2224,
        0
      ]
    },
    {
      "id": "0b0623d0-f30e-48db-ab9f-29d1ac069b69",
      "name": "make separate json of each keyword",
      "type": "n8n-nodes-base.code",
      "position": [
        -304,
        -16
      ]
    },
    {
      "id": "45214227-bb86-476d-9cfc-bcc68c5e426f",
      "name": "If email exist",
      "type": "n8n-nodes-base.if",
      "position": [
        1168,
        16
      ]
    },
    {
      "id": "f02a9fd2-897d-4c60-a34a-9582a47b4556",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        448
      ],
      "parameters": {
        "width": 1184,
        "height": 384,
        "content": "# Approved Leads Email Workflow"
      }
    },
    {
      "id": "9de6efad-ecb0-4c4f-a29c-40b0eba54055",
      "name": "📥 Approved Leads Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -464,
        576
      ]
    },
    {
      "id": "70ae0f09-b164-44fa-8ae1-c4f7c518a767",
      "name": "🔧 Normalize Lead Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -176,
        576
      ]
    },
    {
      "id": "b1dbaf04-48d2-437e-9966-ef4d6b08b8d7",
      "name": "✂️ Split Email Content",
      "type": "n8n-nodes-base.code",
      "position": [
        64,
        576
      ]
    },
    {
      "id": "98c5b879-f320-4256-a412-36469668e49f",
      "name": "📤 Send Approved Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        304,
        576
      ]
    },
    {
      "id": "6b865333-8ab3-46fd-a2d5-2f0b92d9ae7e",
      "name": "Data Batcher",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        0,
        -16
      ]
    },
    {
      "id": "0dbaa915-0aeb-4b29-92db-29f3ca5aef4d",
      "name": "Lead Data Batcher",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        880,
        0
      ]
    },
    {
      "id": "17642f70-ca69-49ac-a08d-683b788b2e09",
      "name": "JSON Stringifier",
      "type": "n8n-nodes-base.code",
      "position": [
        1456,
        0
      ]
    },
    {
      "id": "a1677126-07b7-4eed-8ddd-1accef15be52",
      "name": "HubSpot Company Creator",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1744,
        0
      ]
    },
    {
      "id": "e83d869f-c9be-41c4-ac56-e4f082afd13c",
      "name": "HubSpot Contact Sync",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1968,
        0
      ]
    },
    {
      "id": "5a61af7b-a3ee-464f-a579-7212564b3018",
      "name": "Leads Log",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2608,
        0
      ]
    },
    {
      "id": "93a3faf9-d003-441b-901d-1bc3d8f1011b",
      "name": "Lead Campaign Setup",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -544,
        -16
      ]
    },
    {
      "id": "1ca64694-06c4-471b-aadb-0ed0bdb20be7",
      "name": "Rejection Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -560,
        1088
      ]
    },
    {
      "id": "a1e44d3a-983d-4f24-9cb4-be151ded07d3",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        944
      ],
      "parameters": {
        "width": 1280,
        "height": 464,
        "content": "# Rejection Follow-up Workflow\n"
      }
    },
    {
      "id": "800b3f0f-1531-417d-b9ad-9a6ff4f3b7a5",
      "name": "Webhook Data Normalizer",
      "type": "n8n-nodes-base.code",
      "position": [
        -320,
        1088
      ]
    },
    {
      "id": "d19b6e66-09b6-4df1-ae4d-d9909cedcfe0",
      "name": "Rejection Data Stringifier",
      "type": "n8n-nodes-base.code",
      "position": [
        -80,
        1088
      ]
    },
    {
      "id": "d3ba5d1e-d1c7-4291-8c40-1abc4baa299b",
      "name": "Rejection Email Rewriter",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        112,
        1088
      ]
    },
    {
      "id": "ea6196c1-c0e2-48ac-b8fa-f33458a4e479",
      "name": "Update: Improved Email",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        464,
        1088
      ]
    },
    {
      "id": "f48b7143-491e-43c8-81d6-f9afd69bf6ed",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -144
      ],
      "parameters": {
        "width": 3520,
        "height": 464,
        "content": "# LinkedIn Lead Generation Pipeline"
      }
    },
    {
      "id": "fe109bb7-1ff3-4435-95ad-e1a26d5d56a9",
      "name": "LLM",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        2224,
        192
      ]
    },
    {
      "id": "b54d2535-c0c1-4df1-b784-c670dd2f4b91",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        112,
        1280
      ]
    },
    {
      "id": "c8f60827-fe7d-426b-b101-00cb5c392fc4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1200,
        80
      ],
      "parameters": {
        "width": 400,
        "height": 1024,
        "content": "\n## How it works\n\n1. You submit lead keywords (industry, role, location) using the form trigger or by adding rows in Google Sheets.\n2. The workflow scrapes targeted LinkedIn leads via Apify and proces"
      }
    }
  ],
  "connections": {
    "LLM": {
      "ai_languageModel": [
        [
          {
            "node": "generate Ai email",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Leads Log": {
      "main": [
        [
          {
            "node": "Lead Data Batcher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data Batcher": {
      "main": [
        [],
        [
          {
            "node": "post Apify data scrap",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If email exist": {
      "main": [
        [
          {
            "node": "JSON Stringifier",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Lead Data Batcher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "JSON Stringifier": {
      "main": [
        [
          {
            "node": "HubSpot Company Creator",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead Data Batcher": {
      "main": [
        [
          {
            "node": "Data Batcher",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "If email exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Rejection Email Rewriter",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Rejection Webhook": {
      "main": [
        [
          {
            "node": "Webhook Data Normalizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "generate Ai email": {
      "main": [
        [
          {
            "node": "Leads Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead Campaign Setup": {
      "main": [
        [
          {
            "node": "make separate json of each keyword",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot Contact Sync": {
      "main": [
        [
          {
            "node": "generate Ai email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "post Apify data scrap": {
      "main": [
        [
          {
            "node": "Get Apify recent run data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot Company Creator": {
      "main": [
        [
          {
            "node": "HubSpot Contact Sync",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook Data Normalizer": {
      "main": [
        [
          {
            "node": "Rejection Data Stringifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rejection Email Rewriter": {
      "main": [
        [
          {
            "node": "Update: Improved Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📤 Send Approved Email": {
      "main": [
        []
      ]
    },
    "🔧 Normalize Lead Data": {
      "main": [
        [
          {
            "node": "✂️ Split Email Content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Apify recent run data": {
      "main": [
        [
          {
            "node": "Lead Data Batcher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Rejection Data Stringifier": {
      "main": [
        [
          {
            "node": "Rejection Email Rewriter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "✂️ Split Email Content": {
      "main": [
        [
          {
            "node": "📤 Send Approved Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📥 Approved Leads Webhook": {
      "main": [
        [
          {
            "node": "🔧 Normalize Lead Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "make separate json of each keyword": {
      "main": [
        [
          {
            "node": "Data Batcher",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}