8
n8n 中文网amn8n.com

自动化潜在客户采集器:Apify到Google Sheets

中级

这是一个Sales, AI, Marketing领域的自动化工作流,包含 6 个节点。主要使用 Set, Code, HttpRequest, GoogleSheets, ManualTrigger 等节点,结合人工智能技术实现智能自动化。 通过数据清洗自动化从Apify到Google Sheets的商业线索采集

前置要求
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "8dpOtivR6zGMa8Nf",
  "meta": {
    "instanceId": "2000c64071c20843606b95c63795bb0797c41036047055a6586498e855b96efc",
    "templateCredsSetupCompleted": true
  },
  "name": "自动化潜在客户采集器:Apify 到 Google Sheets",
  "tags": [],
  "nodes": [
    {
      "id": "331e904a-362e-4b18-ac01-60bd138a7ee1",
      "name": "手动触发器",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1740,
        -300
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "c8c72d6e-4558-4ab1-9c19-2b8e3cefc856",
      "name": "运行 Apify 采集器",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1280,
        -300
      ],
      "parameters": {
        "url": "={{ 'https://api.apify.com/v2/actor-tasks/' + $json.APIFY_TASK_ID + '/run-sync-get-dataset-items?token=' +$json.APIFY_TOKEN}}",
        "options": {
          "splitIntoItems": true
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fb61d5a9-0352-4079-a00f-c42df06bb09e",
      "name": "数据清洗",
      "type": "n8n-nodes-base.code",
      "position": [
        -1080,
        -300
      ],
      "parameters": {
        "jsCode": "// Clean scraped data before LLM processing\nreturn $input.all().map(item => ({\n  ...item.json,\n  phone: item.json.phone?.replace(/[^\\d+]/g, '') || '',\n  email: item.json.email?.toLowerCase().trim() || ''\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "a6988139-87e5-423c-bec9-ce155f617dab",
      "name": "导出到 Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -760,
        -300
      ],
      "parameters": {
        "columns": {
          "value": {
            "phone": "={{ $json.phone }}",
            "Address": "={{ $json.address }}",
            "company name": "={{ $json.title }}"
          },
          "schema": [
            {
              "id": "company name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "company name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phone",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "phone",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1UHkd_OuK1Xzc0ZXo7FPrsd5M1JlsIY9pJDC3fsJ3oq8/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEET_ID",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1UHkd_OuK1Xzc0ZXo7FPrsd5M1JlsIY9pJDC3fsJ3oq8/edit?usp=drivesdk",
          "cachedResultName": "leas list solar"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "f4398fd2-bff0-4e9c-ae1b-f5950be0a384",
      "name": "变量",
      "type": "n8n-nodes-base.set",
      "position": [
        -1500,
        -300
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "4486360c-2296-41ad-a48f-706e24c49a4f",
              "name": "APIFY_TOKEN",
              "type": "string",
              "value": "YOUR_APIFY_API_TOKEN"
            },
            {
              "id": "6e56b0e3-36ae-4f1e-b0e5-38767bbe8af9",
              "name": "APIFY_TASK_ID",
              "type": "string",
              "value": "YOUR_APIFY_TASK_ID"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "04a980cf-365b-4cc3-8439-fd71cb1f05a3",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1860,
        -820
      ],
      "parameters": {
        "color": 7,
        "width": 1660,
        "height": 780,
        "content": "## 使用 Apify 到 Google Sheets 的自动化商业潜在客户采集器"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "47bf9abd-67aa-49c8-81c9-761e75ee731f",
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Variables",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Variables": {
      "main": [
        [
          {
            "node": "Run Apify Scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Data": {
      "main": [
        [
          {
            "node": "Export to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Apify Scraper": {
      "main": [
        [
          {
            "node": "Clean Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 销售, 人工智能, 营销

需要付费吗?

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

工作流信息
难度等级
中级
节点数量6
分类3
节点类型6
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
David Olusola

David Olusola

@dae221

I love building smart, efficient automations with n8n that help businesses save time and scale effortlessly. Turning complex workflows into simple solutions is where I have the most fun

外部链接
在 n8n.io 查看

分享此工作流