8
n8n 中文网amn8n.com

Hubspot -> Salesforce - 最终版

中级

这是一个Sales, AI领域的自动化工作流,包含 11 个节点。主要使用 Code, Merge, Filter, Hubspot, Salesforce 等节点,结合人工智能技术实现智能自动化。 使用Explorium.ai从HubSpot到Salesforce自动化联系人信息丰富

前置要求
  • HubSpot API Key
  • Salesforce OAuth 凭证
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "A1ANYPPCR58x29nH",
  "meta": {
    "instanceId": "0a70652f43c1b29dd16c35b61a38fd31c8004f58bc7e723bf43262a797407c77",
    "templateCredsSetupCompleted": true
  },
  "name": "Hubspot -> Salesforce - 最终版",
  "tags": [],
  "nodes": [
    {
      "id": "306813bf-056d-48fc-ba8b-e64ddb01beda",
      "name": "匹配潜在客户",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1820,
        360
      ],
      "parameters": {
        "url": "https://api.explorium.ai/v1/prospects/match",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"prospects_to_match\": [\n    {\n      \"full_name\": \"{{ ($json.properties.firstname.value || '') + ' ' + ($json.properties.lastname.value || '') }}\",\n      \"company_name\": \"{{ ($json.properties.company.value || '').trim() }}\",\n      \"email\": \"{{ $json['identity-profiles'][0].identities.find(id => id.type === 'EMAIL').value }}\"\n    }\n  ]\n}",
        "sendBody": true,
        "jsonHeaders": "{\n  \"Content-Type\": \"application/json\",\n  \"Accept\": \"application/json\"\n}",
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "specifyHeaders": "json",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "85mkGmNNdK1951hF",
          "name": "Header Auth Connection"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "08e9aa3a-6957-4f88-9ad7-f492652046e4",
      "name": "从匹配结果中提取潜在客户 ID",
      "type": "n8n-nodes-base.code",
      "position": [
        -1380,
        360
      ],
      "parameters": {
        "jsCode": "const allItems = $input.all();\nconst prospectIds = allItems.map(item => \n  item.json.matched_prospects.map(prospect => prospect.prospect_id)\n).flat();\n\nreturn [{\n  json: {\n    prospect_ids: prospectIds\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "e786a130-996c-414a-b87c-aec3a61a960e",
      "name": "Explorium 丰富联系人信息",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1160,
        260
      ],
      "parameters": {
        "url": "https://api.explorium.ai/v1/prospects/contacts_information/bulk_enrich",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"prospect_ids\": $json.prospect_ids } }}",
        "sendBody": true,
        "jsonHeaders": "{\n  \"Content-Type\": \"application/json\",\n  \"Accept\": \"application/json\"\n}",
        "sendHeaders": true,
        "specifyBody": "=json",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {}
          ]
        },
        "specifyHeaders": "json",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "85mkGmNNdK1951hF",
          "name": "Header Auth Connection"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "205c6a21-e0fd-4963-aacf-8498eba0e838",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        -940,
        360
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "fieldsToMatchString": "data[0].prospect_id"
      },
      "typeVersion": 3.1
    },
    {
      "id": "faa070fd-841b-460c-b25f-0e3bed266f17",
      "name": "HubSpot 触发器",
      "type": "n8n-nodes-base.hubspotTrigger",
      "position": [
        -2260,
        360
      ],
      "webhookId": "d359fd68-9568-4787-93dd-192be0fda279",
      "parameters": {
        "eventsUi": {
          "eventValues": [
            {}
          ]
        },
        "additionalFields": {}
      },
      "credentials": {
        "hubspotDeveloperApi": {
          "id": "MpQJKDhz8ijUUHzc",
          "name": "HubSpot Developer account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "76b419d5-f31d-4657-8157-a26d83564b2d",
      "name": "HubSpot",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        -2040,
        360
      ],
      "parameters": {
        "contactId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $input.item.json.contactId }}"
        },
        "operation": "get",
        "authentication": "appToken",
        "additionalFields": {}
      },
      "credentials": {
        "hubspotAppToken": {
          "id": "cBozD4139iWohcJ2",
          "name": "HubSpot App Token account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "17e5e938-690b-41f0-b9b1-10981f109f20",
      "name": "Salesforce",
      "type": "n8n-nodes-base.salesforce",
      "position": [
        -500,
        360
      ],
      "parameters": {
        "company": "={{ $json.experience[0].company.name }}",
        "lastname": "={{ $json.full_name }}",
        "additionalFields": {
          "city": "={{ $json.city || null }}",
          "email": "={{ $json.professions_email || null }}",
          "phone": "={{ $json.phone_numbers?.[0]?.phone_number || \"null\" }}\n",
          "state": "={{ $json.region_name || '' }}",
          "title": "={{ $json.experience?.[0]?.title?.name || null }}",
          "country": "={{ $json.country_name || null }}",
          "website": "={{ $json.experience?.[0]?.company?.website || null }}",
          "mobilePhone": "={{ $json.mobile_phone }}"
        }
      },
      "credentials": {
        "salesforceOAuth2Api": {
          "id": "unhmsSbB64eNwCMO",
          "name": "Salesforce account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "53699185-4fe8-4add-8b6f-4825e481dcf3",
      "name": "代码 - 扁平化",
      "type": "n8n-nodes-base.code",
      "position": [
        -720,
        360
      ],
      "parameters": {
        "jsCode": "return $input.all().map(item => \n    item.json.data.map(prospect => ({\n      prospect_id: prospect.prospect_id,\n      ...prospect.data\n    }))\n  ).flat()"
      },
      "typeVersion": 2
    },
    {
      "id": "a39d10c7-e80e-4493-a555-f1fe36216c59",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3320,
        80
      ],
      "parameters": {
        "width": 960,
        "height": 2800,
        "content": "# 使用 Explorium 自动丰富来自 HubSpot 的潜在客户数据并在 Salesforce 中创建线索"
      },
      "typeVersion": 1
    },
    {
      "id": "60f1e6d3-7bbe-435a-85af-59c79f81aa5f",
      "name": "过滤器 - 未匹配",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1600,
        360
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6896e951-8d66-41b1-87a5-a96d2e049675",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.matched_prospects.some(prospect => prospect.prospect_id !== null).toBoolean() }}",
              "rightValue": "null"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "459bb55b-663d-4913-b11a-b3be6b16de06",
      "name": "Explorium 丰富资料",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1160,
        460
      ],
      "parameters": {
        "url": "https://api.explorium.ai/v1/prospects/profiles/bulk_enrich",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ { \"prospect_ids\": $json.prospect_ids } }}",
        "sendBody": true,
        "jsonHeaders": "{\n  \"Content-Type\": \"application/json\",\n  \"Accept\": \"application/json\"\n}",
        "sendHeaders": true,
        "specifyBody": "=json",
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {}
          ]
        },
        "specifyHeaders": "json",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "id": "85mkGmNNdK1951hF",
          "name": "Header Auth Connection"
        }
      },
      "typeVersion": 4.2
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d2824b55-3ef6-41ac-a550-ef8701401167",
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Code - flatten",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot": {
      "main": [
        [
          {
            "node": "Match_prospect",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - flatten": {
      "main": [
        [
          {
            "node": "Salesforce",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Match_prospect": {
      "main": [
        [
          {
            "node": "Filter - non matched",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot Trigger": {
      "main": [
        [
          {
            "node": "HubSpot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter - non matched": {
      "main": [
        [
          {
            "node": "Extract Prospect IDs from Matched Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Explorium Enrich Profiles": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Explorium Enrich Contacts Information": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Prospect IDs from Matched Results": {
      "main": [
        [
          {
            "node": "Explorium Enrich Contacts Information",
            "type": "main",
            "index": 0
          },
          {
            "node": "Explorium Enrich Profiles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 销售, 人工智能

需要付费吗?

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

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

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

作者
explorium

explorium

@explorium

Explorium empowers businesses to build high-performance GTM agents with specialized data infrastructure. Our seamless API integrations and high-quality data drive faster agent development and better results. With years of experience and robust data sets, we deliver context-aware solutions, helping AI agents achieve human-level support. Explorium is the essential data partner for teams building agent-driven technologies.

外部链接
在 n8n.io 查看

分享此工作流