How to Use n8n to Automate Lead Enrichment
Your sales team fills out a form when a new lead comes in, and then someone spends twenty minutes manually Googling the company, checking LinkedIn, and pasting notes into a CRM field. That whole process can run without anyone touching it, and n8n is one of the better tools for wiring it together because it gives you real code-level control without requiring you to write an entire backend.
The flow I'm describing here takes about an hour to set up if you've used any automation tool before. A webhook catches the form submission, an HTTP node calls an enrichment API, an AI node turns the raw JSON into a readable summary, and a final node writes everything back to your CRM. Let's build it.
Self-Host vs n8n Cloud: Pick Your Setup First
Before you write a single node, decide where n8n runs. The self-hosted option (Docker or npm) gives you full control over credentials, lets you call internal APIs, and costs nothing beyond server bills. n8n Cloud handles the infrastructure for you, with a free tier that covers 200 executions a month and paid plans starting around $20/month.
For a lead enrichment workflow that might fire a few hundred times a day, self-hosting on a small VPS is usually the smarter call. The Cloud free tier runs out fast once real leads start coming in. That said, Cloud is perfectly fine for prototyping.
If you're going self-hosted, the Docker command is:
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n
Then open http://localhost:5678 and create your account.
Step 1: Create the Webhook Trigger
In n8n, every workflow starts with a trigger node. For form submissions, the Webhook node is the right choice.
- Open a new workflow and add a Webhook node.
- Set the method to POST and copy the test URL n8n generates.
- In your form tool (Typeform, Tally, a custom HTML form, whatever), point the form's webhook destination at that URL.
- Hit "Listen for test event" in n8n, then submit a test form entry. You'll see the raw payload appear in the node output.
The form payload usually looks something like this:
{
"email": "[email protected]",
"company": "Example Inc",
"name": "Alice Chen"
}
That's your starting data. Now you need to enrich it.
Step 2: Call an Enrichment API with the HTTP Request Node
n8n's HTTP Request node can hit any REST API. For lead enrichment, services like Clearbit, Hunter.io, and Apollo all have straightforward APIs. I'll use Hunter.io's Company Enrichment endpoint here since it's easy to test for free.
- Add an HTTP Request node after the Webhook.
- Set the method to GET.
- Set the URL to
https://api.hunter.io/v2/domain-search?domain={{ $json.company_domain }}&api_key=YOUR_KEY. You'll need to extract the domain from the email using an expression or a separate Set node first. - In the Query Parameters section, you can add parameters individually instead of in the URL string, which is cleaner.
- Run the node. If the company is in Hunter's database, you'll get back employee counts, social links, tech stack, and related email addresses.
The response JSON can be messy, with nested objects and arrays. Don't try to hand-pick every field yet. Let the AI node handle that.
Step 3: Summarize the Enrichment Data with an AI Node
This is where n8n's native AI capabilities come in. The AI Agent node (or the simpler OpenAI node, depending on your n8n version) lets you pass data to a language model and get structured text back.
- Add an OpenAI node (or AI Agent if you want tool-calling capabilities).
- Set the Resource to "Text" and Operation to "Complete" (for older nodes) or configure a chat prompt.
- Write a prompt like this in the Text field:
You are a sales assistant. Given this raw enrichment data about a lead,
write a 3-sentence company brief that a sales rep can read in 10 seconds.
Focus on: company size, industry, and one concrete fact that's relevant to an outreach email.
Lead name: {{ $('Webhook').item.json.name }}
Company: {{ $('Webhook').item.json.company }}
Enrichment data: {{ JSON.stringify($('HTTP Request').item.json) }}
- Set the model to
gpt-4o-minifor cost efficiency on high-volume flows. The difference in quality for a short summary task is minimal.
You'll get back something like: "Example Inc is a 45-person SaaS company in the HR tech space, founded in 2018. Their tech stack includes Salesforce and Intercom, suggesting they invest in sales and support tooling. They've been hiring engineers recently, which may signal a growth phase worth mentioning in your outreach."
Step 4: Write the Enriched Lead to Your CRM
With the summary ready, the last step is pushing everything to your CRM. n8n has native nodes for HubSpot, Salesforce, Pipedrive, and Notion, among others.
For HubSpot:
- Add a HubSpot node.
- Set Resource to "Contact" and Operation to "Create or Update".
- Map the fields: Email from the webhook payload, Company and Name from the same, and your AI-generated summary into a custom "Lead Brief" property.
Here's a quick comparison of where to send the summary based on CRM type:
| CRM | Best field for the AI summary |
|---|---|
| HubSpot | Custom contact property "Lead Brief" |
| Salesforce | Lead object, Description field |
| Pipedrive | Person note or custom field |
| Notion | Page property or rich text block |
The "Create or Update" operation matters. You don't want duplicate contacts if someone submits the form twice.
Step 5: Handle Errors and Schedule Retries
Enrichment APIs fail sometimes. Hunter.io returns a 404 if the domain isn't in their system. The OpenAI call can time out. If you don't handle this, your workflow silently drops leads.
n8n has an Error Trigger workflow pattern: you create a second workflow that fires when the main one errors, and it can send you a Slack message or write the failed lead to a fallback spreadsheet.
Inside the main workflow, you can also use the IF node after the HTTP Request to check whether the enrichment API actually returned useful data before passing it to the AI node. If the response is empty, route the lead directly to the CRM with a note saying "enrichment unavailable" rather than sending a confusing AI summary.
Step 6: Activate and Monitor
Once your test runs work end-to-end:
- Switch the Webhook node from Test URL to Production URL. They're different endpoints in n8n, and this trips people up.
- Click Activate on the workflow toggle in the top right.
- Submit a real form entry and watch the Executions panel. Each run shows you exactly which node succeeded or failed and what data flowed through.
In the cloud version, the Executions page stores the last 200 runs on the free tier and more on paid plans. Self-hosted keeps them in your local database, which you can query directly if needed.
What This Workflow Actually Saves
A single enrichment lookup takes a sales rep maybe five minutes when you factor in the tab-switching and typing. At 50 leads a week, that's four hours. The workflow above runs in under ten seconds per lead and costs roughly $0.01 in API calls (Hunter + GPT-4o-mini). That math holds up.
The bigger gain is consistency. Every lead gets the same brief, in the same format, every time. Your reps stop spending mental energy on "where should I even start with this company?" and spend it on the actual call.
n8n is flexible enough that this same pattern applies to almost any data pipeline task. Once you're comfortable with the Webhook, HTTP Request, and AI nodes, you can adapt this flow to enrich newsletter signups, job applicants, or event registrations without learning anything new.