{
  "name": "Extract & enrich LinkedIn comments to leads with Apify → Google Sheets/CSV",
  "nodes": [
    {
      "id": "66c32da3-373c-42a9-bf51-5bec1fd6c4cd",
      "name": "Trigger manually",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        1240,
        1360
      ]
    },
    {
      "id": "6a0decfe-9539-4c10-9474-0031fa91dfc5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        240
      ],
      "parameters": {
        "width": 1620,
        "height": 1000,
        "content": "# 🚀 LinkedIn Comments to Leads Extractor & Enricher (Apify) → Google Sheets / CSV\n\n## Overview\n\n**Automate LinkedIn lead generation by scraping comments from targeted posts and enriching profiles with"
      }
    },
    {
      "id": "e206b173-eb8a-4721-8251-8b0ebb2aa38f",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        1300,
        1760
      ]
    },
    {
      "id": "d90f3510-b326-4352-90f4-772eca3d5b9b",
      "name": "Set APIFY Token",
      "type": "n8n-nodes-base.set",
      "position": [
        1820,
        1460
      ]
    },
    {
      "id": "36eb3f1f-e0db-4175-964e-9200bf503918",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1740,
        1360
      ],
      "parameters": {
        "width": 260,
        "height": 300,
        "content": "## 1. Set APIFY TOKEN\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### _(CLICK ME)_"
      }
    },
    {
      "id": "5237c7a8-e2b4-49ae-a070-9cd885e1bc18",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1420,
        1280
      ],
      "parameters": {
        "width": null,
        "height": 300,
        "content": "_(or if run manually ENABLE this)_  \n### 4. Set Post ID/URL\n\n\n\n\n\n\n\n\n\n\n\n\n\n### _(CLICK ME)_ and Connect\n"
      }
    },
    {
      "id": "9637dc03-c409-477d-a596-c84f4df12d63",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1160,
        1620
      ],
      "parameters": {
        "width": 400,
        "height": 380,
        "content": "## 3. You can run through the form (check Form URL)\n\n\n\n\n\n\n\n\n\n\n\n\n\n### _(CLICK ME)_ \nIf run manually DISABLE this node"
      }
    },
    {
      "id": "efe492e1-78f7-4f55-89d7-caea70767044",
      "name": "Set fields from the form",
      "type": "n8n-nodes-base.set",
      "position": [
        1620,
        1760
      ]
    },
    {
      "id": "aea3954b-94cf-4785-a692-a46d45b9add5",
      "name": "Set manual fields",
      "type": "n8n-nodes-base.set",
      "position": [
        1480,
        1360
      ]
    },
    {
      "id": "c9d2e385-9c38-43ea-88bd-e7363f215cc7",
      "name": "More runs needed?",
      "type": "n8n-nodes-base.if",
      "position": [
        2620,
        1460
      ]
    },
    {
      "id": "021e8ae2-6773-4154-ab59-61dab49b16e9",
      "name": "Set pagination",
      "type": "n8n-nodes-base.code",
      "position": [
        2840,
        1320
      ]
    },
    {
      "id": "5371649d-d032-452d-8af6-13a679b254fd",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        3060,
        1320
      ]
    },
    {
      "id": "4003ce75-3e13-4d2a-9199-bac9f5bda6de",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2400,
        1460
      ]
    },
    {
      "id": "c25710e8-c47c-4fb9-91e1-d9fe37ad53fa",
      "name": "Gather All Comments",
      "type": "n8n-nodes-base.set",
      "position": [
        3720,
        1120
      ]
    },
    {
      "id": "2876c38b-ed23-4d6b-9a65-97c1b70d245a",
      "name": "Create Unique List of Leads",
      "type": "n8n-nodes-base.code",
      "position": [
        4180,
        1480
      ]
    },
    {
      "id": "80336fb8-a783-4907-89eb-82b9877a7b36",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        1040
      ],
      "parameters": {
        "width": 2040,
        "height": 840,
        "content": "## 🛠 Running Apify LinkedIn Comments Scrapers and processing data\nWe want to run an Apify scraper once to validate the number of available comments and then run it multiple times if necessary."
      }
    },
    {
      "id": "3877d666-27e5-4bf7-8a1c-3c1e4dce32d8",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4040,
        1040
      ],
      "parameters": {
        "width": 1700,
        "height": 840,
        "content": "## Create a unique list of Leads, ✨ enrich ✨ it with more data\nOnce we have all of the comment authors, we need to enrich them with more information from LinkedIn\n"
      }
    },
    {
      "id": "fdbf8690-b517-4773-819a-e8bd92ddcd25",
      "name": "Run Apify Comments Scraper",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2180,
        1460
      ]
    },
    {
      "id": "5b426074-2649-48cf-9a55-cedfe1cb0bf7",
      "name": "Run Apify Comments Scraper Loop",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3500,
        1340
      ]
    },
    {
      "id": "b3038b0f-d025-4843-8204-1bb498b193ce",
      "name": "Run Apify Profile Enrichment",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5220,
        1500
      ]
    },
    {
      "id": "87194dbf-8d63-438a-8081-8ed7a4e93169",
      "name": "Split Out Batches",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        4640,
        1480
      ]
    },
    {
      "id": "4fe12998-abdd-4659-aaa7-1aeef2ad241a",
      "name": "Loop Over Comments",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        3280,
        1320
      ]
    },
    {
      "id": "e1a29bde-cfe6-4c89-a601-3ae0b582e052",
      "name": "Loop Over Profiles",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        4940,
        1480
      ]
    },
    {
      "id": "1eb148c9-17a9-4d02-99a0-e647b3398ea4",
      "name": "Split in batches",
      "type": "n8n-nodes-base.code",
      "position": [
        4400,
        1480
      ]
    },
    {
      "id": "596572a6-7ffe-4cfa-b662-8cd083dbaccc",
      "name": "Aggregate Comments",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3780,
        1340
      ]
    },
    {
      "id": "1dc0b52f-3c86-40ea-8c4b-399872e22259",
      "name": "Aggregate Profiles",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        5440,
        1500
      ]
    },
    {
      "id": "21cc6cc8-d4dc-40d9-9cfb-0069786af878",
      "name": "Aggregate All Profiles",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        5220,
        1320
      ]
    },
    {
      "id": "84708fbf-bed4-4ce3-85c9-3ea16a9358c5",
      "name": "Aggregate All Comments",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3500,
        1120
      ]
    },
    {
      "id": "ecab78f3-dcf3-4ddc-afdd-e0d49df4eaca",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        6100,
        1140
      ]
    },
    {
      "id": "36b226d0-a07b-48f1-9a28-85aebf794fd9",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5840,
        1040
      ],
      "parameters": {
        "width": 660,
        "height": 380,
        "content": "## You can either run it manually (not through form) and download the CSV\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nYou need to activate \"Trigger manual\" nodes first\n\n### _(CLICK ME) and Connect_"
      }
    },
    {
      "id": "f278ede4-329d-4248-9f6c-b9bb14fa13aa",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5840,
        1500
      ],
      "parameters": {
        "width": 660,
        "height": 380,
        "content": "## 2. Add credentials to Google Sheets\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### _(CLICK ME)_"
      }
    },
    {
      "id": "49cf9532-0e2f-487e-b6d4-eeb15fec3885",
      "name": "Prepare the list for export",
      "type": "n8n-nodes-base.code",
      "position": [
        5440,
        1320
      ]
    },
    {
      "id": "33928b41-e209-4240-a636-41874b87b2f8",
      "name": "Create Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5920,
        1640
      ]
    },
    {
      "id": "d6e02f6e-0031-4dd8-922b-7981def48097",
      "name": "Add Leads",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        6340,
        1640
      ]
    },
    {
      "id": "fdb1fb37-bc5a-435d-97b4-aef5fbb8175f",
      "name": "Set the list for sheets",
      "type": "n8n-nodes-base.code",
      "position": [
        6140,
        1640
      ]
    },
    {
      "id": "fe6d63a8-dadd-4187-814a-7a421bbb6d3f",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        2200
      ],
      "parameters": {
        "width": 1180,
        "height": 280,
        "content": "\n---\n\n## 📊 Output Data Structure\n\nYour exported data will include:\n\n- **Basic Info**: Name, headline, location\n- **Profile Details**: Company, position, industry\n- **Engagement Data**: Comment content"
      }
    },
    {
      "id": "cc6512e8-8b8b-42b6-ba41-02a647bf6f5d",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1560,
        2200
      ],
      "parameters": {
        "width": 760,
        "height": 540,
        "content": "---\n\n## 💡 Pro Tips\n\n- **Quality over Quantity**: Target posts with high-quality, relevant engagement\n- **Monitor Costs**: Track your Apify usage to stay within budget\n- **Data Hygiene**: Regularly cle"
      }
    },
    {
      "id": "ad786f97-cc63-4259-a469-5c5d271b17f8",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        1240
      ],
      "parameters": {
        "width": 1620,
        "height": 960,
        "content": "\n## 📋 Prerequisites\n\n### Required API Credentials\n\n1. **Apify Token**\n   - Add your `APIFY_TOKEN` to the workflow credentials\n   - [Get your token from Apify Console](https://apify.com/account#/integr"
      }
    },
    {
      "id": "66685e68-953e-41b7-bc24-3de11ec8798a",
      "name": "Done",
      "type": "n8n-nodes-base.noOp",
      "position": [
        7060,
        1360
      ]
    }
  ],
  "connections": {
    "Add Leads": {
      "main": [
        [
          {
            "node": "Done",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "More runs needed?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Over Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set pagination": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        []
      ]
    },
    "Set APIFY Token": {
      "main": [
        [
          {
            "node": "Run Apify Comments Scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split in batches": {
      "main": [
        [
          {
            "node": "Split Out Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger manually": {
      "main": [
        [
          {
            "node": "Set manual fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "More runs needed?": {
      "main": [
        [
          {
            "node": "Set pagination",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Unique List of Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set manual fields": {
      "main": [
        []
      ]
    },
    "Split Out Batches": {
      "main": [
        [
          {
            "node": "Loop Over Profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Comments": {
      "main": [
        [
          {
            "node": "Loop Over Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate Profiles": {
      "main": [
        [
          {
            "node": "Loop Over Profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Comments": {
      "main": [
        [
          {
            "node": "Aggregate All Comments",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run Apify Comments Scraper Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Profiles": {
      "main": [
        [
          {
            "node": "Aggregate All Profiles",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run Apify Profile Enrichment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "Set fields from the form",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Google Sheet": {
      "main": [
        [
          {
            "node": "Set the list for sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gather All Comments": {
      "main": [
        [
          {
            "node": "Create Unique List of Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate All Comments": {
      "main": [
        [
          {
            "node": "Gather All Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate All Profiles": {
      "main": [
        [
          {
            "node": "Prepare the list for export",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set the list for sheets": {
      "main": [
        [
          {
            "node": "Add Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set fields from the form": {
      "main": [
        [
          {
            "node": "Set APIFY Token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Apify Comments Scraper": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Unique List of Leads": {
      "main": [
        [
          {
            "node": "Split in batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare the list for export": {
      "main": [
        [
          {
            "node": "Create Google Sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Apify Profile Enrichment": {
      "main": [
        [
          {
            "node": "Aggregate Profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Apify Comments Scraper Loop": {
      "main": [
        [
          {
            "node": "Aggregate Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}