从 Google 表格丰富营销线索

中级

这是一个Lead Generation领域的自动化工作流,包含 12 个节点。主要使用 If、Code、Wait、Gmail、Filter 等节点。 🚀 使用Surfe、Google Sheets和HubSpot自动化LinkedIn联系人信息丰富

前置要求
  • Google 账号和 Gmail API 凭证
  • HubSpot API Key
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • Google Drive API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "GepE6tB2olhDRCxP",
  "meta": {
    "instanceId": "1c6299b01fe56ad80280bbb1a8394f761ca72a9606abe611a4617f9adc407187",
    "templateCredsSetupCompleted": true
  },
  "name": "从 Google 表格丰富营销线索",
  "tags": [],
  "nodes": [
    {
      "id": "0796ab84-bf14-4f51-906e-db01486b2c76",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -460,
        580
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1-4gGB9cugFdrutFYdlaPwMT737ODxPnizWqLODoDfmo/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "0cf2212f-e1f3-4616-ad6b-6c8c00bfe237",
      "name": "Google Drive 触发器",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -760,
        580
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {
          "fileType": "application/vnd.google-apps.spreadsheet"
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1C4ccbMW84VWzgGMsNTVEUUm3i_MH3Rlm",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1C4ccbMW84VWzgGMsNTVEUUm3i_MH3Rlm",
          "cachedResultName": "folder-n8n-listener"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c3e28407-7bb4-4d2a-8009-0621f236efa3",
      "name": "筛选:电话和邮箱",
      "type": "n8n-nodes-base.filter",
      "position": [
        1240,
        440
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "4f8f9bec-6eee-4e62-8d5f-e8f5b85620d6",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.phone }}",
              "rightValue": ""
            },
            {
              "id": "007f5a66-4e2a-42bc-bbed-0fb2b2f39ae7",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.email }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "23fdf067-cd74-4b04-96df-9241a86570cf",
      "name": "从Surfe API响应中提取人员列表",
      "type": "n8n-nodes-base.code",
      "position": [
        1020,
        440
      ],
      "parameters": {
        "jsCode": "const people = $json.people || [];\n\nreturn people.map(person => {\n  return {\n    json: {\n      id: person.id || '',\n      firstName: person.firstName || '',\n      lastName: person.lastName || '',\n      email: person.emails?.[0]?.email || '',\n      phone: person.mobilePhones?.[0]?.mobilePhone || '',\n      jobTitle: person.jobTitle || '',\n      companyName: person.companyName || '',\n      companyWebsite: person.companyWebsite || '',\n      linkedinUrl: person.linkedinUrl || '',\n      country: person.country || '',\n      status: person.status || ''\n    }\n  };\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "1b84d64f-85ea-4914-96e2-3321c3ed389d",
      "name": "丰富是否完成?",
      "type": "n8n-nodes-base.if",
      "position": [
        800,
        480
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "65a670df-84e8-4c87-956c-96758b8d8d26",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.status }}",
              "rightValue": "COMPLETED"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "735abd1e-66df-4e0c-92e4-803c08edd307",
      "name": "Surfe批量丰富API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        340,
        580
      ],
      "parameters": {
        "url": "https://api.surfe.com/v2/people/enrich",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "jsonBody": "={{ $json }}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer XXXXXXXXXXXXXXXXXXXXXXXX"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "976ebf8c-8838-41c1-bb8f-f817a9b60ae9",
      "name": "Surfe检查丰富状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        560,
        580
      ],
      "parameters": {
        "url": "=https://api.surfe.com/v2/people/enrich/{{ $json.enrichmentID }}",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "jsonBody": "{\n  \"enrichmentType\": \"emailAndMobile\",\n  \"listName\": \"listName\",\n  \"people\": [\n    {\n      \"firstName\": \"\",\n      \"lastName\": \"\",\n      \"companyName\": \"\",\n      \"companyWebsite\": \"\",\n      \"externalID\": \"\",\n      \"linkedinUrl\": \"[YOUR LINKEDIN URL]/\"\n    }\n  ]\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer XXXXXXXXXXXXXXXXXXXXXXXX"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "94417a70-a873-491e-88e6-262dcadde94f",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "notes": "Notify end of all batches",
      "position": [
        120,
        340
      ],
      "webhookId": "b46c028e-8212-40fe-b4d5-0f7c1890585e",
      "parameters": {
        "sendTo": "{YOUR EMAIL ADDRESS}",
        "message": "Your batch csv enrichment is done.",
        "options": {},
        "subject": "Your batch csv enrichment is done."
      },
      "executeOnce": true,
      "notesInFlow": true,
      "typeVersion": 2.1
    },
    {
      "id": "ad49f2c1-a9a0-49fa-8853-aef4dc63a453",
      "name": "分批处理 - 500",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -160,
        580
      ],
      "parameters": {
        "options": {},
        "batchSize": 500
      },
      "notesInFlow": false,
      "typeVersion": 3,
      "alwaysOutputData": false
    },
    {
      "id": "b1c2c48c-5ba6-4a42-ab17-bf69400aa0ac",
      "name": "HubSpot:创建或更新",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1380,
        1100
      ],
      "parameters": {
        "email": "={{ $json.email }}",
        "options": {
          "resolveData": false
        },
        "authentication": "appToken",
        "additionalFields": {
          "country": "={{ $json.country }}",
          "jobTitle": "={{ $json.jobTitle }}",
          "lastName": "={{ $json.lastName }}",
          "firstName": "={{ $json.firstName }}",
          "websiteUrl": "={{ $json.linkedinUrl }}",
          "companyName": "={{ $json.companyName }}",
          "phoneNumber": "={{ $json.phone }}",
          "mobilePhoneNumber": "={{ $json.phone }}"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "5e689b8d-5539-4593-9e18-903b172f4c73",
      "name": "等待 30 秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        780,
        940
      ],
      "webhookId": "faddf14b-4e33-4108-a141-c1a172e0a5d1",
      "parameters": {
        "amount": 30
      },
      "typeVersion": 1.1
    },
    {
      "id": "b6b81b03-77b5-4868-91f6-12d4d9c248d9",
      "name": "准备JSON负载丰富请求",
      "type": "n8n-nodes-base.code",
      "position": [
        120,
        580
      ],
      "parameters": {
        "jsCode": "const items = $input.all();\n\nreturn [\n  {\n    json: {\n    \"include\": {\n      \"email\": true,\n      \"linkedInUrl\": false,\n      \"mobile\": true\n    },\n    \"notificationOptions\": {\n      \"webhookUrl\": \"\"\n    },\n      people: items.map((item) => ({\n        firstName: \"\",\n        lastName: \"\",\n        companyName: \"\",\n        companyWebsite: \"\",\n        externalID: \"\",\n        linkedinUrl: item.json.linkedin_url,\n      })),\n    },\n  },\n];\n"
      },
      "typeVersion": 2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "eb0be05b-a13d-453a-ae04-6800bce9699a",
  "connections": {
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Split Batch - 500",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 30 secondes": {
      "main": [
        [
          {
            "node": "Surfe check enrichement status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Batch - 500": {
      "main": [
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare JSON Payload Enrichment Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter: phone AND email": {
      "main": [
        [
          {
            "node": "HubSpot: Create or Update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is enrichment complete ?": {
      "main": [
        [
          {
            "node": "Extract list of peoples from Surfe API response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Wait 30 secondes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot: Create or Update": {
      "main": [
        [
          {
            "node": "Split Batch - 500",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Surfe Bulk Enrichments API": {
      "main": [
        [
          {
            "node": "Surfe check enrichement status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Surfe check enrichement status": {
      "main": [
        [
          {
            "node": "Is enrichment complete ?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare JSON Payload Enrichment Request": {
      "main": [
        [
          {
            "node": "Surfe Bulk Enrichments API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract list of peoples from Surfe API response": {
      "main": [
        [
          {
            "node": "Filter: phone AND email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

这是一个中级难度的工作流,适用于Lead Generation等场景。适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

需要付费吗?

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

工作流信息
难度等级
中级
节点数量12
分类1
节点类型10
难度说明

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

作者
go-surfe

go-surfe

@go-surfe

Save time and sell more with Surfe's API via n8n workflows. - Accurate data you can trust - Results in milliseconds - Scalable and versatile - Full automation For more check out: 💻 https://www.surfe.com?utm_source=n8n 🔗 https://www.linkedin.com/company/surfe/ 👾 https://github.com/surfe/api-examples

外部链接
在 n8n.io 上查看 →

分享此工作流