AutomationFlowsCRM & Sales › Automate Hubspot to Salesforce Lead Creation with Explorium AI Enrichment

Automate Hubspot to Salesforce Lead Creation with Explorium AI Enrichment

Byexplorium @explorium on n8n.io

This n8n workflow streamlines the process of enriching prospect information by automatically pulling data from HubSpot, processing it through Explorium's AI-powered tools, and creating new leads in Salesforce with enhanced prospect details.

Event trigger★★★★☆ complexity9 nodesHubSpot TriggerHubSpotSalesforce@Exploriumai/N8N Nodes Explorium Ai
CRM & Sales Trigger: Event Nodes: 9 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #4836 — we link there as the canonical source.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "PLHHBno91TpLuxJXX6QS8",
  "name": "HubSpot to Salesforce Lead Creation with Explorium AI Enrichment",
  "tags": [],
  "nodes": [
    {
      "id": "0f824fbe-38c5-4dc6-9f2f-49f3309c0a29",
      "name": "Extract Prospect IDs from Matched Results",
      "type": "n8n-nodes-base.code",
      "position": [
        1968,
        288
      ],
      "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": "1abf84ba-5804-4505-bd93-afaedc483a50",
      "name": "HubSpot Trigger",
      "type": "n8n-nodes-base.hubspotTrigger",
      "position": [
        1072,
        288
      ],
      "parameters": {
        "eventsUi": {
          "eventValues": [
            {}
          ]
        },
        "additionalFields": {}
      },
      "typeVersion": 1
    },
    {
      "id": "bbaa722f-38fa-425c-a873-d8cd61fe5c7d",
      "name": "HubSpot",
      "type": "n8n-nodes-base.hubspot",
      "position": [
        1296,
        288
      ],
      "parameters": {
        "contactId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.contactId }}"
        },
        "operation": "get",
        "authentication": "oAuth2",
        "additionalFields": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "a403dba4-f8c2-46e3-a0f2-9916866c2e13",
      "name": "Salesforce",
      "type": "n8n-nodes-base.salesforce",
      "position": [
        2640,
        288
      ],
      "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 }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "aadc0691-8a91-49a6-abf2-1f5489fb3b9d",
      "name": "Code - flatten",
      "type": "n8n-nodes-base.code",
      "position": [
        2416,
        288
      ],
      "parameters": {
        "jsCode": "const items = [];\n\nfor (const item of $input.all()) {\n  if (item.json.enriched_data && item.json.enriched_data.length > 0) {\n    items.push({\n      json: {\n        prospect_id: item.json.enriched_data[0].prospect_id,\n        ...item.json.enriched_data[0].data\n      }\n    });\n  }\n}\n\nreturn items;"
      },
      "typeVersion": 2
    },
    {
      "id": "b9cd8c39-8d3d-4daf-ab6d-ef892c908490",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 960,
        "height": 2800,
        "content": "# Automatically enrich prospect data from HubSpot using Explorium and create leads in Salesforce\n\nThis n8n workflow streamlines the process of enriching prospect information by automatically pulling data from HubSpot, processing it through Explorium's AI-powered tools, and creating new leads 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### HubSpot\n- **Type**: App Token (or OAuth2 for broader compatibility)\n- **Used for**: triggering on new contacts, fetching contact data\n\n### Explorium API\n- **Type**: Generic Header Auth\n- **Header**: Authorization\n- **Value**: Bearer YOUR_API_KEY\n\n### Salesforce\n- **Type**: OAuth2 or Username/Password\n- **Used for**: creating new lead records\n\nGo to Settings \u2192 Credentials, create these three credentials, and assign them in the respective nodes before running the workflow.\n\n## Workflow Overview\n\n### Node 1: HubSpot Trigger\nThis node listens for real-time events from the connected HubSpot account. Once triggered, the node passes metadata about the event to the next step in the flow.\n\n### Node 2: HubSpot\nThis node fetches contact details from HubSpot after the trigger event.\n\n- **Credential**: Connected using a HubSpot App Token\n- **Resource**: Contact\n- **Operation**: Get Contact\n- **Return All**: Disabled\n\nThis node retrieves the full contact details needed for further processing and enrichment.\n\n### Node 3: Match prospect\nThis node sends each contact'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 contact 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, validate, or create lead information.\n\n### Node 4: Filter\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**Status**: Currently deactivated (as shown by the \"Deactivate\" label)\n\n### Node 5: 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 6: 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 7: Explorium Enrich Profiles\nThis additional enrichment node provides supplementary contact data enhancement, running in parallel with the primary enrichment process.\n\n### Node 8: 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 9: Code - flatten\nThis custom code node processes and transforms the merged enrichment data before creating the Salesforce lead. It can be used to:\n- Flatten nested data structures\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\n\n### Node 10: Salesforce\nThis final node creates new leads in Salesforce using the enriched data returned by Explorium.\n\n- **Credential**: Salesforce OAuth2 or Username/Password\n- **Resource**: Lead\n- **Operation**: Create Lead\n\nThe node creates new lead records with enriched information including contact details, company information, and professional data obtained through the Explorium enrichment process.\n\n## Workflow Flow Summary\n\n1. **Trigger**: HubSpot webhook triggers on new/updated contacts\n2. **Fetch**: Retrieve contact details from HubSpot\n3. **Match**: Find prospect matches using Explorium\n4. **Filter**: Keep only successfully matched prospects (currently deactivated)\n5. **Extract**: Compile prospect IDs for bulk enrichment\n6. **Enrich**: Parallel enrichment of contact information through multiple Explorium endpoints\n7. **Merge**: Combine enrichment results\n8. **Transform**: Flatten and prepare data for Salesforce (Code node)\n9. **Create**: Create new lead records in Salesforce\n\nThis workflow ensures comprehensive data enrichment while maintaining data quality and providing a seamless integration between HubSpot prospect data and Salesforce lead creation. The parallel enrichment structure maximizes data collection efficiency before creating high-quality leads in your CRM system."
      },
      "typeVersion": 1
    },
    {
      "id": "138c5a4f-b21f-48e9-94df-f97736435168",
      "name": "Filter - non matched",
      "type": "n8n-nodes-base.filter",
      "position": [
        1744,
        288
      ],
      "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": "a62f780e-6a72-498e-a50d-7d5a31561f63",
      "name": "Match Prospects",
      "type": "@exploriumai/n8n-nodes-explorium-ai.exploriumApiNode",
      "position": [
        1520,
        288
      ],
      "parameters": {
        "type": "prospects",
        "operation": "match",
        "prospects_to_match": {
          "prospects_to_match": [
            {
              "email": "={{ $json['identity-profiles'][0].identities.find(id => id.type === 'EMAIL').value }}",
              "full_name": "="
            }
          ]
        }
      },
      "credentials": {
        "exploriumApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7d7d37df-959d-490c-9150-14a8a701563e",
      "name": "Enrich Prospects",
      "type": "@exploriumai/n8n-nodes-explorium-ai.exploriumApiNode",
      "position": [
        2192,
        288
      ],
      "parameters": {
        "type": "prospects",
        "jsonInput": "={{ { \"prospect_ids\": $json.prospect_ids } }}",
        "operation": "enrich",
        "enrichment": [
          "contacts",
          "profiles"
        ],
        "useJsonInput": true
      },
      "credentials": {
        "exploriumApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "HubSpot": {
      "main": [
        [
          {
            "node": "Match Prospects",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - flatten": {
      "main": [
        [
          {
            "node": "Salesforce",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HubSpot Trigger": {
      "main": [
        [
          {
            "node": "HubSpot",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Match Prospects": {
      "main": [
        [
          {
            "node": "Filter - non matched",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich Prospects": {
      "main": [
        [
          {
            "node": "Code - flatten",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter - non matched": {
      "main": [
        [
          {
            "node": "Extract Prospect IDs from Matched Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Prospect IDs from Matched Results": {
      "main": [
        [
          {
            "node": "Enrich Prospects",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This n8n workflow streamlines the process of enriching prospect information by automatically pulling data from HubSpot, processing it through Explorium's AI-powered tools, and creating new leads in Salesforce with enhanced prospect details.

Source: https://n8n.io/workflows/4836/ — original creator credit. Request a take-down →

More CRM & Sales workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

CRM & Sales

HubSpot Contact Enrichment with Explorium

HubSpot Trigger, HubSpot, @Exploriumai/N8N Nodes Explorium Ai
CRM & Sales

Salesforce Lead Enrichment with Explorium

Salesforce Trigger, Salesforce, @Exploriumai/N8N Nodes Explorium Ai
CRM & Sales

It extracts key business information using AI, scores the lead based on your ideal customer profile, creates CRM records, notifies your team on Slack, and logs all activity—including failures—to Googl

Gmail Trigger, HubSpot, Salesforce +3
CRM & Sales

This workflow automates the transition of new Shopify customers into HubSpot, using ZeroBounce for multi-layer validation (Validation + AI Scoring).

@Zerobounce/N8N Nodes Zerobounce, Shopify Trigger, Google Sheets +1
CRM & Sales

How It Works This workflow automates the entire property lead generation process in a few simple steps: Property Search: Connects to BatchData's Property Search API with customizable parameters (locat

HTTP Request, Spreadsheet File, HubSpot +1