Auto-enrich new HubSpot contacts with LinkedIn profile data

By General Input

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.

Integrations

  • HubSpot
  • PhantomBuster

Type

Deterministic Code

Categories

  • Sales
  • Marketing

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.

Related prompts

Explore more prompts
Turn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationLusha prospecting workbench with credit-safe revealsWhich companies your LinkedIn ads reach, matched to your CRMLead response desk with a running clock on every new leadApprove Lusha enrichment field by field before HubSpot saves it