Salesforceと2件の潜在顧客リッチング - 最終版
これはSales, AI分野の自動化ワークフローで、10個のノードを含みます。主にCode, Merge, Filter, Salesforce, HttpRequestなどのノードを使用、AI技術を活用したスマート自動化を実現。 AIによるリード強化の自動化:SalesforceからExploriumで強化されたリードデータを取得
- •Salesforce OAuth認証情報
- •ターゲットAPIの認証情報が必要な場合あり
{
"id": "u92uqa8glb0TuCG9",
"meta": {
"instanceId": "0a70652f43c1b29dd16c35b61a38fd31c8004f58bc7e723bf43262a797407c77",
"templateCredsSetupCompleted": true
},
"name": "Salesforce with 2 prospect enrichments - final",
"tags": [],
"nodes": [
{
"id": "70a40c85-eb5d-41b0-96ab-11ba442189c8",
"name": "Salesforce Trigger",
"type": "n8n-nodes-base.salesforceTrigger",
"position": [
-1880,
680
],
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "leadCreated"
},
"credentials": {
"salesforceOAuth2Api": {
"id": "unhmsSbB64eNwCMO",
"name": "Salesforce account"
}
},
"typeVersion": 1
},
{
"id": "b16d1538-753a-405f-884c-c05dd1076c15",
"name": "リード更新",
"type": "n8n-nodes-base.salesforce",
"position": [
-340,
680
],
"parameters": {
"leadId": "={{ $('Salesforce Trigger').item.json.Id}}",
"operation": "update",
"updateFields": {
"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 }}",
"company": "={{ $json.company_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": "5417925f-919e-4c44-ba21-9249cab895eb",
"name": "見込み客マッチング",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1660,
680
],
"parameters": {
"url": "https://api.explorium.ai/v1/prospects/match",
"method": "POST",
"options": {},
"jsonBody": "={\n \"prospects_to_match\": [\n {\n \"full_name\": \"{{ $('Salesforce Trigger').item.json.FirstName }} {{ $('Salesforce Trigger').item.json.LastName }}\",\n \"company_name\": \"{{ $('Salesforce Trigger').item.json.Company }}\"\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": "360ca1d3-c1e6-46f4-b190-ddf76ed8847b",
"name": "マッチ結果からの見込み客ID抽出",
"type": "n8n-nodes-base.code",
"position": [
-1220,
680
],
"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": "aa419a45-dae1-47b0-8030-5fe0e193f804",
"name": "Explorium コンタクト情報エンリッチメント",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1000,
580
],
"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": "91bfa198-cecf-406f-94d8-1433a75e0ada",
"name": "マージ",
"type": "n8n-nodes-base.merge",
"position": [
-780,
680
],
"parameters": {
"mode": "combine",
"options": {},
"fieldsToMatchString": "data[0].prospect_id"
},
"typeVersion": 3.1
},
{
"id": "7d7866ec-8839-48c4-9dd7-239844dfb207",
"name": "非マッチのフィルタリング",
"type": "n8n-nodes-base.filter",
"position": [
-1440,
680
],
"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": "b67d5f83-2ba9-4c78-84ff-0a94382788f8",
"name": "コード - フラット化",
"type": "n8n-nodes-base.code",
"position": [
-560,
680
],
"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": "96abf132-7d7e-4e91-89da-5f0b373385a9",
"name": "Explorium プロファイルエンリッチメント",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1000,
780
],
"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
},
{
"id": "6c17ea6e-165f-407a-b4c9-8731d44243f8",
"name": "付箋",
"type": "n8n-nodes-base.stickyNote",
"position": [
-2760,
480
],
"parameters": {
"width": 760,
"height": 2720,
"content": "# Automatically enrich leads in Salesforce using Explorium MCP\n\nThis n8n workflow streamlines the process of enriching lead information by automatically detecting new leads created in Salesforce, processing them through Explorium's AI-powered tools, and updating the same leads back in Salesforce with enhanced prospect details.\n\n## Credentials Required\n\nTo use this workflow, set up the following credentials in your n8n environment:\n\n### Salesforce\n- **Type**: OAuth2 or Username/Password\n- **Used for**: triggering on new leads, updating lead records\n\n### Explorium API\n- **Type**: Generic Header Auth\n- **Header**: Authorization\n- **Value**: Bearer YOUR_API_KEY\n\nGo to Settings → Credentials, create these two credentials, and assign them in the respective nodes before running the workflow.\n\n## Workflow Overview\n\n### Node 1: Salesforce Trigger\nThis node listens for real-time events from the connected Salesforce account, specifically monitoring for new lead creation events.\n\n- **Event**: leadCreated\n- **Trigger Type**: Real-time webhook\n\nOnce triggered, the node passes metadata about the newly created lead to the next step in the flow.\n\n### Node 2: Match_prospect\nThis node sends the lead's data to Explorium's AI-powered prospect matching API in real time.\n\n- **Method**: POST\n- **Endpoint**: https://api.explorium.ai/v1/prospects/match\n- **Authentication**: Generic Header Auth (using a configured credential)\n- **Headers**: Content-Type: application/json\n\nThe request body is dynamically built from lead data, typically including: full_name, company_name, email, phone_number, linkedin. These fields are matched against Explorium's intelligence graph to return enriched or validated profiles.\n\n**Response Output**: total_matches, matched_prospects, and a prospect_id. Each response is used downstream to enrich and update lead information.\n\n### Node 3: Filter non-matched\nThis node filters the output from the Match_prospect step to ensure that only valid, matched results continue in the flow. Only records that contain at least one matched prospect with a non-null prospect_id are passed forward.\n\n**Filter Logic**: Keeps only leads that have successful prospect matches from Explorium\n\n### Node 4: Extract Prospect IDs from Matched Results\nThis node extracts all valid prospect_id values from previously matched prospects and compiles them into a flat array. It loops over all matched items, extracts each prospect_id from the matched_prospects array and returns a single object with an array of all prospect_ids.\n\n### Node 5: Explorium Enrich Contacts Information\nThis node performs bulk enrichment of contacts by querying Explorium with a list of matched prospect_ids.\n\n**Node Configuration:**\n- **Method**: POST\n- **Endpoint**: https://api.explorium.ai/v1/prospects/contacts_information/bulk_enrich\n- **Authentication**: Header Auth (using saved credentials)\n- **Headers**: \"Content-Type\": \"application/json\", \"Accept\": \"application/json\"\n\nReturns enriched contact information, such as:\n- **emails**: professional/personal email addresses\n- **phone_numbers**: mobile and work numbers\n- **professions_email**, **professional_email_status**, **mobile_phone**\n\n### Node 6: Explorium Enrich Profiles\nThis additional enrichment node provides supplementary contact data enhancement, running in parallel with the primary enrichment process to maximize data collection from different Explorium endpoints.\n\n### Node 7: Merge\nThis node combines multiple data streams from the parallel enrichment processes into a single output, allowing you to consolidate data from different Explorium enrichment endpoints. The \"combine\" setting indicates it will merge the incoming data streams rather than overwriting them.\n\n### Node 8: Code - flatten\nThis custom code node processes and transforms the merged enrichment data before updating the Salesforce lead. It can be used to:\n- Flatten nested data structures from Explorium responses\n- Format data according to Salesforce field requirements\n- Apply business logic or data validation\n- Map Explorium fields to Salesforce lead properties\n- Handle data type conversions and null values\n\n### Node 9: Update Lead\nThis final node updates the original lead in Salesforce using the enriched data returned by Explorium.\n\n- **Credential**: Salesforce OAuth2 or Username/Password\n- **Resource**: Lead\n- **Operation**: Update Lead\n\nThe node updates the existing lead record with enriched information including additional contact details, professional data, and enhanced company information obtained through the Explorium enrichment process.\n\n## Workflow Flow Summary\n\n1. **Trigger**: Salesforce webhook triggers on new lead creation\n2. **Match**: Find prospect matches using Explorium based on lead data\n3. **Filter**: Keep only successfully matched prospects\n4. **Extract**: Compile prospect IDs for bulk enrichment\n5. **Enrich**: Parallel enrichment of contact information through multiple Explorium endpoints\n6. **Merge**: Combine enrichment results into unified data\n7. **Transform**: Flatten and prepare data for Salesforce update (Code node)\n8. **Update**: Update the original lead record in Salesforce with enriched data\n\nThis workflow ensures comprehensive lead enrichment while maintaining data quality and providing seamless integration within your Salesforce environment. The parallel enrichment structure maximizes data collection efficiency, and the filtering ensures only high-quality matches are processed, resulting in enhanced lead records with valuable prospect intelligence."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {
"Salesforce Trigger": [
{
"json": {
"Id": "00QQJ00000I7no12AB",
"City": null,
"Email": "vincent.marinelli@flushingsavings.com",
"Status": "New",
"Street": null,
"Company": "flushingsavings",
"LastName": "marinelli",
"FirstName": "vincent",
"PostalCode": null,
"attributes": {
"url": "/services/data/v59.0/sobjects/Lead/00QQJ00000I7no12AB",
"type": "Lead"
}
}
}
]
},
"settings": {
"executionOrder": "v1"
},
"versionId": "c8a79ca0-36ce-443f-b6fc-21bfa6ade38c",
"connections": {
"91bfa198-cecf-406f-94d8-1433a75e0ada": {
"main": [
[
{
"node": "b67d5f83-2ba9-4c78-84ff-0a94382788f8",
"type": "main",
"index": 0
}
]
]
},
"b16d1538-753a-405f-884c-c05dd1076c15": {
"main": [
[]
]
},
"b67d5f83-2ba9-4c78-84ff-0a94382788f8": {
"main": [
[
{
"node": "b16d1538-753a-405f-884c-c05dd1076c15",
"type": "main",
"index": 0
}
]
]
},
"5417925f-919e-4c44-ba21-9249cab895eb": {
"main": [
[
{
"node": "7d7866ec-8839-48c4-9dd7-239844dfb207",
"type": "main",
"index": 0
}
]
]
},
"7d7866ec-8839-48c4-9dd7-239844dfb207": {
"main": [
[
{
"node": "360ca1d3-c1e6-46f4-b190-ddf76ed8847b",
"type": "main",
"index": 0
}
]
]
},
"70a40c85-eb5d-41b0-96ab-11ba442189c8": {
"main": [
[
{
"node": "5417925f-919e-4c44-ba21-9249cab895eb",
"type": "main",
"index": 0
}
]
]
},
"96abf132-7d7e-4e91-89da-5f0b373385a9": {
"main": [
[
{
"node": "91bfa198-cecf-406f-94d8-1433a75e0ada",
"type": "main",
"index": 1
}
]
]
},
"aa419a45-dae1-47b0-8030-5fe0e193f804": {
"main": [
[
{
"node": "91bfa198-cecf-406f-94d8-1433a75e0ada",
"type": "main",
"index": 0
}
]
]
},
"360ca1d3-c1e6-46f4-b190-ddf76ed8847b": {
"main": [
[
{
"node": "aa419a45-dae1-47b0-8030-5fe0e193f804",
"type": "main",
"index": 0
},
{
"node": "96abf132-7d7e-4e91-89da-5f0b373385a9",
"type": "main",
"index": 0
}
]
]
}
}
}このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級 - 営業, 人工知能
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
explorium
@exploriumExplorium 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.
このワークフローを共有