TutorialPractitioner7 min read

Build a lead enrichment and routing workflow in n8n

Build an n8n lead enrichment workflow: webhook, HTTP enrichment, AI classification of free text, CRM upsert and Slack routing, with error paths.

Dipuck Jones
Written by Founder of MentionX · 13+ years in B2B SaaS growth and SEO
Reviewed
Short answer

Lead enrichment adds company data to a new lead, then routes it to the right person. In n8n it's a webhook, an HTTP call to an enrichment API, a classification step, a CRM upsert and an alert, plus an error path so one bad lookup never loses a lead.

Key takeaways
  • Enrich on the company domain, not on personal data, wherever possible.
  • Use rules for hard eligibility and AI only for free-text fields.
  • Every external call needs retries and an error path.
  • The lead must reach the CRM even when enrichment fails.

Checked 4 November 2026 (CET) against n8n documentation and the n8n pricing page. n8n ships updates often and node options, plan limits and prices change, so confirm in your own instance and on the pricing page. "Our view" marks MentionX opinion. Ledgerline is a fictional company used for illustration.

01What does a good enrichment workflow do?

It answers three questions within a minute of the form fill:

  1. Who is this company? Industry, size, country.
  2. What do they want? Interpreted from the form's free-text field.
  3. Who should talk to them? The owner, based on agreed rules.

And it does so without ever losing a lead. If the enrichment API is down, the lead still lands in the CRM with what you know, and someone gets told.

02The architecture

Webhook -> Normalise -> Free-mail check -> Enrich (HTTP) -> Map fields
        -> Classify intent (AI) -> Route (Switch) -> CRM upsert -> Slack alert
                    \-> on error: log + basic upsert + alert ops

Keep enrichment and AI steps between normalisation and the CRM write. That way, everything written to the CRM has passed the same checks.

03Handling rate limits and failures

Enrichment APIs throttle. According to the n8n docs on handling rate limits, you can:

  • Turn on Retry On Fail in the node settings and set Wait Between Tries (ms).
  • Use Loop Over Items with a Wait node to space requests.
  • Use the HTTP Request node's Batching option to send items in batches with an interval.

A 429 error ("The service is receiving too many requests from you") means you hit the limit. For a form webhook that fires one lead at a time, retries are usually enough. For a backfill of 5,000 old leads, use batching and run it outside business hours.

04Using AI for the free-text field

Most demo forms ask "What are you hoping to solve?". The answers are gold for routing, but messy. The Text Classifier node (lesson 8) takes categories with descriptions and assigns each item to one. Give each category a clear description, turn on the "Other" branch rather than discarding unmatched items, and review a sample of classifications weekly at first.

Our view: don't let a model invent firmographics. Use enrichment APIs for facts and AI for interpreting what the person wrote.

05Choosing an enrichment source

Enrichment providers differ in coverage, pricing and data rules. Before you pick one, check:

  • Coverage of your market. Test with 50 of your real target companies (domains only, no personal data) during a trial.
  • Pricing per lookup, and whether failed lookups are charged.
  • Rate limits, which shape your workflow design.
  • Data protection terms, especially for EU contacts. Ask your legal team.
  • What you're allowed to store and for how long.

This lesson doesn't recommend a provider. Most offer an HTTP API that n8n can call with the HTTP Request node.

06The HTTP Request node for enrichment

The HTTP Request node is how n8n talks to services without a dedicated node. For enrichment:

  • Authentication: create a Header Auth or other generic credential with the API key, rather than pasting keys into the URL.
  • Query or body: usually the domain or email.
  • Batching: the node's Batching option sets items per batch and an interval between batches, which keeps you under rate limits.
  • Pagination: available for APIs that return results in pages.
  • On Error: set to Continue (using error output) so one failed lookup doesn't stop the whole run.

07Scoring with an AI node vs rules

ApproachGood forRisk
Rules (IF/Switch on employees, industry, country)Clear, auditable segmentsMisses nuance in free text
AI Text ClassifierFree-text "use case" answers, job titlesCan misclassify; needs testing
BothRules for hard filters, AI for the fuzzy fieldMore nodes to maintain

Combine them: rules decide eligibility, AI only interprets the free-text field.

08Scoring and routing rules

