Skip to main content

Lead Qualification Automation

Turn inbound leads into qualified opportunities automatically. In this guide, you’ll build a conversational AI that engages new leads, asks qualifying questions, scores them, and creates records in your CRM — all without human intervention. What you’ll build: A complete lead qualification system that:
  • Engages leads via web chat, email, or SMS
  • Collects company size, budget, timeline, and use case
  • Scores leads based on your criteria
  • Creates contacts in HubSpot (or your CRM)
  • Routes hot leads to sales immediately
Time: 30-45 minutes

Prerequisites


The Business Problem

Your website generates leads, but your sales team wastes time on unqualified prospects. You need:
  1. Immediate engagement — Respond to leads instantly, 24/7
  2. Consistent qualification — Ask the same questions every time
  3. Automatic scoring — Prioritize based on fit, not gut feeling
  4. CRM sync — No manual data entry
Traditional chatbots feel robotic. Human qualification doesn’t scale. CogniAgent gives you the best of both: natural conversation that captures structured data.

Architecture Overview


Step 1: Create the Application

1

Create application

Create a new application called “Lead Management”.
2

Create workflow

Create a workflow called “Lead Qualifier”.

Step 2: Set Up the Trigger

We’ll use a webhook to receive leads from your website form.
1

Add Webhook trigger

Drag a Webhook node onto the canvas.
2

Copy the webhook URL

The node will show a unique URL. You’ll configure your website form to POST to this URL.
3

Configure expected data

Set up the expected payload structure:
{
  "name": "string",
  "email": "string",
  "company": "string",
  "source": "string"
}
For testing, use the webhook URL with a tool like Postman or curl to send test leads.

Step 3: Build the Qualification Skillset

This is the core of your lead qualification. The skillset defines what questions to ask and how to ask them.
1

Add Ask a Person node

Drag an Ask a Person node and connect it to the webhook.
  • Name: “Lead Qualification”
  • Key: lead_qual
2

Configure the skillset

Create a skillset with this configuration:
{
  "agentId": "lead-qualifier",
  "name": "Lead Qualification",
  "description": "Qualify inbound leads through natural conversation",

  "persona": {
    "agentName": "Alex",
    "organization": "{{company_name}}",
    "tone": "Professional yet friendly. Genuinely curious about their business challenges. Not pushy or salesy."
  },

  "inputVariables": [
    {
      "name": "company_name",
      "description": "Our company name",
      "defaultValue": "Acme Corp"
    },
    {
      "name": "lead_name",
      "description": "The lead's name from the form"
    },
    {
      "name": "lead_company",
      "description": "The lead's company from the form"
    }
  ],

  "settings": {
    "maxFieldAttempts": 3,
    "maxConsecutiveClarifications": 3,
    "requireConfirmation": true
  },

  "formFieldsMapping": {
    "company_size": {
      "template": {
        "id": "company_size",
        "name": "Company Size",
        "description": "Number of employees at their company",
        "type": "selection",
        "options": ["1-10", "11-50", "51-200", "201-1000", "1000+"],
        "required": true
      }
    },
    "annual_budget": {
      "template": {
        "id": "annual_budget",
        "name": "Annual Budget",
        "description": "Their budget range for this type of solution",
        "type": "selection",
        "options": ["Under $10k", "$10k-$50k", "$50k-$100k", "$100k-$500k", "Over $500k"],
        "required": true
      }
    },
    "timeline": {
      "template": {
        "id": "timeline",
        "name": "Timeline",
        "description": "When they're looking to make a decision or implement",
        "type": "selection",
        "options": ["Immediately", "1-3 months", "3-6 months", "6-12 months", "Just researching"],
        "required": true
      }
    },
    "use_case": {
      "template": {
        "id": "use_case",
        "name": "Primary Use Case",
        "description": "What problem they're trying to solve or what they want to accomplish",
        "type": "text",
        "required": true
      }
    },
    "current_solution": {
      "template": {
        "id": "current_solution",
        "name": "Current Solution",
        "description": "What they're currently using to solve this problem, if anything",
        "type": "text",
        "required": false
      }
    },
    "decision_maker": {
      "template": {
        "id": "decision_maker",
        "name": "Decision Authority",
        "description": "Whether they can make the purchasing decision or need to involve others",
        "type": "selection",
        "options": ["I make the decision", "I influence the decision", "I'm researching for someone else"],
        "required": true
      }
    }
  }
}
3

Map input variables

Pass the webhook data to the skillset:
{
  "lead_name": "{{webhook_1.body.name}}",
  "lead_company": "{{webhook_1.body.company}}"
}

Why These Fields?

FieldQualification Signal
Company SizeLarger companies = bigger deals
BudgetDirect indicator of purchasing power
Timeline”Immediately” = hot lead
Use CaseValidates product fit
Current SolutionShows pain level and switching potential
Decision MakerDetermines if you’re talking to the right person

Step 4: Score the Lead

After the conversation, use AI to calculate a lead score.
1

Add Ask AI node

Connect an Ask AI node to the event handle of Ask a Person.
  • Name: “Score Lead”
  • Key: lead_score
2

Configure the scoring prompt

You are a lead scoring expert. Based on the qualification data below,
assign a lead score from 0-100 and categorize as HOT, WARM, or COLD.

