Template
Download the following json file and import it to a new n8n workflow:
Overview
This n8n workflow monitors your Salesforce instance for new leads and automatically enriches them with missing contact information. When a lead is created, the workflow:- Detects the new lead via Salesforce trigger
- Matches the lead against Explorium’s database using name and company
- Enriches the lead with professional email addresses and phone numbers
- Updates the Salesforce lead record with the discovered contact information
Key Features
- Real-time Processing: Triggers automatically when new leads are created in Salesforce
- Intelligent Matching: Uses lead name and company to find the correct person in Explorium’s database
- Contact Enrichment: Adds professional emails, mobile phones, and office phone numbers
- Batch Processing: Efficiently handles multiple leads to optimize API usage
- Error Handling: Continues processing other leads even if some fail to match
- Selective Updates: Only updates leads that successfully match in Explorium
Prerequisites
Before setting up this workflow, ensure you have:- n8n instance (self-hosted or cloud)
- Salesforce account with:
- OAuth2 API access enabled
- Lead object permissions (read/write)
- API usage limits available
- Explorium API credentials (API Key)
- Basic understanding of Salesforce lead management
Salesforce Requirements
Required Lead Fields
The workflow expects these standard Salesforce lead fields:FirstName
- Lead’s first nameLastName
- Lead’s last nameCompany
- Company nameEmail
- Will be populated/updated by the workflowPhone
- Will be populated/updated by the workflowMobilePhone
- Will be populated/updated by the workflow
API Permissions
Your Salesforce integration user needs:- Read access to Lead object
- Write access to Lead object fields (Email, Phone, MobilePhone)
- API enabled on the user profile
- Sufficient API calls remaining in your org limits
Installation & Setup
Step 1: Import the Workflow
1
Create a new workflow.
2
Download the workflow JSON from above.
3
In your n8n instance, go to Workflows Add Workflow Import from File
4
Select the JSON file and click Import
Step 2: Configure Salesforce OAuth2 Credentials
1
Click on the Salesforce Trigger node
2
Under Credentials, click Create New
3
Follow the OAuth2 flow:
- Client ID: From your Salesforce Connected App
- Client Secret: From your Salesforce Connected App
- Callback URL: Copy from n8n and add to your Connected App
4
Authorize the connection
5
Save the credentials as “Salesforce account connection”
Step 3: Configure Explorium API Credentials
1
Click on the Match_prospect node
2
Under Credentials, click Create New (HTTP Header Auth)
3
Configure the header:
- Name:
api_key
- Value:
YOUR_EXPLORIUM_API_TOKEN
4
Save as “Header Auth account”