Keep routing rules in a data table rather than inside IF nodes, so marketing ops can change them without editing the workflow:

RuleConditionRoute
Target accountDomain in target listAccount owner, Slack alert
Enterprise sizeEmployees above your thresholdEnterprise team
RegionCountry in region listRegional queue
Student or personal emailFree email domainNurture only
UnclearMissing key fieldsManual review sheet

09Measuring whether it works

Track a few numbers monthly: time from form fill to first contact, share of leads routed automatically, share sent to manual review, and enrichment match rate. Compare with the month before launch. If manual review is above a quarter of leads, the rules or the enrichment source need work.

10Privacy

Enrichment adds data about people. Check that your privacy notice covers it, that the provider's data sources are acceptable to your legal team, and that you only store fields you use.

11Worked example: Ledgerline's inbound routing

Ledgerline is a fictional accounts-payable software company. Details are illustrative.

Ledgerline sells to finance teams. Its form asked "What are you hoping to solve?". Answers ranged from "invoice approvals take weeks" to "I'm a student".

The team built the workflow above with four categories. In the first two weeks, they reviewed every classification in a sheet. Two category descriptions were rewritten because "Partner or vendor" was catching accounting firms that were genuine prospects.

When the enrichment provider had an outage, the error branch upserted basic contacts and posted one message to the ops channel. No leads were lost, and the team re-ran enrichment later from the log.

Walkthrough

  1. Trigger: Webhook from your form, or the HubSpot trigger for new contacts.
  2. Edit Fields: normalise email and extract the domain.
  3. IF: drop free-mail domains to a separate branch.
  4. HTTP Request: call your enrichment API with the domain. Use a stored credential, set Retry On Fail with a wait between tries, and set On Error to Continue (using error output).
  5. Edit Fields: map the provider's response into your own field names (industry, employees, country).
  6. Text Classifier on the "What are you looking for?" field with categories such as "Evaluating AP software", "Existing customer support", "Partner or vendor" and "Other". Turn on the Other branch.
  7. Switch combining employee band and classifier output into a route.
  8. HubSpot upsert with enriched fields and the route, then a Slack alert to the right owner.
  9. Error branch: log the failed lookup to a sheet and still upsert the basic contact.

12Try it yourself

Build the workflow against a sandbox CRM with ten invented leads. Make one enrichment call fail on purpose (for example, a domain that doesn't exist) and check the lead still reaches the CRM with basic fields and the failure is logged.

13Quick quiz

1. Why use Continue (using error output) on the enrichment call?

Answer: So a failed lookup takes a separate path instead of stopping the whole workflow.

2. Where should the API key go?

Answer: In an n8n credential, not in the URL or a Set node.

3. What does the Text Classifier's "Other" branch do?

Answer: It outputs items the model can't match to a category, instead of discarding them.

14What should you check before the next lesson?

  • Enrichment failures never drop a lead.
  • Rate limits are handled with retries or batching.
  • AI is used only on free text, with an Other branch.

Next: AI nodes, models and structured output. Or return to the n8n for Marketers track.

15Common questions

Do I need a paid enrichment provider? Usually, for firmographic data. Test coverage on your own target domains first.

Can AI do the enrichment instead? Use AI to interpret text you already have, not to guess company facts. Models can be wrong.

Is enrichment allowed under GDPR? It depends on the data and your lawful basis. Check with your legal team.

Questions people ask

3 answers

Do I need a paid enrichment provider?

Usually, for firmographic data. Test coverage on your own target domains first.

Can AI do the enrichment instead?

Use AI to interpret text you already have, not to guess company facts. Models can be wrong.

Is enrichment allowed under GDPR?

It depends on the data and your lawful basis. Check with your legal team.

Sources

  1. n8n Docs, HTTP Request nodedocs.n8n.io
  2. n8n Docs, Handle rate limitsdocs.n8n.io
  3. n8n Docs, Text Classifierdocs.n8n.io
  4. n8n Docs, Webhook nodedocs.n8n.io
  5. n8n Docs, HubSpot nodedocs.n8n.io
  6. n8n Docs, Handle errors gracefullydocs.n8n.io
  7. All accessed 4 Nov 2026.
Written and reviewed by Dipuck JonesHow we research and testReport an error

Keep learning

All n8n →