Scoring criteria:
- Company size 201+ employees: +20 points
- Company size 51-200: +15 points
- Company size 11-50: +10 points
- Budget $50k+: +25 points
- Budget $10k-$50k: +15 points
- Timeline "Immediately": +25 points
- Timeline "1-3 months": +15 points
- Decision maker: +15 points
- Decision influencer: +10 points

Lead Data:
- Company: {{webhook_1.body.company}}
- Company Size: {{lead_qual.collectedData.company_size}}
- Budget: {{lead_qual.collectedData.annual_budget}}
- Timeline: {{lead_qual.collectedData.timeline}}
- Use Case: {{lead_qual.collectedData.use_case}}
- Current Solution: {{lead_qual.collectedData.current_solution}}
- Decision Authority: {{lead_qual.collectedData.decision_maker}}

Respond in JSON format:
{
  "score": <number 0-100>,
  "category": "<HOT|WARM|COLD>",
  "reasoning": "<one sentence explanation>"
}
3

Set output format

Set the output format to JSON so you can use the structured response.

Step 5: Route by Score

Different scores get different treatment.
1

Add Multi-Condition node

Add a Multi-Condition (Switch) node after the scoring.
2

Configure conditions

Create three branches:Branch 1: HOT
{{lead_score.response.category}} == "HOT"
Branch 2: WARM
{{lead_score.response.category}} == "WARM"
Branch 3: COLD (default)
Otherwise

Step 6: Set Up CRM Integration

All leads go to your CRM. We’ll use HubSpot, but the pattern works for any CRM.
1

Add App Action for each branch

Add an App Action node to each branch:
  • App: HubSpot
  • Action: Create Contact
2

Configure contact creation

Map the fields:
{
  "email": "{{webhook_1.body.email}}",
  "firstname": "{{webhook_1.body.name}}",
  "company": "{{webhook_1.body.company}}",
  "company_size": "{{lead_qual.collectedData.company_size}}",
  "budget_range": "{{lead_qual.collectedData.annual_budget}}",
  "timeline": "{{lead_qual.collectedData.timeline}}",
  "lead_score": "{{lead_score.response.score}}",
  "lead_category": "{{lead_score.response.category}}",
  "use_case": "{{lead_qual.collectedData.use_case}}",
  "lead_source": "{{webhook_1.body.source}}"
}

Step 7: Alert Sales for Hot Leads

Hot leads need immediate attention.
1

Add Slack notification

On the HOT branch, after creating the HubSpot contact, add an App Action:
  • App: Slack
  • Action: Send Message
  • Channel: #sales-alerts
2

Configure the message

🔥 *HOT LEAD ALERT* 🔥

*{{webhook_1.body.name}}* from *{{webhook_1.body.company}}* just qualified!

*Score:* {{lead_score.response.score}}/100
*Budget:* {{lead_qual.collectedData.annual_budget}}
*Timeline:* {{lead_qual.collectedData.timeline}}
*Use Case:* {{lead_qual.collectedData.use_case}}

{{lead_score.response.reasoning}}

<{{hubspot_contact_url}}|View in HubSpot>

Step 8: Add to Nurture for Warm Leads

Warm leads get added to an email nurture sequence.
1

Add nurture enrollment

On the WARM branch, after CRM creation, add another App Action:
  • App: HubSpot
  • Action: Add to List (or Enroll in Sequence)
2

Configure enrollment

Add to your nurture list or sequence ID.

Complete Workflow

Your final workflow should look like:

Testing Your Workflow

1

Send a test lead

Use curl or Postman to send a test lead:
curl -X POST https://your-webhook-url \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Smith",
    "email": "[email protected]",
    "company": "BigCorp Inc",
    "source": "website-demo-form"
  }'
2

Complete the qualification

Open the chat/email and answer the qualification questions as a hot lead:
  • Company size: 201-1000
  • Budget: 100k100k-500k
  • Timeline: Immediately
  • Use case: “Automate customer support”
  • Decision maker: “I make the decision”
3

Verify the results

Check:
  • HubSpot contact was created with all fields
  • Slack alert was sent to #sales-alerts
  • Lead score is calculated correctly

Customization Ideas

Add Calendar Booking for Hot Leads

After Slack notification, add a booking link:

Multi-Channel Support

Let leads qualify through their preferred channel:
{
  "channels": ["web_widget", "email", "sms"],
  "channelPriority": "user_preference"
}

Add Knowledge Base

Let the AI answer product questions during qualification:
{
  "knowledgeBaseId": "kb_product_info"
}
The AI will search your knowledge base when leads ask questions.

Custom Scoring Rules

Adjust scoring based on your ideal customer profile. If you sell to enterprise:
- Company size 1000+: +30 points
- Company size 201-1000: +20 points
- Company size under 50: +0 points

Metrics to Track

Once deployed, monitor:
MetricWhat It Tells You
Qualification completion rateAre leads finishing the conversation?
Average conversation lengthIs the AI being efficient?
Score distributionAre you getting quality leads?
Sales conversion by scoreIs your scoring accurate?
Time to first responseHow fast are you engaging leads?

Troubleshooting

Check if there are too many required fields. Consider making some optional. Also review conversation logs — are users getting confused or frustrated?
Review your scoring criteria. The AI follows your rules exactly. If results seem off, adjust the point values or add new criteria.
Verify the HubSpot property names match exactly. Custom properties need to be created in HubSpot first.
Check that the Slack integration has permission to post to the channel. Also verify the channel name is correct (with #).

Next Steps