Auto-enrich new HubSpot contacts with LinkedIn profile data
When a new HubSpot contact arrives with a LinkedIn URL, scrape their profile and write job title, company, location, and headline back to the CRM.
Build a code workflow that auto-enriches every new HubSpot contact with fresh LinkedIn profile data using PhantomBuster.
Trigger: HubSpot webhook on the contact.creation event. The webhook payload includes the new contact ID.
Steps, in order:
1. Read the new contact from HubSpot using the contact ID from the webhook payload. Fetch the standard LinkedIn URL property (and any custom LinkedIn URL property the user names). If no LinkedIn URL is present, log a 'skipped: no LinkedIn URL' message and exit cleanly. Do not error.
2. Launch a pre-configured LinkedIn Profile Scraper Phantom in PhantomBuster using the Launch Agent with Output (v1) operation. Use blocking mode (output=result-object) so the single call returns the structured scrape result, with the agent ID pulled from a workflow input. Pass the contact's LinkedIn URL as the profileUrls argument (JSON-stringified, as the v1 launch endpoint requires).
3. Parse the structured profile data returned by PhantomBuster. Extract: current job title, current company name, location, headline, skills count, and follower count. Be defensive about missing fields (the LinkedIn scraper does not always return every field) and substitute null when something is absent.
4. Update the HubSpot contact using the Update Contact operation, keyed by the original contact ID from the webhook. Map the parsed fields to HubSpot contact properties. Default the mapping to: jobtitle, company, city/state (split from location), and a custom property each for headline, linkedin_skills_count, and linkedin_follower_count. Make the property mapping easy for the user to tweak in workflow inputs.
This is a deterministic pipeline with one fixed path: webhook in, optional skip, one blocking PhantomBuster call, one HubSpot update. No branching judgment, no LLM reasoning needed.
Make sure the workflow exposes these inputs: the PhantomBuster LinkedIn scraper agent ID, the HubSpot LinkedIn URL property name (default 'linkedin_url' or the standard 'hs_linkedin_url'), and the custom HubSpot property names that should receive headline, skills count, and follower count.
Additional information
What does this prompt do?
- Listens for new contacts in HubSpot and reacts the moment one is created.
- Runs your LinkedIn profile scraper in PhantomBuster and waits for the result in a single step.
- Writes the fresh job title, company, location, headline, skills count, and follower count back onto the contact in HubSpot.
- Quietly skips any contact that does not have a LinkedIn URL set, so nothing breaks when the field is empty.
What do I need to use this?
- A HubSpot account where you can add a new contact and a few custom contact properties.
- A PhantomBuster workspace with a LinkedIn Profile Scraper Phantom already set up and connected to your LinkedIn session.
- A LinkedIn URL field on your HubSpot contact record (the standard one or a custom property).
How can I customize it?
- Pick which HubSpot properties get the scraped fields written into them, including any custom fields you already use.
- Choose a different Phantom (for example a company page scraper) if you want to enrich based on a company URL instead of a personal profile.
- Add a simple filter so only certain contacts get enriched, such as new contacts in a specific lifecycle stage or list.
Frequently asked questions
Does this work with HubSpot Free?
What happens to contacts that do not have a LinkedIn URL?
How fresh is the data?
Can I scrape something other than personal profiles?
Will it burn through my PhantomBuster execution time?
Stop hand-copying LinkedIn into HubSpot.
Connect HubSpot and PhantomBuster once, and every new contact arrives with a current job title, company, and headline already filled in.