Automatically Enrich New Salesforce Contacts with Clearbit Data
When a new contact is created in Salesforce, this workflow instantly fetches enriched company and person data from Clearbit and writes it back to the Salesforce contact record. Data teams get clean, complete contact profiles without any manual research.
- 1
Trigger on New Salesforce Contact
Add a
Salesforce Triggernode and set theObjecttoContactandEventtoCreate. Connect your Salesforce credentials. This node polls Salesforce every minute and fires whenever a new contact is created, passing the contact's fields downstream. - 2
Extract the Contact Email
Add a
Setnode namedExtract Email. Create a new field calledemailand set its value to the expression{{ $json.Email }}from the trigger output. This isolates the email address so it can be passed cleanly to Clearbit. - 3
Call Clearbit Enrichment API
Add an
HTTP Requestnode namedClearbit Enrich. SetMethodtoGETandURLtohttps://person.clearbit.com/v2/combined/find. UnderQuery Parametersadd a keyemailwith value{{ $json.email }}. UnderAuthenticationchooseHeader Authand add headerAuthorizationwith valueBearer YOUR_CLEARBIT_API_KEY. Store your API key in n8n credentials for security. - 4
Check Clearbit Returned Data
Add an
IFnode namedEnrichment Found?. Set the condition to check that{{ $json.person.email }}is not empty. Thetruebranch continues to update Salesforce; thefalsebranch ends silently when no Clearbit data is found for the contact. - 5
Write Enriched Data Back to Salesforce
Add a
Salesforcenode namedUpdate Contact. SetOperationtoUpdateandObjecttoContact. Set theContact IDfield to{{ $('Salesforce Trigger').item.json.Id }}. Map fields such asTitlefrom{{ $json.person.employment.title }},Companyfrom{{ $json.company.name }}, andPhonefrom{{ $json.person.phone }}. Only the true branch from the IF node connects here.
Frequently asked questions
What happens if Clearbit cannot find data for an email address?
The IF node checks whether Clearbit returned a valid person record. If no data is found, the workflow stops gracefully on the false branch and the Salesforce contact is left unchanged. You can optionally connect a Slack or email notification to the false branch to flag unmatched contacts for manual review.
Will this overwrite existing data already in Salesforce contact fields?
Yes, the Update Contact node will overwrite any mapped fields with Clearbit data. If you want to protect existing values, add a second IF node before the update step that checks whether the Salesforce field is already populated, and only proceed with the update if the field is empty.
How do I keep my Clearbit API key secure in n8n?
In n8n, go to Credentials and create a new Generic Credential of type Header Auth. Set the header name to Authorization and the value to Bearer followed by your Clearbit API key. Then select this credential in the HTTP Request node instead of pasting the key directly into the URL or parameters field.