8
n8n 中文网amn8n.com

使用Apify→Google Sheets/CSV提取并丰富LinkedIn评论为潜在客户

高级

这是一个Sales, AI领域的自动化工作流,包含 39 个节点。主要使用 If, Set, Code, SplitOut, Aggregate 等节点,结合人工智能技术实现智能自动化。 使用Apify→Google Sheets/CSV提取并丰富LinkedIn评论为潜在客户

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "30e5848b346369e688a90590edfdf72f9e085f2b2ed50b31cf94f3bfb8c384ed",
    "templateId": "4635"
  },
  "nodes": [
    {
      "id": "66c32da3-373c-42a9-bf51-5bec1fd6c4cd",
      "name": "手动触发",
      "type": "n8n-nodes-base.manualTrigger",
      "disabled": true,
      "position": [
        1240,
        1360
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "6a0decfe-9539-4c10-9474-0031fa91dfc5",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        240
      ],
      "parameters": {
        "color": 5,
        "width": 1620,
        "height": 1000,
        "content": "# 🚀 LinkedIn 评论转潜在客户提取器与丰富器 (Apify) → Google Sheets / CSV"
      },
      "typeVersion": 1
    },
    {
      "id": "e206b173-eb8a-4721-8251-8b0ebb2aa38f",
      "name": "表单提交时",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        1300,
        1760
      ],
      "webhookId": "a81d04b5-169a-4368-b925-91fb0660b6b2",
      "parameters": {
        "options": {
          "ignoreBots": true,
          "buttonLabel": "Submit",
          "appendAttribution": false,
          "respondWithOptions": {
            "values": {
              "redirectUrl": "=https://docs.google.com/spreadsheets/u/0/",
              "respondWith": "redirect"
            }
          }
        },
        "formTitle": "Linkedin Posts Comments Leads Scraper",
        "formFields": {
          "values": [
            {
              "fieldType": "textarea",
              "fieldLabel": "Post IDs/URLs",
              "placeholder": "e.g. 7334385757769416704, https://www.linkedin.com/feed/update/urn:li:activity:7334385757769416704/",
              "requiredField": true
            },
            {
              "fieldType": "number",
              "fieldLabel": "How many comments you want to scrape?",
              "placeholder": "Default: 100"
            }
          ]
        },
        "responseMode": "lastNode",
        "formDescription": "=<div style=\"font-family: Arial, sans-serif; line-height: 1.8; color: #333; word-wrap: break-word; overflow-wrap: break-word;\">\n\n<p style=\"margin-bottom: 20px;\"><strong style=\"color: #0077b5;\">🔸 Step 1: Add Posts URLs</strong></p>\n<p style=\"margin-bottom: 20px;\">The workflow accepts various LinkedIn post identifier formats:</p>\n\n<p style=\"margin-bottom: 18px;\"><strong>📊 Numeric post IDs:</strong><br>\n<span style=\"font-family: monospace; background: #f5f5f5; padding: 4px 6px; word-break: break-all; margin-top: 8px; display: inline-block;\">7334385757769416704</span></p>\n\n<p style=\"margin-bottom: 18px;\"><strong>🔗 Activity URLs:</strong><br>\n<span style=\"font-family: monospace; background: #f5f5f5; padding: 4px 6px; word-break: break-all; display: block; margin-top: 8px;\">https://www.linkedin.com/feed/update/urn:li:activity:273437/</span></p>\n\n<p style=\"margin-bottom: 25px;\"><strong>🌐 Full post URLs:</strong><br>\n<span style=\"font-family: monospace; background: #f5f5f5; padding: 4px 6px; word-break: break-all; display: block; margin-top: 8px;\">https://www.linkedin.com/posts/username_title-activity-7334385757769416704-dMnz</span></p>\n\n<hr style=\"margin: 30px 0; border: 1px solid #ddd;\">-------------------\n\n<p style=\"margin-bottom: 20px;\"><strong style=\"color: #28a745;\">✅ Step 2: Results</strong></p>\n<p style=\"margin-bottom: 20px;\">Once finished, you'll be redirected to Google Sheets where you can find your result with the name:</p>\n<p style=\"background: #f0f8ff; padding: 15px; border-left: 4px solid #0077b5; margin: 20px 0;\">\n<strong>\"LinkedIn-Posts-Comments-Leads-{{ $now.format('yyyy-MM-dd') }}\"</strong>\n</p>\n\n<hr style=\"margin: 30px 0; border: 1px solid #ddd;\">-------------------\n\n\n<p style=\"color: #666; font-size: 14px; margin-top: 25px;\"><em>💡 Tip: Make sure your LinkedIn URLs are publicly accessible for the best results.</em></p>\n\n</div>"
      },
      "typeVersion": 2.2
    },
    {
      "id": "d90f3510-b326-4352-90f4-772eca3d5b9b",
      "name": "设置 APIFY Token",
      "type": "n8n-nodes-base.set",
      "position": [
        1820,
        1460
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "20febbcc-0a59-4a89-8932-9bbb34b0e9f9",
              "name": "APIFY_TOKEN",
              "type": "string",
              "value": ""
            },
            {
              "id": "291758a3-c73f-4db5-a2b3-5f88664a8b53",
              "name": "limit",
              "type": "number",
              "value": "={{ $json.limit }}"
            },
            {
              "id": "921b72d5-3688-4324-9d36-50668548344e",
              "name": "postIds",
              "type": "array",
              "value": "={{ $json.postIds }}"
            }
          ]
        },
        "includeOtherFields": true
      },
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "36eb3f1f-e0db-4175-964e-9200bf503918",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1740,
        1360
      ],
      "parameters": {
        "color": 3,
        "width": 260,
        "height": 300,
        "content": "## 1. 设置 APIFY TOKEN"
      },
      "typeVersion": 1
    },
    {
      "id": "5237c7a8-e2b4-49ae-a070-9cd885e1bc18",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1420,
        1280
      ],
      "parameters": {
        "color": 2,
        "height": 300,
        "content": "_(或如果手动运行则启用此项)_"
      },
      "typeVersion": 1
    },
    {
      "id": "9637dc03-c409-477d-a596-c84f4df12d63",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1160,
        1620
      ],
      "parameters": {
        "color": 3,
        "width": 400,
        "height": 380,
        "content": "## 3. 您可以通过表单运行(检查表单 URL)"
      },
      "typeVersion": 1
    },
    {
      "id": "efe492e1-78f7-4f55-89d7-caea70767044",
      "name": "从表单设置字段",
      "type": "n8n-nodes-base.set",
      "position": [
        1620,
        1760
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "916bb8f7-34c5-4f2f-b13d-f60d228abc1f",
              "name": "postIds",
              "type": "array",
              "value": "={{ $json['Post IDs/URLs'].replaceAll('\\n','').replaceAll('\\r', '').split(',').filter(item => $ifEmpty(item, false))  }}"
            },
            {
              "id": "7ff3d2f4-ab8a-444f-9747-f95166a950bd",
              "name": "limit",
              "type": "number",
              "value": "={{ $json['How many comments you want to scrape?'] || 100 }}"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "aea3954b-94cf-4785-a692-a46d45b9add5",
      "name": "设置手动字段",
      "type": "n8n-nodes-base.set",
      "disabled": true,
      "position": [
        1480,
        1360
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "af09ad86-b3dd-45b7-b17d-cb810e4b48d6",
              "name": "postIds",
              "type": "array",
              "value": "['https://www.linkedin.com/feed/update/urn:li:activity:7334385757769416704/', 'https://www.linkedin.com/feed/update/urn:li:activity:7318557377971023872/']"
            },
            {
              "id": "b2f9412e-4c81-454f-ad84-a1d5f6547a26",
              "name": "limit",
              "type": "number",
              "value": 100
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 3.4
    },
    {
      "id": "c9d2e385-9c38-43ea-88bd-e7363f215cc7",
      "name": "需要更多运行吗?",
      "type": "n8n-nodes-base.if",
      "notes": "Per run it's only 100 comments",
      "position": [
        2620,
        1460
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "19224073-c84d-456f-b694-318df4223d2a",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.summary.totalComments }}",
              "rightValue": 100
            },
            {
              "id": "8156447e-75dd-4cad-8fc8-17366667d165",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $('Set APIFY Token').first().json.limit }}",
              "rightValue": 100
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 2.2
    },
    {
      "id": "021e8ae2-6773-4154-ab59-61dab49b16e9",
      "name": "设置分页",
      "type": "n8n-nodes-base.code",
      "position": [
        2840,
        1320
      ],
      "parameters": {
        "jsCode": "const limitPages = Math.ceil($('Set APIFY Token').first().json.limit / 100)\nconst totalComments = $('Run Apify Comments Scraper').last().json.summary.totalComments \nconst availablePages = Math.ceil(totalComments / 100)\n\nconst totalRuns = availablePages <= limitPages ? availablePages : limitPages\n\nlet currentPage = 2\n\n\nreturn {\n  json: {\n    items:\n      Array.from({ length: totalRuns }, (_, i) => {\n        return { currentPage: currentPage + i }\n      })\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "5371649d-d032-452d-8af6-13a679b254fd",
      "name": "拆分输出",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        3060,
        1320
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "items"
      },
      "typeVersion": 1
    },
    {
      "id": "4003ce75-3e13-4d2a-9199-bac9f5bda6de",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        2400,
        1460
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "items"
      },
      "typeVersion": 1
    },
    {
      "id": "c25710e8-c47c-4fb9-91e1-d9fe37ad53fa",
      "name": "收集所有评论",
      "type": "n8n-nodes-base.set",
      "position": [
        3720,
        1120
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b4280f11-a50b-4065-8742-9f994c6ee84d",
              "name": "items",
              "type": "array",
              "value": "={{ $json.items.concat($('Aggregate').item.json.items) }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2876c38b-ed23-4d6b-9a65-97c1b70d245a",
      "name": "创建唯一潜在客户列表",
      "type": "n8n-nodes-base.code",
      "position": [
        4180,
        1480
      ],
      "parameters": {
        "jsCode": "// Get all input items\nconst items = $input.first().json.items;\n\n// Use reduce to filter unique profile_url values\nconst uniqueProfiles = items.reduce((acc, item) => {\n  // Check if this profile_url is already in the accumulator\n  console.log(item)\n  if (item.author && !acc.some(i => i.profile_url === item.author.profile_url)) {\n    acc.push(item.author);\n  }\n  return acc;\n}, []);\n\nreturn uniqueProfiles"
      },
      "typeVersion": 2
    },
    {
      "id": "80336fb8-a783-4907-89eb-82b9877a7b36",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2000,
        1040
      ],
      "parameters": {
        "color": 7,
        "width": 2040,
        "height": 840,
        "content": "## 🛠 运行 Apify LinkedIn 评论抓取器并处理数据"
      },
      "typeVersion": 1
    },
    {
      "id": "3877d666-27e5-4bf7-8a1c-3c1e4dce32d8",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4040,
        1040
      ],
      "parameters": {
        "width": 1700,
        "height": 840,
        "content": "## 创建唯一的潜在客户列表,✨ 丰富 ✨ 更多数据"
      },
      "typeVersion": 1
    },
    {
      "id": "fdbf8690-b517-4773-819a-e8bd92ddcd25",
      "name": "运行 Apify 评论抓取器",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2180,
        1460
      ],
      "parameters": {
        "url": "={{ 'https://api.apify.com/v2/acts/apimaestro~linkedin-post-comments-replies-engagements-scraper-no-cookies/run-sync-get-dataset-items?token=' +$json.APIFY_TOKEN}}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "postIds",
              "value": "={{ $json.postIds }}"
            },
            {
              "name": "page_number",
              "value": "={{ 1 }}"
            },
            {
              "name": "sortOrder",
              "value": "most recent"
            },
            {
              "name": "limit",
              "value": "={{ $json.limit }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5b426074-2649-48cf-9a55-cedfe1cb0bf7",
      "name": "运行 Apify 评论抓取器循环",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3500,
        1340
      ],
      "parameters": {
        "url": "={{ 'https://api.apify.com/v2/acts/apimaestro~linkedin-post-comments-replies-engagements-scraper-no-cookies/run-sync-get-dataset-items?token=' + $('Set APIFY Token').first().json.APIFY_TOKEN}}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "postIds",
              "value": "={{ $('Set APIFY Token').first().json.postIds }}"
            },
            {
              "name": "page_number",
              "value": "={{ $json.currentPage }}"
            },
            {
              "name": "sortOrder",
              "value": "most recent"
            },
            {
              "name": "limit",
              "value": "={{ $('Set APIFY Token').first().json.limit }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b3038b0f-d025-4843-8204-1bb498b193ce",
      "name": "运行 Apify 资料丰富",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5220,
        1500
      ],
      "parameters": {
        "url": "={{ 'https://api.apify.com/v2/acts/apimaestro~linkedin-profile-batch-scraper-no-cookies-required/run-sync-get-dataset-items?token=' + $('Set APIFY Token').first().json.APIFY_TOKEN}}",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "usernames",
              "value": "={{ $json.batches }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "87194dbf-8d63-438a-8081-8ed7a4e93169",
      "name": "分批拆分",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        4640,
        1480
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {},
        "fieldToSplitOut": "batches"
      },
      "typeVersion": 1
    },
    {
      "id": "4fe12998-abdd-4659-aaa7-1aeef2ad241a",
      "name": "遍历评论",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        3280,
        1320
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "e1a29bde-cfe6-4c89-a601-3ae0b582e052",
      "name": "循环处理资料",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        4940,
        1480
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "1eb148c9-17a9-4d02-99a0-e647b3398ea4",
      "name": "分批处理",
      "type": "n8n-nodes-base.code",
      "position": [
        4400,
        1480
      ],
      "parameters": {
        "jsCode": "const uniqueProfiles = $input.all().map(item => item.json.profile_url)\n\n// Split the uniqueProfiles in batches of 500 for the Apify\nconst chunkSize = 500;\nconst batches = [];\n\nfor (let i = 0; i < uniqueProfiles.length; i += chunkSize) {\n  batches.push(uniqueProfiles.slice(i, i + chunkSize));\n}\n\n\nreturn { batches };"
      },
      "typeVersion": 2
    },
    {
      "id": "596572a6-7ffe-4cfa-b662-8cd083dbaccc",
      "name": "聚合评论",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3780,
        1340
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "items"
      },
      "typeVersion": 1
    },
    {
      "id": "1dc0b52f-3c86-40ea-8c4b-399872e22259",
      "name": "聚合资料",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        5440,
        1500
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "items"
      },
      "typeVersion": 1
    },
    {
      "id": "21cc6cc8-d4dc-40d9-9cfb-0069786af878",
      "name": "聚合所有资料",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        5220,
        1320
      ],
      "parameters": {
        "options": {
          "mergeLists": true
        },
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "items"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "84708fbf-bed4-4ce3-85c9-3ea16a9358c5",
      "name": "聚合所有评论",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3500,
        1120
      ],
      "parameters": {
        "options": {
          "mergeLists": true
        },
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "items"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ecab78f3-dcf3-4ddc-afdd-e0d49df4eaca",
      "name": "转换为文件",
      "type": "n8n-nodes-base.convertToFile",
      "disabled": true,
      "position": [
        6100,
        1140
      ],
      "parameters": {
        "options": {
          "headerRow": true
        }
      },
      "executeOnce": true,
      "typeVersion": 1.1
    },
    {
      "id": "36b226d0-a07b-48f1-9a28-85aebf794fd9",
      "name": "### 需要帮助?",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5840,
        1040
      ],
      "parameters": {
        "color": 2,
        "width": 660,
        "height": 380,
        "content": "## 您可以手动运行(不通过表单)并下载 CSV"
      },
      "typeVersion": 1
    },
    {
      "id": "f278ede4-329d-4248-9f6c-b9bb14fa13aa",
      "name": "## 试试看!",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5840,
        1500
      ],
      "parameters": {
        "color": 3,
        "width": 660,
        "height": 380,
        "content": "## 2. 向 Google Sheets 添加凭据"
      },
      "typeVersion": 1
    },
    {
      "id": "49cf9532-0e2f-487e-b6d4-eeb15fec3885",
      "name": "准备导出列表",
      "type": "n8n-nodes-base.code",
      "position": [
        5440,
        1320
      ],
      "parameters": {
        "jsCode": "function flatten(obj, prefix = '', res = {}) {\n  for (const key in obj) {\n    const value = obj[key];\n    const prefixedKey = prefix ? `${prefix}_${key}` : key;\n    if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n      flatten(value, prefixedKey, res);\n    } else {\n      res[prefixedKey] = value;\n    }\n  }\n  return res;\n}\n\nreturn $input.first().json.items.map(item => ({\n  json: flatten(item)\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "33928b41-e209-4240-a636-41874b87b2f8",
      "name": "创建 Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5920,
        1640
      ],
      "parameters": {
        "title": "=LinkedIn-Posts-Comments-Leads-{{ $now.format('yyyy-MM-dd+T') }}",
        "options": {},
        "resource": "spreadsheet",
        "sheetsUi": {
          "sheetValues": [
            {
              "title": "Leads"
            }
          ]
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "w7X41eUzPcqOkYCg",
          "name": "Google Sheets account"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.5
    },
    {
      "id": "d6e02f6e-0031-4dd8-922b-7981def48097",
      "name": "添加潜在客户",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        6340,
        1640
      ],
      "parameters": {
        "columns": {
          "value": {},
          "schema": [
            {
              "id": "profileUrl",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "profileUrl",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_fullname",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_fullname",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_first_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_first_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_last_name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_last_name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_headline",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_headline",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_public_identifier",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_public_identifier",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_profile_picture_url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_profile_picture_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_about",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_about",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_location_country",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_location_country",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_location_city",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_location_city",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_location_full",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_location_full",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_location_country_code",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_location_country_code",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_creator_hashtags",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_creator_hashtags",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_is_creator",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_is_creator",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_is_influencer",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_is_influencer",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_is_premium",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_is_premium",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_created_timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_created_timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_show_follower_count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_show_follower_count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_background_picture_url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_background_picture_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_urn",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_urn",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_follower_count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_follower_count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_connection_count",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_connection_count",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_current_company",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_current_company",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_current_company_urn",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_current_company_urn",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "basic_info_current_company_url",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "basic_info_current_company_url",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "experience",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "experience",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "education",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "education",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "certifications",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "certifications",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "autoMapInputData",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {
          "useAppend": true,
          "cellFormat": "USER_ENTERED"
        },
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create Google Sheet').first().json.sheets[0].properties.sheetId }}"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Create Google Sheet').first().json.spreadsheetId }}"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "w7X41eUzPcqOkYCg",
          "name": "Google Sheets account"
        }
      },
      "executeOnce": false,
      "typeVersion": 4.5
    },
    {
      "id": "fdb1fb37-bc5a-435d-97b4-aef5fbb8175f",
      "name": "为 Sheets 设置列表",
      "type": "n8n-nodes-base.code",
      "position": [
        6140,
        1640
      ],
      "parameters": {
        "jsCode": "\nreturn $('Prepare the list for export').all();"
      },
      "typeVersion": 2
    },
    {
      "id": "fe6d63a8-dadd-4187-814a-7a421bbb6d3f",
      "name": "GET 模型",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        2200
      ],
      "parameters": {
        "color": 5,
        "width": 1180,
        "height": 280,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "cc6512e8-8b8b-42b6-ba41-02a647bf6f5d",
      "name": "## 1. 创建新的自定义 OpenAI 凭据",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1560,
        2200
      ],
      "parameters": {
        "width": 760,
        "height": 540,
        "content": "---"
      },
      "typeVersion": 1
    },
    {
      "id": "ad786f97-cc63-4259-a469-5c5d271b17f8",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        1240
      ],
      "parameters": {
        "color": 6,
        "width": 1620,
        "height": 960,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "66685e68-953e-41b7-bc24-3de11ec8798a",
      "name": "完成",
      "type": "n8n-nodes-base.noOp",
      "position": [
        7060,
        1360
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "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
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 销售, 人工智能

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量39
分类2
节点类型13
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Saverflow AI

Saverflow AI

@saverflowai

At Saverflow AI, we build AI-powered systems that drive growth and cut costs. Pillar 1: Lead Generation – We automate outreach, enrich leads, and book meetings using Clay, GPT, and Instantly. Pillar 2: AI Automation – We create tailored workflows for ticketing, docs, and ops. Results: More sales, up to 40% cost savings. Trusted by companies across Europe, the USA, and the Middle East.

外部链接
在 n8n.io 查看

分享此工作流