Skip to content

Lead qualification and CRM hygiene

The problem

Inbound leads arrive as a name, an email and a free-text message. Sales works the list in the order it arrived, which correlates with nothing. The genuinely good lead — the one from a company that matches your best customers — sits in position forty because they filled the form on Friday afternoon.

What it costs today:

  • Response time on the leads that matter. Speed to first contact is the single strongest predictor of conversion, and it is being spent on tyre-kickers.
  • Manual enrichment. A rep opens LinkedIn and the company website for every lead, or skips it and calls blind.
  • A CRM full of mush. Company names typed four ways, no industry, no size, no notes — so no segmentation is possible later.

What good looks like

Every lead is enriched and scored within a minute of arriving, with the reasoning attached. The CRM gets clean, structured fields. And nothing is written to a customer record without a human agreeing — because an AI silently rewriting your CRM is how you lose trust in both.

What you build

Two halves that work together: a flow that processes each lead, and a Peer that lets sales interrogate the result.

API trigger  (your web form POSTs here)


 [Guardrail]  drop obvious spam before spending anything


 [Enrich]  Smart Agent + web search + CRM tool
      │       → { company, industry, size, region, summary, sources }

 [Score]   Smart Agent → structured output
      │       → { score 0-100, tier, reasoning, nextAction }

 [Tier Check]  Condition: tier === 'A'

      ├── A  ──▶ [Notify Owner]  + [Track Event] lead_hot
      └── else ▶ [Track Event] lead_queued


 [Write to CRM]  tool action  ← gated by approval for A-tier


 [Finish]

Pieces used: an API trigger, a Guardrail, two Smart Agent steps, a Condition, Track Event, tool actions, and a Peer with agent approval.

Implementation

1. Take the lead in

Set the trigger to API and point your web form or marketing platform at it. Every submission becomes a run.

2. Spend nothing on spam

Put a Guardrail step first and wire its blocked path to a Final step. Without it you are running two model calls and a web search on every bot submission.

Note the wiring rule: the guardrail's blocked path is a separate branch. If you leave it empty, blocked content continues down the normal path — an expensive no-op.

3. Enrich with tools, not with vibes

Add a Smart Agent with Web Search enabled and your CRM tool action attached, so it can also check whether this company already exists as an account.

text
Enrich this inbound lead.

Name:    {{name}}
Email:   {{email}}
Company: {{company}}
Message: {{message}}

Find the company's industry, approximate size, region and what they do.
Use only what you can verify from sources you actually retrieved — if you
cannot verify a field, return null for it and say so in `notes`.

Structured output with null-able fields, and a sources array. This step is the one that fails silently if you get it wrong: an agent with no actions and no web search cannot enrich anything, and will happily produce a confident, invented company profile. If the actions list is empty, this is not enrichment.

4. Score against your actual customers

A second Smart Agent — separate, because scoring is a different judgement from research, and a separate step is separately debuggable.

Put your qualification criteria in a Skill rather than the prompt, so sales ops can change what "A-tier" means without editing a flow:

text
Use when scoring an inbound lead. Defines our ICP, disqualifiers and tiers.

Structured output:

json
{
  "type": "object",
  "properties": {
    "score":      { "type": "number" },
    "tier":       { "type": "string", "enum": ["A", "B", "C", "disqualified"] },
    "reasoning":  { "type": "string" },
    "nextAction": { "type": "string" }
  },
  "required": ["score", "tier", "reasoning"]
}

reasoning is not decoration. A score with no explanation gets ignored by sales the second it is wrong once.

5. Route by tier

A Condition on score.data.tier === 'A' splits the paths. Remember: raw JavaScript, bare variable names, and guard against the variable not existing.

The A-tier branch notifies the owner immediately — that is where the speed-to-contact value actually comes from.

Add Track Event on each branch with tier, industry and region as dimensions. Six months later this is the data that tells you whether your ICP definition is right.

6. Write back behind a gate

The CRM write is a tool action on the agent. Turn on Require Human Approval for that specific tool, using Only selected tools rather than gating everything:

  • Approval tools: crm_update_lead

Now the flow pauses before writing, shows the exact fields it wants to set, and waits. Reads stay automatic; writes need a person. That distinction is what makes teams comfortable pointing this at a production CRM.

7. Give sales a way to ask

Attach the CRM tools to a Peer, enable agent approval for anything that writes, and put it in Slack.

Now "who are my top five leads from this week and why" is a question, and "log that call and move them to stage 2" is a sentence the rep confirms rather than a form they fill in.

What happens at run time

A form submission arrives. Within about a minute the lead is enriched, scored and tiered, and an A-tier lead has already pinged its owner.

The CRM write pauses for approval. The reviewer sees the proposed field values next to the reasoning, approves, and the run continues from exactly where it stopped.

What you get

  • Speed on the leads that matter, because routing happens before a human reads anything.
  • A clean CRM, because fields are written structured rather than typed.
  • Reasoning attached to every score, so sales can disagree with it specifically instead of ignoring it generally.
  • Reporting on your ICP: conversion by tier, industry and region, from the tracked events.

Extensions

Close the loop. Feed closed-won and closed-lost back as a data source, so the scoring skill can be tuned against outcomes rather than opinions.

De-duplicate first. Add a CRM lookup before enrichment and route existing accounts to a different path — nothing annoys a rep more than a "new lead" that is their own customer.

Nurture the B-tier. Route non-A leads into a scheduled digest flow rather than dropping them.

Pitfalls

Enrichment without tools. The single most common failure. An agent with an empty actions list and web search off will still return a full company profile — entirely invented.

Gating everything. Approval on every tool call means a human confirms every read, and the flow gets switched off within a week. Gate writes only.

Scoring rules buried in a prompt. Put them in a skill so the people who own the definition can change it.

No disqualified tier. Without an explicit disqualified outcome, the model spreads bad leads across B and C and the tiers lose meaning.

Studio · Pulse — Cognipeer product documentation