May 7, 2026Ceren Kaya Akgün
How to Build an AI Lead Qualification Agent in Heym
Build an AI lead qualification agent: scores leads 1-10, routes hot prospects to Slack, sends personalized cold emails. No code. Start in 10 minutes.
TL;DR: Build an AI lead qualification agent in Heym by cloning the AI Lead Qualification Agent template, rewriting the LLM system prompt with your ICP, and connecting a Slack credential. The workflow scores every lead 1-10, sends hot leads to your sales channel, and logs cold leads for nurturing. Add the Cold Email AI Outreach template to automatically send personalized emails to every lead that scores below your threshold.
Definition: AI lead qualification is the use of a large language model to evaluate each inbound lead against a defined Ideal Customer Profile and return a numeric fit score (1-10) with a rationale. The score routes high-fit leads to sales instantly and low-fit leads to a nurturing sequence, replacing manual SDR review.
Key Takeaways:
- Heym's AI Lead Qualification Agent scores leads with a single LLM call and routes them via a Condition node with zero code
- The ScoreLead LLM node uses
outputType: jsonandtemperature: 0.1so scores are deterministic and machine-readable- The Condition expression
$ScoreLead.json.score >= 7controls the hot/cold split and is fully adjustable- The Cold Email AI Outreach template reads prospects from Google Sheets, writes personalized 3-sentence emails with an LLM, and sends them on a weekday cron schedule
- Combining both templates creates a full inbound-to-outreach pipeline that runs without human intervention
Table of Contents
- What Is AI Lead Qualification?
- Why Manual Lead Scoring Breaks Down at Scale
- How the AI Lead Qualification Agent Works
- Building the Agent: Step by Step
- Automating Cold Email Outreach for Every Lead
- Customizing Your ICP Scoring Criteria
- Combining Both Workflows into a Full Pipeline
- Real-World Use Cases
- FAQ
What Is AI Lead Qualification?
Ceren Kaya Akgün is a software engineer at Heym who builds and maintains AI workflow automation pipelines. Everything in this guide reflects features available in Heym today.
Heym is a visual AI workflow automation platform. Workflows are built by connecting nodes on a canvas — no code required. Heym is used by engineering and sales ops teams to automate pipelines that combine LLMs, APIs, databases, and messaging tools.
AI lead qualification is the use of a large language model to evaluate each incoming lead against your Ideal Customer Profile and assign a numerical fit score, replacing the manual review step that SDRs and sales engineers spend hours on every week.
"AI lead qualification compresses manual SDR review from minutes to under 3 seconds by sending structured lead data to an LLM that scores fit 1-10 and returns a JSON object with a rationale, enabling instant automatic routing."
A traditional lead qualification workflow looks like this: a prospect fills out a demo form, the submission lands in a CRM or spreadsheet, a sales rep opens each row and decides whether to follow up. The decision is subjective, inconsistent across reps, and slow. High-intent leads often wait 30 to 60 minutes before anyone reaches out. That delay matters: research from InsideSales.com found that contacting a lead within 5 minutes vs. 30 minutes increases qualification rate by 21x (InsideSales.com).
An AI lead qualification agent compresses that review to under 3 seconds. The workflow receives the lead's name, company, role, and use-case description, sends them to an LLM with a structured ICP prompt, and routes the result based on a numeric score. Hot leads go to Slack instantly; cold leads enter a nurturing sequence.
Why Manual Lead Scoring Breaks Down at Scale
Manual lead qualification has three failure modes that compound as your pipeline grows.
Inconsistency. Two SDRs applying the same ICP criteria will score the same lead differently on different days. Attention fatigue, personal biases, and shifting priorities create scoring drift that no playbook fully eliminates. An LLM with a fixed system prompt scores identically every time.
Speed. HubSpot's 2024 State of Sales report found that sales reps spend only 34% of their time actually selling, with the rest going to administrative tasks including manual qualification and data entry (HubSpot, 2024). Every hour a rep spends reviewing inbound submissions is an hour not spent on closing conversations.
Scale. When inbound volume grows — from a content campaign, a product launch, or a new paid channel — the qualification bottleneck grows with it. Hiring more SDRs to handle qualification volume is expensive and slow. An AI agent scales to any volume without incremental headcount cost.
McKinsey's 2025 State of AI survey found that 65% of organizations now use AI in at least one business function, up from 55% a year earlier, and sales automation is among the fastest-growing adoption categories (McKinsey, 2025). Teams that adopt AI lead qualification now are building a repeatable process that compounds as their pipeline grows.
"An LLM with a fixed ICP prompt scores leads with perfect consistency — the same lead submitted twice receives the same score — eliminating the scoring drift that affects every human reviewer."
"Teams that qualify leads within 5 minutes of submission are 21 times more likely to connect than those who wait 30 minutes, according to InsideSales.com research. An AI qualification agent makes sub-5-minute qualification the default, not the exception."
How the AI Lead Qualification Agent Works
Heym's AI Lead Qualification Agent template is a six-node workflow. Here is the execution path:
LeadInfo → ScoreLead → IsHotLead → HotLeadAlert → HotLeadLogged
→ ColdLeadLogEach node has a specific role:
LeadInfo is a Text Input node that accepts four fields: userName, company, role, and use_case. In production, you replace this trigger with a Webhook node that receives form submissions from your website, CRM, or any HTTP-capable source.
ScoreLead is an LLM node configured with outputType: json and temperature: 0.1. The low temperature setting ensures deterministic, consistent scoring. The system instruction contains your ICP definition; the user message passes the lead's details as a structured string using Heym's $ expression syntax:
Name: $LeadInfo.body.userName
Company: $LeadInfo.body.company
Role: $LeadInfo.body.role
Use case: $LeadInfo.body.use_caseThe LLM returns a compact JSON object:
{ "score": 8, "rationale": "Senior engineering role at a mid-market SaaS company with a specific ops automation pain point." }IsHotLead is a Condition node that evaluates $ScoreLead.json.score >= 7. Heym parses the JSON response automatically, so you reference nested fields directly with dot notation. The condition branches the workflow into a hot path (true) and a cold path (false).
HotLeadAlert is a Slack node that fires on the hot path. It sends a formatted message to your #sales channel:
Hot lead (score $ScoreLead.json.score/10)
*$LeadInfo.body.userName* — $LeadInfo.body.company ($LeadInfo.body.role)
Rationale: $ScoreLead.json.rationaleHotLeadLogged and ColdLeadLog are Output nodes that record the result. You can replace them with Database Query nodes, Google Sheets nodes, or HTTP Request nodes to push the scored lead into your CRM.
The entire round trip from lead submission to Slack notification takes under 4 seconds in production.
Building the Agent: Step by Step
Step 1: Clone the Template
Open Heym, navigate to Templates, and search for AI Lead Qualification Agent. Click Use Template. Heym copies the complete workflow onto your canvas with all nodes pre-wired. You will see the sticky notes with setup instructions, the main flow, and the guide note showing the execution path.
Step 2: Rewrite the System Instruction with Your ICP
Click the ScoreLead node to open its configuration panel. The default system instruction reads:
You are a B2B sales analyst. Score the lead fit for an AI workflow automation platform on a scale of 1-10 based on role seniority, company size signal, and use-case alignment. Return ONLY valid JSON:
{"score": <number>, "rationale": "<one sentence>"}.
Replace the italicized description with your own ICP. Be specific. A vague ICP like "companies that need automation" produces noisy scores. A precise ICP like "Series A to Series C SaaS companies, 50-500 employees, engineering or DevOps leadership roles, actively reducing manual ops workload" produces scores that correlate with your actual close rates.
Keep the JSON output instruction at the end unchanged. The IsHotLead Condition node depends on the score field being present and numeric.
Step 3: Set the Score Threshold
Click the IsHotLead Condition node. The default expression is:
$ScoreLead.json.score >= 7Adjust the threshold to match your sales team's definition of a qualified lead. A threshold of 7 is a reasonable starting point for most B2B pipelines. Raise it to 8 or 9 if you are optimizing for close rate over volume; lower it to 6 if you want your sales team to see more leads and qualify further in conversation.
Step 4: Connect Slack
Click the HotLeadAlert Slack node. Select Add Credential and authenticate with your Slack workspace using OAuth. Set the channel field to the channel where your sales team monitors notifications. The message template is already configured with the score, name, company, role, and rationale. You can edit the message format directly in the node's configuration panel using $ expressions.
Step 5: Replace the Trigger with a Webhook
For production use, replace the LeadInfo Text Input node with a Webhook trigger node. Copy the webhook URL from the node configuration and paste it into your website's form handler, your CRM's outbound webhook settings, or any tool that sends form data via HTTP POST. The workflow will fire automatically for every new submission.
Step 6: Test and Inspect the Debug Panel
Click Run with the Text Input trigger active. Enter a lead that clearly matches your ICP and one that does not. After each run, open the Debug Panel and click the ScoreLead node to verify the JSON output. Check that score is a number between 1 and 10 and that rationale is a coherent one-sentence explanation. If the score feels off, the system instruction needs a more specific ICP definition — this is the most common tuning step.
Automating Cold Email Outreach for Every Lead
Once you have the qualification workflow running, the natural next step is to automate outreach for the cold leads. Heym's Cold Email AI Outreach template handles this with five nodes:
WeekdayMorning (Cron) → ReadLeads (Google Sheets) → IterateLeads (Loop)
→ PersonalizeEmail (LLM) → SendToLead (Email)
→ SentCount (Output)The Cron trigger fires every weekday at 09:00 using the expression 0 9 * * 1-5. The ReadLeads Google Sheets node reads the next batch of uncontacted leads from a spreadsheet. The IterateLeads Loop node processes each row independently. For every row, the PersonalizeEmail LLM node generates a short, personalized email body using the lead's name, company, and pain point:
Name: $IterateLeads.item.name
Company: $IterateLeads.item.company
Pain point: $IterateLeads.item.pain_pointThe LLM system instruction is tuned for brevity and specificity. For a deeper look at how prompt design affects LLM output quality, see the guide on prompt chaining — the same principles of clear role definition and structured output apply here.
You are a B2B sales copywriter. Write a short cold email (3 sentences max) that is personal, specific to the company and pain point, and ends with one clear call to action. Plain text only, no subject line, no greeting line.
The SendToLead Email node sends the generated body via your SMTP credential. The default subject line is Quick question about $IterateLeads.item.company. You can customize it, but short, non-salesy subjects consistently outperform longer ones in outbound deliverability testing.
Setting up the Google Sheet. Create a sheet with four columns: name, company, pain_point, and email. The pain_point column is the most important. A specific entry like "manually monitoring 12 Slack channels for customer mentions" will produce a noticeably better email than "needs automation." You can add additional columns and reference them in the LLM user message using $IterateLeads.item.yourColumn.
Connecting credentials. Click the ReadLeads node, select your Google OAuth credential, and paste your spreadsheet ID and sheet name. Click the SendToLead node and add your SMTP credential (Gmail app password, SendGrid SMTP, or any compatible provider).
Customizing Your ICP Scoring Criteria
The system instruction in the ScoreLead node is the most important tuning lever in the entire workflow. Here is a pattern for writing an effective ICP definition:
You are a B2B sales analyst. Score the lead fit for [your product] on a scale of 1-10.
High-fit signals (score 8-10):
- Role: [specific titles, e.g. Head of Engineering, VP Operations, CTO]
- Company size: [e.g. 50-500 employees, Series A to Series C]
- Industry: [e.g. SaaS, fintech, developer tools]
- Use case: [e.g. automating internal operations, reducing manual ops toil, replacing hand-built Python scripts]
Low-fit signals (score 1-4):
- Role: [e.g. student, freelancer, individual contributor with no budget authority]
- Company size: [e.g. solo founder, enterprise > 5000 employees with procurement gates]
- Use case: [e.g. consumer app, hardware, regulatory-only workflows]
Return ONLY valid JSON: {"score": <number>, "rationale": "<one sentence>"}.A few implementation notes. The temperature is set to 0.1, which minimizes randomness and produces consistent scores for identical inputs. Avoid using temperature above 0.3 on this node, as you want deterministic routing, not creative variation. The outputType: json setting in Heym tells the runtime to parse the response as JSON automatically, which is why you can reference $ScoreLead.json.score directly in the Condition node without a separate parsing step.
Combining Both Workflows into a Full Pipeline
The qualification and outreach workflows are independent by design, which makes them easier to maintain separately. But you can connect them for a fully automated pipeline.
After the ColdLeadLog Output node in the qualification workflow, add an HTTP Request node that sends a POST to the Cold Email AI Outreach workflow's webhook URL. Pass the lead's name, company, pain point, and email as the request body. The outreach workflow picks up the lead and processes it on its next cron run, or you can modify the outreach workflow to use a Webhook trigger instead of a Cron trigger for real-time delivery.
This creates a two-stage pipeline: every inbound lead is scored, hot leads go to your sales team immediately, and cold leads enter an automated personalized outreach sequence. The sales team only sees leads that are already qualified; the LLM handles the rest.
For more complex routing scenarios such as routing medium-scoring leads to a different sequence than low-scoring leads, you can chain multiple Condition nodes or use a Switch node to create three or more routing paths from a single score.
Real-World Use Cases
Inbound demo request triage. Connect the Webhook trigger to your website's "Book a demo" form. Every submission is scored against your ICP within seconds. Your sales team's Slack channel shows only the leads worth an immediate call. Response time drops from hours to under 5 minutes for hot leads, which directly affects show rate.
Outbound sequence prioritization. Export a CRM segment or a LinkedIn Sales Navigator list as a spreadsheet. Run every contact through the qualification workflow before building an outreach sequence. The LLM score replaces manual ICP review, and in our experience, teams consistently report spending significantly less time on list qualification compared to manual review.
Re-engagement campaigns. Pull lapsed customers from your CRM (for example, those who haven't logged in for 90 days). Run them through a modified qualification workflow that scores re-engagement fit instead of initial fit. High-scoring dormant accounts go to your customer success team; others enter the Cold Email AI Outreach sequence with a re-engagement angle.
Lead enrichment handoff. Combine the AI Lead Qualification Agent with a web fetch node that retrieves the company's LinkedIn or Crunchbase profile before the LLM call. The enriched context produces more accurate scores because the LLM has funding stage, headcount, and recent news in addition to the form fields.
You can try both templates today: the AI Lead Qualification Agent and the Cold Email AI Outreach templates are ready to clone. Each takes under 10 minutes to configure for your ICP and credential setup.
To learn more about building agents with persistent memory and tool access, see the guide on how to build an AI agent. For a broader look at what kinds of tasks AI agents handle well, the AI agent use cases post covers 12 production examples. For pipelines that involve multiple coordinated agents, the multi-agent AI systems guide explains the orchestrator-worker pattern in detail. For understanding how LLMs coordinate multi-step tasks in a workflow, the LLM orchestration guide is the next logical read.
FAQ
What is AI lead qualification?
AI lead qualification is the process of using a large language model to evaluate each inbound or outbound lead against your Ideal Customer Profile and return a numerical fit score. The LLM reads structured lead data (name, company, role, use case) and outputs a score from 1 to 10 with a short rationale. The score then drives automatic routing: high-scoring leads go to your sales team instantly, low-scoring leads go to a nurturing queue. This replaces the manual review step that SDRs spend several hours per day on.
How accurate is LLM-based lead scoring?
LLM scoring is highly consistent — the same lead scored twice with the same system prompt will receive the same score every time. Accuracy against your actual close rate depends entirely on the quality of your ICP definition in the system prompt. Most teams see meaningful correlation with close rate after 2 to 3 sales cycles of adjusting the ICP criteria based on which scored leads actually closed. Starting with a specific ICP beats a generic one from the first run.
Can I adjust the hot lead threshold in Heym?
Yes. Edit the expression in the IsHotLead Condition node. The default is $ScoreLead.json.score >= 7. Change 7 to any integer between 1 and 10. Teams with a longer sales cycle and a need for high-quality leads typically set this at 8 or 9. Teams optimizing for pipeline volume with inside sales follow-up often use 6.
What data does the Cold Email Outreach template need?
The Google Sheet must have four columns: name, company, pain_point, and email. The pain_point column drives personalization. A specific, one-sentence pain point like "manually copying data between five internal tools every morning" will produce a much better email than a generic entry. You can add any additional columns to your sheet and reference them in the LLM user message.
Do I need coding experience to set this up?
No. Both templates run entirely on Heym's visual canvas. The LLM system prompt is a plain-text field, credentials are connected through guided OAuth flows, and the score threshold is a single expression in a Condition node. There is no code to write, no framework to install, and no deployment to manage.

Founding Engineer
Ceren is a founding engineer at Heym, working on AI workflow orchestration and the visual canvas editor. She writes about AI automation, multi-agent systems, and the practitioner experience of building production LLM pipelines.