8
n8n 中文网amn8n.com

基于 HubSpot、Clearbit 和 Slack 的自动化线索捕获、评分与 CRM 集成

高级

这是一个Lead Generation, Multimodal AI领域的自动化工作流,包含 22 个节点。主要使用 If, Code, Merge, Slack, Hubspot 等节点。 基于 HubSpot、Clearbit 和 Slack 的自动化线索捕获、评分与 CRM 集成

前置要求
  • Slack Bot Token 或 Webhook URL
  • HubSpot API Key
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "5a648bd3f759c69d3a1e71a0e47ad1046af7ce76a6f331a86cd6058d8a6372fa",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "fb029ad8-8110-4407-8a54-614bcbafddd8",
      "name": "便签 - 概览",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1312,
        -144
      ],
      "parameters": {
        "width": 492,
        "height": 464,
        "content": "## 潜在客户捕获与自动筛选工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "49d3b848-dc51-43cf-b22b-cfb9f8e24c77",
      "name": "潜在客户捕获 Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -224,
        400
      ],
      "webhookId": "lead-capture-hook",
      "parameters": {
        "path": "lead-capture",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "ad3ce370-da9d-4ba3-ab48-834c2e6bce34",
      "name": "便利贴 - Webhook设置",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        -144
      ],
      "parameters": {
        "width": 520,
        "height": 460,
        "content": "## Webhook 配置"
      },
      "typeVersion": 1
    },
    {
      "id": "059a2f3a-dc94-42c6-9273-cbb24ad894e7",
      "name": "验证潜在客户数据",
      "type": "n8n-nodes-base.if",
      "position": [
        0,
        400
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "email-validation",
              "operator": {
                "type": "string",
                "operation": "isNotEmpty"
              },
              "leftValue": "={{ $json.email }}",
              "rightValue": ""
            },
            {
              "id": "email-format",
              "operator": {
                "type": "string",
                "operation": "regex"
              },
              "leftValue": "={{ $json.email }}",
              "rightValue": "^[\\w-\\.]+@[\\w-]+\\.[a-zA-Z]{2,}$"
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "c50640e7-bdab-4680-beb4-96e9dd379ebe",
      "name": "便签 - 数据验证",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        -448
      ],
      "parameters": {
        "width": 340,
        "height": 408,
        "content": "## 数据验证规则"
      },
      "typeVersion": 1
    },
    {
      "id": "409667ca-b5ab-4cab-864b-1b468da0ddca",
      "name": "使用 Clearbit 丰富信息",
      "type": "n8n-nodes-base.clearbit",
      "position": [
        224,
        208
      ],
      "parameters": {
        "email": "={{ $json.email }}",
        "resource": "person",
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "id": "b16da09c-2e02-4a25-8ffb-fb6d18d44273",
      "name": "便签 - 丰富信息",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        -448
      ],
      "parameters": {
        "width": 344,
        "height": 268,
        "content": "## 潜在客户丰富"
      },
      "typeVersion": 1
    },
    {
      "id": "c4e3201e-f8f8-42bf-b142-e12a63d6cdd6",
      "name": "使用 Apollo 进行丰富化",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        224,
        400
      ],
      "parameters": {
        "url": "={{ $env.APOLLO_API_URL }}/v1/people/match",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "email",
              "value": "={{ $json.email }}"
            },
            {
              "name": "first_name",
              "value": "={{ $json.firstName }}"
            },
            {
              "name": "last_name",
              "value": "={{ $json.lastName }}"
            }
          ]
        },
        "genericAuthType": "httpHeaderAuth",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "Cache-Control",
              "value": "no-cache"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "dbbb2ca7-c9e1-4a32-8270-fb9bdf328c54",
      "name": "合并丰富数据",
      "type": "n8n-nodes-base.merge",
      "position": [
        448,
        304
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "6c14adc8-bdac-4a21-a1ae-ce9fc61605d1",
      "name": "便签 - 潜在客户评分",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -448
      ],
      "parameters": {
        "width": 396,
        "height": 388,
        "content": "## 潜在客户筛选标准"
      },
      "typeVersion": 1
    },
    {
      "id": "1318776b-db42-4031-bc8c-5224889da500",
      "name": "计算潜在客户评分",
      "type": "n8n-nodes-base.code",
      "position": [
        672,
        304
      ],
      "parameters": {
        "jsCode": "// Lead Qualification & Scoring Logic\nconst lead = $input.first().json;\nconst enrichment = lead.enrichment_data || {};\n\n// Initialize score\nlet score = 0;\nlet qualificationNotes = [];\n\n// Company Size Scoring\nif (enrichment.company?.metrics?.employees) {\n  const employees = enrichment.company.metrics.employees;\n  if (employees >= 500) {\n    score += 30;\n    qualificationNotes.push('Large company (500+ employees)');\n  } else if (employees >= 50) {\n    score += 20;\n    qualificationNotes.push('Medium company (50-500 employees)');\n  } else if (employees >= 10) {\n    score += 10;\n    qualificationNotes.push('Small company (10-50 employees)');\n  }\n}\n\n// Industry Scoring\nconst targetIndustries = ['Technology', 'Software', 'SaaS', 'Finance', 'Healthcare'];\nif (enrichment.company?.category?.industry) {\n  if (targetIndustries.includes(enrichment.company.category.industry)) {\n    score += 25;\n    qualificationNotes.push(`Target industry: ${enrichment.company.category.industry}`);\n  }\n}\n\n// Title/Role Scoring\nif (enrichment.person?.employment?.title) {\n  const title = enrichment.person.employment.title.toLowerCase();\n  if (title.includes('ceo') || title.includes('founder') || title.includes('president')) {\n    score += 25;\n    qualificationNotes.push('C-level executive');\n  } else if (title.includes('director') || title.includes('vp') || title.includes('manager')) {\n    score += 15;\n    qualificationNotes.push('Management level');\n  }\n}\n\n// Email Domain Scoring\nconst email = lead.email || '';\nconst domain = email.split('@')[1];\nconst personalDomains = ['gmail.com', 'yahoo.com', 'hotmail.com', 'outlook.com'];\nif (!personalDomains.includes(domain)) {\n  score += 10;\n  qualificationNotes.push('Business email domain');\n} else {\n  qualificationNotes.push('Personal email domain');\n}\n\n// Revenue Scoring (if available)\nif (enrichment.company?.metrics?.annualRevenue) {\n  const revenue = enrichment.company.metrics.annualRevenue;\n  if (revenue >= 10000000) { // $10M+\n    score += 20;\n    qualificationNotes.push('High revenue company ($10M+)');\n  } else if (revenue >= 1000000) { // $1M+\n    score += 10;\n    qualificationNotes.push('Medium revenue company ($1M+)');\n  }\n}\n\n// Determine qualification level\nlet qualificationLevel;\nlet priority;\nif (score >= 80) {\n  qualificationLevel = 'High';\n  priority = 'Immediate Follow-up';\n} else if (score >= 50) {\n  qualificationLevel = 'Medium';\n  priority = 'Follow-up within 24h';\n} else if (score >= 25) {\n  qualificationLevel = 'Low';\n  priority = 'Add to nurture sequence';\n} else {\n  qualificationLevel = 'Unqualified';\n  priority = 'Archive or reject';\n}\n\n// Return enriched lead data\nreturn {\n  ...lead,\n  qualification: {\n    score: score,\n    level: qualificationLevel,\n    priority: priority,\n    notes: qualificationNotes,\n    timestamp: new Date().toISOString()\n  },\n  enriched_company: enrichment.company || {},\n  enriched_person: enrichment.person || {}\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "2398e080-42c8-405e-a430-f27389b930c8",
      "name": "按筛选结果路由",
      "type": "n8n-nodes-base.if",
      "position": [
        896,
        304
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "high-score",
              "operator": {
                "type": "number",
                "operation": "gte"
              },
              "leftValue": "={{ $json.qualification.score }}",
              "rightValue": 80
            }
          ]
        }
      },
      "typeVersion": 2
    },
    {
      "id": "6490475a-d9bb-43c1-8bbf-3379cfd40754",
      "name": "便签 - 高优先级行动",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -448
      ],
      "parameters": {
        "width": 392,
        "height": 316,
        "content": "## 高优先级潜在客户行动"
      },
      "typeVersion": 1
    },
    {
      "id": "7a157570-3e7d-4584-81a1-1f2502516843",
      "name": "创建 HubSpot 联系人",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1120,
        16
      ],
      "parameters": {
        "operation": "create"
      },
      "typeVersion": 2
    },
    {
      "id": "98170537-d67e-49ee-9819-709a12e29710",
      "name": "通知销售团队 - 高优先级",
      "type": "n8n-nodes-base.slack",
      "position": [
        1120,
        208
      ],
      "webhookId": "364aca1f-ce36-4174-8cbd-9ae11535b690",
      "parameters": {
        "text": "🚨 **High Priority Lead Alert!** 🚨",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $env.SLACK_SALES_CHANNEL_ID }}"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "99245b66-8d64-4b85-b998-892f59b2a2e1",
      "name": "创建 HubSpot 联系人 - 中优先级",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1120,
        400
      ],
      "parameters": {
        "operation": "create"
      },
      "typeVersion": 2
    },
    {
      "id": "e1bc4f06-267e-426a-a064-836b448a4403",
      "name": "便签 - 中优先级行动",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -128
      ],
      "parameters": {
        "width": 392,
        "height": 120,
        "content": "## 中/低优先级行动"
      },
      "typeVersion": 1
    },
    {
      "id": "402a9234-f2c2-483f-81df-32629b306d55",
      "name": "通知营销团队 - 中优先级",
      "type": "n8n-nodes-base.slack",
      "position": [
        1120,
        592
      ],
      "webhookId": "c4c6452c-34e9-4e0c-9fff-4fd93daf81d1",
      "parameters": {
        "text": "📋 New Medium Priority Lead",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $env.SLACK_MARKETING_CHANNEL_ID }}"
        },
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "63d95fd7-f5ac-4192-9f2b-d35bd0fa1d0b",
      "name": "记录无效数据",
      "type": "n8n-nodes-base.noOp",
      "position": [
        224,
        592
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "9fc03270-9915-46ab-a08c-8ff937119a31",
      "name": "便签 - 错误处理",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        -176
      ],
      "parameters": {
        "width": 356,
        "height": 120,
        "content": "## 错误处理"
      },
      "typeVersion": 1
    },
    {
      "id": "a42f2d44-3eaf-4896-bc04-223fe770bc04",
      "name": "便签 - 环境变量",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        320
      ],
      "parameters": {
        "width": 524,
        "height": 480,
        "content": "## 必需的环境变量"
      },
      "typeVersion": 1
    },
    {
      "id": "6ee62c3b-f74a-466b-899d-b61edff40f8f",
      "name": "便签 - 集成点",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        320
      ],
      "parameters": {
        "width": 520,
        "height": 480,
        "content": "## 集成来源"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Enrich with Apollo": {
      "main": [
        [
          {
            "node": "Merge Enrichment Data",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Validate Lead Data": {
      "main": [
        [
          {
            "node": "Enrich with Clearbit",
            "type": "main",
            "index": 0
          },
          {
            "node": "Enrich with Apollo",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log Invalid Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Lead Score": {
      "main": [
        [
          {
            "node": "Route by Qualification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich with Clearbit": {
      "main": [
        [
          {
            "node": "Merge Enrichment Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lead Capture Webhook": {
      "main": [
        [
          {
            "node": "Validate Lead Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Enrichment Data": {
      "main": [
        [
          {
            "node": "Calculate Lead Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Qualification": {
      "main": [
        [
          {
            "node": "Create HubSpot Contact",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notify Sales Team - High Priority",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create HubSpot Contact - Medium",
            "type": "main",
            "index": 0
          },
          {
            "node": "Notify Marketing - Medium Priority",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 潜在客户开发, 多模态 AI

需要付费吗?

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

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

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

作者

Full-stack automation expert combining n8n, frontend & backend development, and hard-coded solutions to build powerful, scalable workflows. Skilled in data parsing (PDF/Excel), API integrations (banking, property, financial), email systems, and real-time sync. I create custom dashboards, API layers, and advanced automations that go beyond “no-code,”

外部链接
在 n8n.io 查看

分享此工作流