5
Apply the same credentials to the Explorium Enrich Contacts Information node
Step 4: Verify Node Settings
1
Salesforce Trigger
- Trigger On:
Lead Created
- Poll Time: Every minute (adjust based on your needs)
2
Salesforce Get Leads
- Operation:
Get All
- Condition:
CreatedDate = TODAY
(fetches today’s leads) - Limit: 20 (adjust based on volume)
3
Loop Over Items
- Batch Size: 6 (optimal for API rate limits)
Step 5: Activate the Workflow
1
Save the workflow
2
Toggle the Active switch to ON
3
The workflow will now monitor for new leads every minute
How It Works
Workflow Process Flow
Detailed Node Descriptions
- Salesforce Trigger: Polls Salesforce every minute for new leads
- Get Today’s Leads: Retrieves all leads created today to ensure none are missed
- Loop Over Items: Processes leads in batches of 6 for efficiency
- Match Prospect: Searches Explorium for matching person using name + company
- Filter: Checks if a valid match was found
- Extract Prospect IDs: Collects all matched prospect IDs
- Enrich Contacts: Fetches detailed contact information from Explorium
- Merge: Combines original lead data with enrichment results
- Split Out: Separates individual enriched records
- Update Lead: Updates Salesforce with new contact information
Data Mapping
The workflow maps Explorium data to Salesforce fields as follows:Explorium Field | Salesforce Field | Fallback Logic |
---|---|---|
emails[0].address | Falls back to professions_email | |
mobile_phone | MobilePhone | Falls back to phone_numbers[1] |
phone_numbers[0] | Phone | Falls back to mobile_phone |
Usage & Monitoring
Automatic Operation
Once activated, the workflow runs automatically:1
Checks for new leads every minute
2
Processes any leads created since the last check
3
Updates leads with discovered contact information
4
Continues running until deactivated
Manual Testing
To test the workflow manually:1
Create a test lead in Salesforce
2
Click “Execute Workflow” in n8n
3
Monitor the execution to see each step
4
Verify the lead was updated in Salesforce
Monitoring Executions
Track workflow performance:1
Go to Executions in n8n
2
Filter by this workflow
3
Review successful and failed executions
4
Check logs for any errors or issues
Troubleshooting
Common Issues
No leads are being processed- Verify the workflow is activated
- Check Salesforce API limits haven’t been exceeded
- Ensure new leads have FirstName, LastName, and Company populated
- Confirm OAuth connection is still valid
- Verify company names are accurate (not abbreviations)
- Check that first and last names are properly formatted
- Some individuals may not be in Explorium’s database
- Try testing with known companies/contacts
- Check Salesforce field-level security
- Verify the integration user has edit permissions
- Ensure Email, Phone, and MobilePhone fields are writeable
- Check for validation rules blocking updates
- Salesforce: Re-authorize OAuth connection
- Explorium: Verify Bearer token is valid and not expired
- Check API quotas haven’t been exceeded
Error Handling
The workflow includes built-in error handling:- Failed matches don’t stop other leads from processing
- Each batch is processed independently
- Failed executions are logged for review
- Partial successes are possible (some leads updated, others skipped)
Best Practices
Data Quality
- Ensure complete lead data: FirstName, LastName, and Company should be populated
- Use full company names: “Microsoft Corporation” matches better than “MSFT”
- Standardize data entry: Consistent formatting improves match rates
Performance Optimization
1
Adjust batch size
Lower if hitting API limits, higher for efficiency
2
Modify polling frequency
Every minute for high volume, less frequent for lower volume
3
Set appropriate limits
Balance between processing speed and API usage
Compliance & Privacy
- Data permissions: Ensure you have rights to enrich lead data
- GDPR compliance: Consider privacy regulations in your region
- Data retention: Follow your organization’s data policies
- Audit trail: Monitor who has access to enriched data
Customization Options
Extend the Enrichment
Add more Explorium enrichment by:- Adding firmographic data (company size, revenue)
- Including technographic information
- Appending social media profiles
- Adding job title and department verification
Modify Trigger Conditions
Change when enrichment occurs:- Trigger on lead updates (not just creation)
- Add specific lead source filters
- Process only leads from certain campaigns
- Include lead score thresholds
Add Notifications
Enhance with alerts:- Email sales reps when leads are enriched
- Send Slack notifications for high-value matches
- Create tasks for leads that couldn’t be enriched
- Log enrichment metrics to dashboards
API Considerations
Salesforce Limits
- API calls: Each execution uses ~4 Salesforce API calls
- Polling frequency: Consider your daily API limit
- Batch processing: Reduces API usage vs. individual processing
Explorium Limits
- Match API: One call per batch of leads
- Enrichment API: One call per batch of matched prospects
- Rate limits: Respect your plan’s requests per minute
Integration Architecture
This workflow can be part of a larger lead management system:- Lead Capture This Workflow Lead Scoring Assignment
- Can trigger additional workflows based on enrichment results
- Compatible with existing Salesforce automation (Process Builder, Flows)
- Works alongside other enrichment tools
Security Considerations
- Credentials: Stored securely in n8n’s credential system
- Data transmission: Uses HTTPS for all API calls
- Access control: Limit who can modify the workflow
- Audit logging: All executions are logged with details
Support Resources
For assistance with:- n8n issues: Consult n8n documentation or community forum
- Salesforce integration: Reference Salesforce API documentation
- Explorium API: Contact Explorium support for API questions
- Workflow logic: Review execution logs for debugging