We use cookies to understand how you use our site and improve your experience. Privacy Policy

Back to Blog
Automation Workflows

Capture LinkedIn Leads in HubSpot with n8n

n8n
n8n Resources Team
July 13, 2026

Ready to automate?

Browse 5,000+ copy-paste n8n workflow templates.

Every sales team running LinkedIn Lead Gen Forms faces the same friction: leads sit in LinkedIn Campaign Manager until someone remembers to export them, import them into the CRM, and assign them to a rep. By then, the lead has gone cold. The average response time for B2B leads is over 42 hours. The companies that respond within five minutes are 100x more likely to convert.

n8n closes this gap completely. With a single workflow, you can pull new LinkedIn leads the moment they submit your form, enrich the contact data, create or update the record in HubSpot, and ping your sales team in Slack — all without touching Campaign Manager or importing a CSV file.

This guide walks through the exact workflow: which nodes to use, how to handle the LinkedIn API authentication, and how to structure the data before it hits HubSpot.


What You Need Before You Start

  • n8n instance (self-hosted or n8n Cloud)
  • LinkedIn Marketing Developer Platform access — your LinkedIn app needs the r_ads_reporting and r_leadgen_automation scopes. Apply through the LinkedIn Developer Portal under your Ad Account.
  • HubSpot account with a Private App token (Settings → Integrations → Private Apps)
  • Optionally: a Slack webhook URL for rep notifications
  • Optionally: a Clearbit API key for contact enrichment

LinkedIn's Lead Gen Form API is a pull API, not a webhook push — meaning n8n polls LinkedIn on a schedule to retrieve new form responses. A five-minute polling interval is a reasonable balance between freshness and API rate limits.


Workflow Blueprint

The workflow has five stages:

  1. Schedule Trigger node — fires every five minutes
  2. HTTP Request node (LinkedIn API) — fetches new lead form responses
  3. IF node — skips runs where no new leads arrived
  4. HTTP Request node (optional, Clearbit) — enriches each lead with company data
  5. HubSpot node — creates or updates the contact record
  6. Slack node — sends a deal alert to the assigned sales channel

Step-by-Step Example Workflow

Step 1: Schedule the trigger

Add a Schedule Trigger node and set it to run every 5 minutes. Under "Mode", choose "Every X Minutes" and set the interval to 5.

To avoid duplicate imports, you need to track the last successful run timestamp. Store this in a static value using the n8n Variables node (available in n8n 1.40+), or write it to a single-row Google Sheet that acts as a state store.

Step 2: Pull leads from the LinkedIn API

Add an HTTP Request node configured as follows:

  • Method: GET
  • URL: https://api.linkedin.com/v2/leadGenerationForms/{formUrn}/responses
  • Authentication: OAuth2 using your LinkedIn app credentials
  • Query parameters: start, count (use 50 per page), and submittedAfter — set this to the Unix timestamp of your last run

The response returns an array of lead objects, each containing the submitted fields (name, email, company, phone) and the submission timestamp.

Add a Set node after the HTTP Request to rename fields into consistent keys: firstName, lastName, email, company, phone, submittedAt. This normalization step makes the downstream nodes much simpler to configure.

Step 3: Skip empty runs

Add an IF node that checks {{ $json.elements.length > 0 }}. If the array is empty, the workflow exits without running the remaining steps. This prevents unnecessary HubSpot API calls on quiet polling intervals.

Step 4: Enrich with company data (optional)

If you want to pre-fill company size, industry, and LinkedIn URL before the contact lands in HubSpot, add a second HTTP Request node pointed at the Clearbit Enrichment API:

  • Method: GET
  • URL: https://person.clearbit.com/v2/combined/find
  • Query parameter: email={{ $json.email }}
  • Header: Authorization: Bearer YOUR_CLEARBIT_KEY

Use a Merge node (mode: Merge by Key, on email) to combine the LinkedIn response with the Clearbit enrichment data before the HubSpot step.

If Clearbit returns a 404 (unknown email), the IF node downstream should still allow the contact to be created with the data LinkedIn provided — don't block the workflow on enrichment failures.

Step 5: Create or update the HubSpot contact

Add a HubSpot node and select the "Create or Update Contact" operation. Map the fields:

  • emailemail (this is the deduplication key HubSpot uses)
  • firstname{{ $json.firstName }}
  • lastname{{ $json.lastName }}
  • company{{ $json.company }}
  • phone{{ $json.phone }}
  • hs_lead_statusNEW
  • lifecyclestagelead
  • Custom property linkedin_form_name{{ $json.formName }} (create this property in HubSpot first)

The "Create or Update" operation is important here. If the same person submits two LinkedIn forms over their lifetime, you want to update their record rather than create a duplicate.

Step 6: Notify the sales team

Add a Slack node pointed at your sales channel. A concise message template:

New LinkedIn lead: {{ $json.firstName }} {{ $json.lastName }} ({{ $json.company }}) — {{ $json.email }}
Form: {{ $json.formName }}
View in HubSpot: {{ $json.hubspotContactUrl }}

Use the HubSpot node's output to construct the contact URL dynamically from the returned contact ID.


Handling Multiple Forms

If you're running more than one LinkedIn Lead Gen Form (e.g., one per campaign), use a Code node or a Split In Batches node to loop through a list of form URNs and run the HTTP Request step for each. Store the form URN list in a n8n Variable so you can add new forms without editing the workflow.


What This Replaces

Without this workflow, the typical LinkedIn-to-HubSpot process involves:

  • Manual CSV export from Campaign Manager (usually done weekly, if at all)
  • Deduplication check in HubSpot before import
  • Manual assignment to sales reps
  • Delayed Slack notification, if any

With the n8n workflow running every five minutes, a lead submitted at 9:02 AM reaches HubSpot by 9:07 AM and the rep's Slack by 9:08 AM. That speed advantage alone is worth the hour it takes to set this up.


Going Further

Once the base workflow is running, a few natural extensions:

  • Deal creation: Add a HubSpot "Create Deal" node directly after contact creation, linking the contact and setting the deal stage to "Qualified Lead"
  • Lead scoring: Use an IF node after enrichment to route high-value leads (e.g., company size > 200) to a different Slack channel or assign them to a senior rep
  • CRM deduplication fallback: If HubSpot's built-in dedup misses a match, add a "Search Contacts" step before creation to catch edge cases

This pattern — trigger, fetch, enrich, CRM upsert, notify — works across most lead sources. The same workflow structure adapts to LinkedIn, Facebook Lead Ads, or any form tool that exposes an API.

Browse the ready-to-import versions of this workflow and related n8n templates, or explore the full CRM automation use case library to see how teams use n8n for contact enrichment, deal routing, and pipeline management.

Enjoyed this article?

Share it with others who might find it useful