Skip to main content

WORKEASIER implementation guide · 8 min read

AI lead scoring in n8n with Claude: a production approach

Updated

Asking a model “is this a good lead?” is easy. Getting a score your sales team can rely on every day is a workflow design problem: what data the model sees, what shape the answer takes, what happens when enrichment fails and how you check the scores against reality. This guide walks through that design in n8n with Claude.

Start with criteria, not a prompt

Write down what makes a lead hot for your business before writing any prompt: company size, industry, role, region, stated budget or use case. These criteria become the scoring rubric you give the model and the checklist you later use to evaluate its answers. A vague prompt produces scores that drift with every model update.

Normalize the webhook input

Lead forms, landing pages and ad platforms all send slightly different payloads. The first nodes after the Webhook trigger should map every source into one internal shape — name, email, company, message, source — trim whitespace, lowercase the email and reject submissions that are missing required fields.

Doing this once, at the entry point, means every later node can trust its input. It is also where you stop spam and test submissions before they cost anything.

Pre-filter before paid API calls

Enrichment and model calls cost money per request. Deterministic checks are free, so run them first: block disposable email domains, drop obvious spam, and split corporate domains from free email providers such as Gmail or Outlook.

Free-email leads cannot be enriched by company domain, so they need a different context path rather than a failed lookup. The WORKEASIER lead module separates these branches explicitly so a free-email lead never reaches the company enrichment request.

Enrich company context — and handle missing data

For corporate domains, an enrichment API such as Brandfetch can return company information to give the model context beyond the form fields. Enrichment will sometimes return nothing, time out or describe the wrong company. Treat missing enrichment as missing, and tell the model so, rather than letting an empty response look like evidence.

Ask Claude for a structured score

Send Claude the normalized lead, the enrichment context and your rubric, and ask for a fixed JSON structure: a numeric score, a tier such as hot or nurture, and a short reason that cites the evidence used. A structured answer can be validated and routed; a paragraph of prose cannot.

Validate the response before using it: the score is a number in range, the tier is one of the allowed values, the reason is present. When validation fails, retry a limited number of times and then route the lead to manual review instead of guessing.

Route the result where people already work

Hot leads go to a Slack channel the sales team watches, with the reason and the key facts in the message so nobody has to open another tool. Nurture leads go to a different destination. Operational failures go to a third channel for whoever maintains the workflow, so a broken credential is not mistaken for a quiet sales day.

If you push results into a CRM, configure that node last, after the scores have been checked. In the WORKEASIER module the CRM step is an optional placeholder that needs your endpoint, authentication and field mapping.

Evaluate scores against real outcomes

Before trusting the workflow, run a set of past leads whose outcome you already know and compare the model's tiers with what actually happened. Adjust the rubric where it disagrees. Repeat this check whenever you change the prompt or the model, and keep sampling scored leads after launch.

Frequently asked questions

Can n8n score leads with Claude without code?
Mostly. The webhook, enrichment request, Claude call and Slack routing are standard nodes. Validating the model's JSON response is usually easiest with a small Code node, but it can also be done with If nodes.
How do I stop AI lead scoring from wasting API credits on spam?
Run deterministic checks before any paid call: required fields, disposable or blocked domains and simple spam rules. Only leads that pass reach enrichment and the model.
What should happen when lead enrichment returns no data?
Continue with the form data and tell the model explicitly that enrichment was unavailable. Do not treat an empty response as a signal, and consider routing such leads to manual review if your rubric depends on company data.