Back to blog
8 min read

n8n Lead Enrichment Workflow With a Profile API

By Kooperativa Engineering

n8n Lead Enrichment Workflow With a Profile API

Most n8n lead enrichment templates chain a contact finder and a language model. This workflow, built for B2B sales and revenue teams, does something narrower and cheaper: it takes leads that already have a profile identifier, finds out what each person does and where, and decides whether the lead fits, so that only fits move on.

It uses the Kooperativa node, so there is no HTTP Request node and no hand-built header. The scope is professional fields: title, employer and company size. The API holds no email addresses or phone numbers, so if your outreach needs them, add a separate step with a contact provider after the fit check.

What the workflow does

Seven steps, in this order.

Stepn8n nodeWhat it does
1Schedule Trigger and Google SheetsRead leads that have a username and no status yet
2Code, named Build batchesGroup the leads into batches of 100
3Kooperativa: Person, Bulk EnrichEnrich a whole batch in one call
4Code, named ScoreFlatten the result and score fit
5IFSplit fits from the rest
6Kooperativa: Company, EnrichAdd company detail for the fits only
7Google Sheets and SlackWrite the result back and alert on the fits

Install the node

The node is a published npm package. In n8n, open Settings, then Community Nodes, then Install, and enter the package name @kooperativa_team/n8n-nodes-kooperativa. As of November 2026 it is not yet a verified community node, so it will not appear in the in-app node search and has to be installed by name. Add your API key as the credential and press Test: the credential check calls the account endpoint, so a typo shows up at once.

Steps 1 and 2: leads and batches

Each lead needs a profile username or profile URL in the sheet. Without one, use Person, Search with a name and company to propose candidates, and have a person confirm each match before it goes in the sheet. Search returns previews and can return namesakes, so an unconfirmed match should never be enriched as if it were certain.

Bulk Enrich takes up to 100 identifiers in its Profiles field, each with exactly one of id, username or linkedin_url. This Code node, set to run once for all items, builds the batches and keeps the original rows so they can be joined back.

Code node: Build batchesjs
const leads = $input.all().map((i) => i.json);
const out = [];
for (let i = 0; i < leads.length; i += 100) {
  const batch = leads.slice(i, i + 100);
  out.push({
    json: {
      profiles: JSON.stringify(batch.map((l) => ({ username: l.username }))),
      rows: batch,
    },
  });
}
return out;

In the Kooperativa node choose Person, then Bulk Enrich, and set the Profiles field to the expression {{ $json.profiles }}. The node returns the profiles it found plus the counts matched, requested, not_found and failed.

Steps 4 and 5: score fit

Score runs once for all items and reads the batches by node name. It assumes the Kooperativa node returns one item for each batch, in order, which is how it behaves. The full record has the current title, employer and a positions list, and the company size range sits on the current position.

Code node: Scorejs
const batches = $('Build batches').all();
const TITLE = /(chief|vp|vice president|head of|director)/i;
const SIZES = ['51 - 200', '201 - 500', '501 - 1000'];
const out = [];

$input.all().forEach((item, i) => {
  const rows = batches[i].json.rows;
  const byName = new Map(
    item.json.profiles.map((p) => [String(p.username).toLowerCase(), p]),
  );

  for (const row of rows) {
    const p = byName.get(String(row.username).toLowerCase());
    if (!p) {
      out.push({ json: { ...row, status: 'unmatched' } });
      continue;
    }
    const current = (p.positions || []).find((pos) => pos.isCurrent);
    const size = current ? current.companyStaffCountRange : null;
    out.push({
      json: {
        ...row,
        status: 'matched',
        title: p.current_title,
        company: p.current_company,
        company_id: p.current_company_id,
        size,
        fit: TITLE.test(p.current_title || '') && SIZES.includes(size),
        fetched_at: p.fetched_at,
      },
    });
  }
});
return out;

Three details. Unmatched means the bulk call did not return the person, which is not proof that the person is gone, so write unmatched to the sheet and leave the lead alone. The size ranges are the exact strings stored on profiles, such as 51 - 200, so copy them as written. And fetched_at is an ISO timestamp on full records: write it to the sheet so you can see how old each answer is.

Point the IF node at the fit field. Fits go on, everything else is written back with its status.

Step 6: company detail for the fits only

For the fits, add Company, then Enrich, passing the company id from the previous step. The record has the company's staff count, industries, headquarters and founded year. Standard calls carry no per-request fee, so the reason to enrich only the fits is time and rate limit, not cost.

The trap: realtime inside a loop

The node also has Enrich (Realtime) for people and companies. It fetches a current profile and costs $0.001 per call, and it needs an account with billing set up. Two properties make it easy to overspend in a schedule. A not-found returns 404 and fails the item unless Continue On Fail is on, and it is billed either way. And a workflow that runs it over 1,000 items costs $1 every time it runs, not once. Keep it behind a condition: only leads that are already fits, only when the last check is older than you can tolerate.

Settings worth changing

Turn on Retry On Fail for the Kooperativa nodes so a short 429 or 503 does not stop a run, and set Continue On Fail so one bad row does not end the batch. The node is also registered as usable as a tool, so an AI Agent node can call the same operations when you want an agent to decide what to look up. That is a different design from this workflow: the agent chooses the calls and you pay in unpredictability.

What it does not do

There are no emails or phone numbers at the end of it. A lead that fits comes out with a verified title, employer and company size, and a rep or a contact provider takes it from there. The workflow also sees only what profiles say: a lead whose profile is out of date will score on old data, which is why the fetched_at column matters.

Frequently asked questions

Can n8n enrich leads without an HTTP Request node?

Yes. Install the Kooperativa community node by package name, add your API key as the credential, and use the Person and Company operations directly.

How many leads can one call enrich?

Bulk Enrich takes up to 100 profiles per call. Group larger lists into batches of 100 with a Code node.

Does this workflow find email addresses?

No. Kooperativa holds professional profile data and no contact details. Add a contact provider as a separate step after the fit check if you need an email.

What does a realtime lookup cost inside a workflow?

Each Enrich (Realtime) call costs $0.001, billed even when nothing is found. A workflow that runs it over 1,000 items costs $1 on every run, so keep it behind a condition.

Get started

Try Kooperativa

One API key. Person and company enrichment, structured search, and monitors under one flat license.

Keep reading

We use only cookies that are strictly necessary to run this site (staying signed in, and protecting forms from abuse). Our analytics tool doesn't use cookies or collect personal data. See our Privacy Policy for details.