8
n8n 中文网amn8n.com

N8N工作流:丰富购买群体

高级

这是一个Lead Generation, Multimodal AI领域的自动化工作流,包含 22 个节点。主要使用 If, Code, Wait, Gmail, Merge 等节点。 使用Surfe和Google表格自动发现和丰富HubSpot购买群体

前置要求
  • Google 账号和 Gmail API 凭证
  • HubSpot API Key
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "F733EtVzETOmrGEZ",
  "meta": {
    "instanceId": "f489a0883a1f92ce260f08ca0188bdcc069cd8b210fc3d72d99be4ac185ace1a",
    "templateCredsSetupCompleted": true
  },
  "name": "N8N 工作流:丰富购买群体",
  "tags": [],
  "nodes": [
    {
      "id": "6b2e276e-50ba-49cf-88a5-2c2a2009d7fd",
      "name": "在公司中搜索人员",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        420,
        -140
      ],
      "parameters": {
        "url": "https://api.surfe.com/v2/people/search",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "jsonBody": "={{ $json }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "K2dwHCUGcjj7cU9W",
          "name": "Bearer Auth account SURFE"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "67317714-fc53-46cb-ae21-d97758e42403",
      "name": "准备JSON负载丰富请求",
      "type": "n8n-nodes-base.code",
      "position": [
        600,
        -140
      ],
      "parameters": {
        "jsCode": "const people = $json.people || [];\n\nreturn [\n  {\n    json: {\n      \"include\": {\n        \"email\": true,\n        \"linkedInUrl\": false,\n        \"mobile\": true,\n        \"jobHistory\": true\n      },\n      \"notificationOptions\": {\n        \"webhookUrl\": \"\"\n      },\n      people: people.map((person) => ({\n        firstName: person.firstName || \"\",\n        lastName: person.lastName || \"\",\n        companyName: person.companyName || \"\",\n        companyDomain: person.companyDomain || \"\",\n        linkedinUrl: person.linkedInUrl || \"\",\n        externalID: `${person.firstName}_${person.lastName}_${person.companyDomain}`.toLowerCase().replace(/[^a-z0-9_]/g, '_')\n      }))\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "cfa2243c-5293-4fb4-ba27-a3b0cc3854e5",
      "name": "Surfe 检查丰富状态",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1000,
        -140
      ],
      "parameters": {
        "url": "=https://api.surfe.com/v2/people/enrich/{{ $json.enrichmentID }}",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "K2dwHCUGcjj7cU9W",
          "name": "Bearer Auth account SURFE"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "c89537af-e8cf-4885-bb2c-624f66ce1c90",
      "name": "丰富是否完成?",
      "type": "n8n-nodes-base.if",
      "position": [
        1220,
        -200
      ],
      "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": "7f42e951-3467-4cc9-9b67-22318486d9ff",
      "name": "等待3秒",
      "type": "n8n-nodes-base.wait",
      "position": [
        1440,
        -40
      ],
      "webhookId": "4e4177c8-a033-4e2b-b2f5-ff6ff514fc9b",
      "parameters": {
        "amount": 3
      },
      "typeVersion": 1.1
    },
    {
      "id": "0b3e3755-a7cb-4386-b7f9-258b56da0e70",
      "name": "从Surfe API响应中提取人员列表",
      "type": "n8n-nodes-base.code",
      "position": [
        1440,
        -260
      ],
      "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.jobHistory[0].jobTitle || '',\n      companyName: person.jobHistory[0].companyName || '',\n      companyWebsite: person.companyDomain || '',\n      linkedinUrl: person.linkedInUrl || '',\n      country: person.country || '',\n      status: person.status || ''\n    }\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "95bd387b-b8e1-40e8-8afc-05c3bffe1fe9",
      "name": "筛选:电话和邮箱",
      "type": "n8n-nodes-base.filter",
      "position": [
        1660,
        -260
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "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": "84ac7743-f3ad-446c-850e-38aa37f26201",
      "name": "HubSpot:创建或更新",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1880,
        -260
      ],
      "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 }}"
        }
      },
      "credentials": {
        "hubspotAppToken": {
          "id": "ED8vy6s9eLCEf1wK",
          "name": "HubSpot App Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "10191a29-ead8-475c-a474-cc41e4bc5654",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "notes": "Notify end of all batches",
      "position": [
        2440,
        -380
      ],
      "webhookId": "8475edad-4074-46f0-b62e-b4ec94fc85b4",
      "parameters": {
        "sendTo": "youdestinationremail@gmail.com",
        "message": "={{ $json.message }}",
        "options": {},
        "subject": "={{ $json.subject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "vVbFUp4uEh0hPH7S",
          "name": "Gmail account"
        }
      },
      "executeOnce": true,
      "notesInFlow": true,
      "typeVersion": 2.1
    },
    {
      "id": "da732754-774e-4f67-9c1a-ad11de4d7642",
      "name": "当点击“执行工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1020,
        -1420
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "89e4325b-ac54-4e16-b13a-8cacc4a1b986",
      "name": "准备人员搜索的JSON负载",
      "type": "n8n-nodes-base.code",
      "position": [
        220,
        -140
      ],
      "parameters": {
        "jsCode": "// Récupère tous les items entrants\nconst allItems = $items();\n\n// Sépare les items du sheet et celui avec companyDomains\nconst sheetItems = allItems.filter(i =>\n  i.json.departments || i.json.jobTitles || i.json.seniorities || i.json.countries\n);\nconst domainItems = allItems.filter(i => i.json.companyDomains);\n\n// Helper : extrait, splitte, déduplique et nettoie\nfunction extractList(items, fieldName) {\n  const raw = items.flatMap(item => {\n    const v = item.json[fieldName];\n    if (!v) return [];\n    if (typeof v === 'string' && v.includes(',')) {\n      return v.split(',').map(s => s.trim()).filter(Boolean);\n    }\n    return [v];\n  });\n  // déduplique puis enlève les valeurs falsy\n  return [...new Set(raw)].filter(Boolean);\n}\n\nconst departments = extractList(sheetItems, 'departments');\nconst jobTitles = extractList(sheetItems, 'jobTitles');\nconst seniorities = extractList(sheetItems, 'seniorities');\nconst countries = extractList(sheetItems, 'countries');\n\n// Récupère et déduplique les companyDomains\nconst companyDomains = [...new Set(\n  domainItems.flatMap(i => {\n    const cd = i.json.companyDomains;\n    if (!cd) return [];\n    if (Array.isArray(cd)) return cd;\n    if (typeof cd === 'string') return [cd];\n    return [];\n  })\n)].filter(Boolean);\n\n// Payload final\nreturn {\n  companies: {\n    domains: companyDomains\n  },\n  people: {\n    departments,\n    jobTitles,\n    seniorities,\n    countries\n  },\n  limit: 200\n};\n"
      },
      "typeVersion": 2
    },
    {
      "id": "8e0d64d3-f7fa-4798-bb2d-fc795aec89f3",
      "name": "HubSpot 触发器",
      "type": "n8n-nodes-base.hubspotTrigger",
      "position": [
        -800,
        -260
      ],
      "webhookId": "6b49bfad-34fc-4790-b88f-8e6779704676",
      "parameters": {
        "eventsUi": {
          "eventValues": [
            {
              "name": "deal.creation"
            }
          ]
        },
        "additionalFields": {}
      },
      "credentials": {
        "hubspotDeveloperApi": {
          "id": "rdfe6pDYMZmB27UJ",
          "name": "HubSpot Developer account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e2fcd474-0ba0-4263-bc50-01218f381087",
      "name": "从HUBSPOT获取交易关联公司",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -580,
        -160
      ],
      "parameters": {
        "url": "=https://api.hubapi.com/crm/v3/objects/deals/{{ $json.dealId }}/associations/companies",
        "options": {},
        "sendBody": true,
        "sendHeaders": true,
        "authentication": "predefinedCredentialType",
        "bodyParameters": {
          "parameters": [
            {}
          ]
        },
        "headerParameters": {
          "parameters": [
            {}
          ]
        },
        "nodeCredentialType": "hubspotOAuth2Api"
      },
      "credentials": {
        "hubspotOAuth2Api": {
          "id": "HGorw8YjfR5aMHl8",
          "name": "HubSpot account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "afc19dae-6364-48a0-8d3a-839b6010b275",
      "name": "提取公司域名",
      "type": "n8n-nodes-base.code",
      "position": [
        -180,
        -60
      ],
      "parameters": {
        "jsCode": "const company_domains = $input.all().map(item => {\n  const domain = item.json.properties.domain.value || \"\";\n  return domain;\n}).filter(Boolean); // enlève les null ou undefined\n\nreturn {json: { companyDomains: company_domains }}"
      },
      "typeVersion": 2
    },
    {
      "id": "eceb53ea-4260-43fb-b868-91c2e612b116",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        40,
        -160
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "8c8c2ce7-9e61-400a-a160-7f68fb25b23c",
      "name": "合并1",
      "type": "n8n-nodes-base.merge",
      "position": [
        2080,
        -380
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "b71396c0-1063-409b-a9a5-060cad8e614c",
      "name": "Surfe 批量丰富API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        760,
        -140
      ],
      "parameters": {
        "url": "https://api.surfe.com/v2/people/enrich",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "jsonBody": "={{ $json }}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "K2dwHCUGcjj7cU9W",
          "name": "Bearer Auth account SURFE"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "8a53937f-de3e-4a45-bd9f-3f9e9aac0ea6",
      "name": "HubSpot 获取交易",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        -580,
        -500
      ],
      "parameters": {
        "dealId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.dealId }}"
        },
        "filters": {},
        "resource": "deal",
        "operation": "get",
        "authentication": "appToken"
      },
      "credentials": {
        "hubspotAppToken": {
          "id": "ED8vy6s9eLCEf1wK",
          "name": "HubSpot App Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "7f6ea675-401d-4468-adbc-b56babb6395d",
      "name": "HubSpot 获取公司",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        -400,
        -160
      ],
      "parameters": {
        "resource": "company",
        "companyId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.results[0].id }}"
        },
        "operation": "get",
        "authentication": "appToken",
        "additionalFields": {}
      },
      "credentials": {
        "hubspotAppToken": {
          "id": "ED8vy6s9eLCEf1wK",
          "name": "HubSpot App Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "03d94462-b78d-4103-8079-b209753fde84",
      "name": "Google Sheets 读取条件",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -180,
        -300
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1KHmosQpcC9MU7Nt2kUn9G_k0N04-VftOoiXrryV_-kU/edit#gid=0",
          "cachedResultName": "Your Buying Group Criterias"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/1KHmosQpcC9MU7Nt2kUn9G_k0N04-VftOoiXrryV_-kU"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "Uuk3Gi9SCdzAMJ6R",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "954456ba-5a82-4c72-a492-fd50a3e5c420",
      "name": "提取交易信息",
      "type": "n8n-nodes-base.code",
      "position": [
        1880,
        -480
      ],
      "parameters": {
        "jsCode": "const deal = items[0].json;\nconst portalId = deal.portalId;\nconst dealId = deal.dealId ?? deal.deal?.id ?? deal.deal?.dealId ?? null;\nconst dealName = deal.properties?.dealname?.value ?? '';\n\nreturn [\n  {\n    json: {\n      portalId,\n      dealId,\n      dealName,\n    },\n  },\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "a5aadafa-086f-4f84-af92-557347eb35a6",
      "name": "准备邮件内容",
      "type": "n8n-nodes-base.code",
      "position": [
        2260,
        -380
      ],
      "parameters": {
        "jsCode": "// --- Assume first item is the trigger, rest are contact items ---\nconst trigger = items[0]?.json || {};\nconst contactItems = items.slice(1);\n\n// --- Extract deal and portal info from trigger ---\nconst portalId = trigger.portalId ?? trigger[\"portal-id\"] ?? (() => {\n  // fallback: try to grab from a contact if trigger lacks it\n  const fallback = contactItems.find(i => i.json?.properties?.hs_object_source_id?.value);\n  return fallback?.json?.properties?.hs_object_source_id?.value || '';\n})();\nconst dealName = trigger.dealName\nconst dealId = trigger.dealId ?? trigger.deal?.id ?? trigger.deal?.dealId ?? null;\n\nfunction buildDealLink(portalId, dealId) {\n  return `https://app.hubspot.com/contacts/${portalId}/record/0-3/${dealId}`;\n}\nconst dealLink = portalId && dealId ? buildDealLink(portalId, dealId) : '';\n\n// --- Buying group criteria and company domain (fallback) ---\nconst buyingGroupCriteria = trigger.buyingGroupCriteria || 'your buying group criteria';\n\nlet companyDomain = trigger.companyDomain || '';\nif (!companyDomain) {\n  // infer from first available contact email\n  const someContact = contactItems.find(i => i.json.searchPerson?.email || i.json.properties?.email?.value);\n  const emailStr = (someContact?.json.searchPerson?.email || someContact?.json.properties?.email?.value || '').trim();\n  if (emailStr.includes('@')) {\n    companyDomain = emailStr.split('@')[1];\n  }\n}\nif (!companyDomain) companyDomain = '(unknown domain)';\n\n// --- Normalize contacts (no job title) ---\nconst contacts = contactItems.map(item => {\n  const props = item.json.properties || {};\n  const search = item.json.searchPerson || {};\n\n  const firstName = search.firstName || props.firstname?.value || '';\n  const lastName = search.lastName || props.lastname?.value || '';\n  const email = search.email || props.email?.value || '';\n  const phone = props.phone?.value || '';\n  const companyName = props.company?.value || '';\n  const jobTitle = props.jobtitle?.value || '';\n\n  \n  const vid = item.json.vid || item.json[\"hs_object_id\"] || '';\n\n  return { vid, firstName, lastName, email, phone, companyName, jobTitle };\n});\n\n// --- Build HTML table rows ---\nconst rowsHtml = contacts.map(c => {\n  const fullName = `${c.firstName} ${c.lastName}`.trim() || '(no name)';\n  const emailCell  = c.email  ? `<a href=\"mailto:${c.email}\">${c.email}</a>` : '—';\n  const phoneCell  = c.phone  ? `<a href=\"tel:${c.phone}\">${c.phone}</a>`   : '—';\n  const jobTitleCell   = c.jobTitle   || '—';\n  const companyCell    = c.companyName|| '—';\n  const contactHubspotUrl = portalId\n    ? `https://app.hubspot.com/contacts/${portalId}/record/0-1/${c.vid}`\n    : '#';\n  const hubspotCell = `<a href=\"${contactHubspotUrl}\" target=\"_blank\">View in HubSpot</a>`;\n\n  return `\n    <tr>\n      <td style=\"padding:6px;border:1px solid #ccc;\">${fullName}</td>\n      <td style=\"padding:6px;border:1px solid #ccc;\">${jobTitleCell}</td>\n      <td style=\"padding:6px;border:1px solid #ccc;\">${companyCell}</td>\n      <td style=\"padding:6px;border:1px solid #ccc;\">${emailCell}</td>\n      <td style=\"padding:6px;border:1px solid #ccc;\">${phoneCell}</td>\n      <td style=\"padding:6px;border:1px solid #ccc;\">${hubspotCell}</td>\n    </tr>\n  `;\n}).join('');\n\n// --- Compose HTML email with hidden preheader ---\nconst htmlMessage = `\n  <!DOCTYPE html>\n  <html>\n    <body style=\"font-family: system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif; line-height:1.4; color:#1f2937; padding:0; margin:0;\">\n      <div style=\"max-width:800px; margin:0 auto; padding:20px;\">\n        <!-- Hidden preheader for inbox preview -->\n        <div style=\"display:none;font-size:1px;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;\">\n          Contacts enriched based on your buying group criteria and domain—see direct links.\n        </div>\n\n        <p>Hi Team,</p>\n\n        <p>\n          Following the creation of the <a href=\"${dealLink}\" target=\"_blank\">HubSpot deal</a> <strong>${dealName}</strong>., here are the contacts we enriched and pushed into HubSpot based on ${buyingGroupCriteria} and the company domain <strong>${companyDomain}</strong>.\n        </p>\n\n        <p>\n          <strong>Total contacts processed:</strong> ${contacts.length}\n          ${dealLink ? `<br/><strong>Deal link:</strong> <a href=\"${dealLink}\" target=\"_blank\">View deal in HubSpot</a>` : ''}\n        </p>\n\n        <table style=\"width:100%; border-collapse:collapse; margin-top:10px; margin-bottom:20px;\">\n          <thead>\n            <tr>\n              <th style=\"padding:8px; border:1px solid #d1d5db; text-align:left; background:#f3f4f6;\">Name</th>\n              <th style=\"padding:8px; border:1px solid #d1d5db; text-align:left; background:#f3f4f6;\">Job Title</th>\n              <th style=\"padding:8px; border:1px solid #d1d5db; text-align:left; background:#f3f4f6;\">Company</th>\n              <th style=\"padding:8px; border:1px solid #d1d5db; text-align:left; background:#f3f4f6;\">Email</th>\n              <th style=\"padding:8px; border:1px solid #d1d5db; text-align:left; background:#f3f4f6;\">Phone</th>\n              <th style=\"padding:8px; border:1px solid #d1d5db; text-align:left; background:#f3f4f6;\">HubSpot</th>\n            </tr>\n          </thead>\n          <tbody>\n            ${rowsHtml}\n          </tbody>\n        </table>\n\n        <p>Best regards,<br/>\n        Enrichment Workflow Bot</p>\n      </div>\n    </body>\n  </html>\n`;\n\n// --- Compose plain-text fallback ---\nconst plainRows = contacts.map(c => {\n  const fullName = `${c.firstName} ${c.lastName}`.trim() || '(no name)';\n  const email = c.email || '—';\n  const phone = c.phone || '—';\n  const contactHubspotUrl = portalId ? `https://app.hubspot.com/contacts/${portalId}/record/0-1/${c.vid}` : '';\n  return `- ${fullName} | ${email} | ${phone} | ${contactHubspotUrl}`;\n}).join('\\n');\n\nconst textMessage = `\nHi Team,\n\nFollowing the creation of the HubSpot deal${dealId ? ` (ID: ${dealId})` : ''}, here are the contacts we enriched and pushed into HubSpot based on ${buyingGroupCriteria} and the company domain ${companyDomain}.\n\nTotal contacts processed: ${contacts.length}\n\nContacts:\n${plainRows}\n\nBest regards,\nSurfe Enrichment Workflow Bot\n`;\n\n// --- Output for Gmail node (no 'to' field) ---\nreturn [\n  {\n    json: {\n      subject: 'New Enriched Contacts Added to Your HubSpot Deal',\n      message: htmlMessage,\n      text: textMessage,\n    },\n  },\n];\n"
      },
      "typeVersion": 2
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "7b22080a-3b54-4dca-b824-6268946be489",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "prepare JSON PAYLAOD for Person Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "prepare email content",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot Trigger": {
      "main": [
        [
          {
            "node": "GET deal associated companies from HUBSPOT",
            "type": "main",
            "index": 0
          },
          {
            "node": "HubSpot get deal",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 3 secondes": {
      "main": [
        [
          {
            "node": "Surfe check enrichement status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot get deal": {
      "main": [
        [
          {
            "node": "extract deal info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract deal info": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot Get Company": {
      "main": [
        [
          {
            "node": "Google Sheets READ CRITERIAS",
            "type": "main",
            "index": 0
          },
          {
            "node": "extract companyDomains",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "prepare email content": {
      "main": [
        [
          {
            "node": "Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract companyDomains": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "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 3 secondes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot: Create or Update": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Search People in Companies": {
      "main": [
        [
          {
            "node": "Prepare JSON Payload Enrichment Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Surfe Bulk Enrichments API": {
      "main": [
        [
          {
            "node": "Surfe check enrichement status",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets READ CRITERIAS": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Surfe check enrichement status": {
      "main": [
        [
          {
            "node": "Is enrichment complete ?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        []
      ]
    },
    "prepare JSON PAYLAOD for Person Search": {
      "main": [
        [
          {
            "node": "Search People in Companies",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare JSON Payload Enrichment Request": {
      "main": [
        [
          {
            "node": "Surfe Bulk Enrichments API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GET deal associated companies from HUBSPOT": {
      "main": [
        [
          {
            "node": "HubSpot Get Company",
            "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 导入」,粘贴配置后根据需要修改凭证设置即可。

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

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

需要付费吗?

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

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

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

作者
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 查看

分享此工作流