What This Agent Does
This intelligent lead qualification workflow automatically captures, enriches, scores, and routes incoming leads based on their potential value to your business. When a prospect submits their information through your lead form, the system instantly enriches their data with additional company and contact information, assigns a qualification score using AI, and then automatically updates your CRM and notifies your team—all without manual intervention.
Key benefits include:
-
Save 15-20 minutes per lead by eliminating manual research and data entry
-
Improve lead response time from hours to seconds with instant qualification
-
Increase conversion rates by ensuring high-value leads receive immediate attention
-
Maintain data consistency across your CRM with automated enrichment and updates
This workflow is perfect for B2B sales teams handling inbound leads, marketing teams managing lead generation campaigns, and growth teams looking to scale their lead qualification process without adding headcount.
Who Is It For
This automation is designed for:
-
Sales Development Representatives (SDRs) who need to quickly identify and prioritize high-quality leads
-
Marketing Operations teams managing lead flow from campaigns to sales
-
Small to mid-size B2B companies (10-500 employees) looking to automate their lead qualification process
-
Sales managers who want consistent, objective lead scoring across their team
-
Revenue operations professionals focused on optimizing the lead-to-opportunity conversion funnel
You'll get the most value from this workflow if you're currently spending significant time manually researching leads, struggling with inconsistent lead qualification, or missing opportunities due to slow response times.
Required Integrations
OpenAI
Why it's needed: OpenAI powers the intelligent lead enrichment and scoring agents that analyze your leads and assign qualification scores based on your criteria.
Setup steps:
- Visit platform.openai.com and create an account or sign in
- Navigate to the API section in your account dashboard
- Click "Create new secret key" and give it a descriptive name like "TaskAGI Lead Qualification"
-
Important: Copy the API key immediately—you won't be able to see it again
- Set up billing in your OpenAI account (the workflow uses GPT-4o, which requires a paid account)
Configuration in TaskAGI:
- Go to Integrations in your TaskAGI dashboard
- Click Add Integration and select OpenAI
- Paste your API key in the authentication field
- Click Test Connection to verify
- Save the integration
Cost estimate: Approximately $0.02-0.05 per lead processed, depending on data complexity.
HubSpot
Why it's needed: HubSpot serves as your central CRM where contact and company records are created, updated, and maintained with enriched lead data.
Setup steps:
- Log into your HubSpot account (works with Free, Starter, Professional, or Enterprise tiers)
- Click your account name in the top-right corner and select Integrations
- Navigate to Private Apps (or search for it in settings)
- Click Create a private app
- Name it "TaskAGI Lead Workflow" and add a description
- Under the Scopes tab, enable these permissions:
-
crm.objects.contacts.read
-
crm.objects.contacts.write
-
crm.objects.companies.read
-
crm.objects.companies.write
- Click Create app and copy the access token
Configuration in TaskAGI:
- Navigate to Integrations in TaskAGI
- Select Add Integration → HubSpot
- Paste your private app access token
- Click Test Connection to verify access
- Save the integration
Note: Ensure your HubSpot account has custom properties set up for lead scores if you want to track historical scoring data.
Slack
Why it's needed: Slack enables real-time notifications to your sales team when qualified leads are identified, ensuring immediate follow-up on hot prospects.
Setup steps:
- Go to api.slack.com/apps and click Create New App
- Select From scratch and name it "TaskAGI Lead Alerts"
- Choose the workspace where you want notifications
- Navigate to OAuth & Permissions in the sidebar
- Scroll to Scopes and add these Bot Token Scopes:
-
chat:write
-
chat:write.public
- Click Install to Workspace at the top of the page
- Authorize the app and copy the Bot User OAuth Token (starts with
xoxb-)
Configuration in TaskAGI:
- Go to Integrations in TaskAGI
- Click Add Integration → Slack
- Paste your Bot User OAuth Token
- Test by selecting a channel from the dropdown
- Save the integration
Pro tip: Create a dedicated channel like #qualified-leads for these notifications to keep them organized.
Configuration Steps
Step 1: Configure the Lead Form Trigger
The Lead Form node is your workflow's entry point. Configure it to capture:
-
Email (required) - Primary identifier for lead matching
-
First Name and Last Name - For personalization
-
Company Name - Used for enrichment
-
Phone (optional) - Additional contact method
-
Website - Critical for company domain matching
Set the form URL to your landing page or embed it directly on your website. The trigger activates instantly when a form is submitted.
Step 2: Set Up Lead Enricher Agent
The Lead Enricher Agent uses GPT-4o to enhance your lead data with additional information:
- Select gpt-4o as the model (required for optimal enrichment)
- Configure the system prompt to define what data to enrich (company size, industry, technologies used, etc.)
- Map the form fields as input:
{{trigger.email}}, {{trigger.company}}, {{trigger.website}}
- Set temperature to
0.3 for consistent, factual responses
Example prompt structure:
Enrich this lead with company information including employee count,
industry, annual revenue estimate, and technology stack.
Return as structured JSON.
Step 3: Parse Enrichment Data
The Parse Enrichment Data node converts the AI response into structured data:
- Set the input to
{{lead_enricher_agent.output}}
- Define the expected JSON schema with fields like:
-
company_size
-
industry
-
estimated_revenue
-
technologies
- Enable strict parsing to catch formatting errors
Step 4: Configure Lead Scoring Agent
The Lead Scoring Agent evaluates lead quality using your criteria:
- Model: gpt-4o (already configured)
- Input the enriched data:
{{parse_enrichment_data.output}}
- Customize the scoring prompt based on your ideal customer profile (ICP)
- Request a score from 0-100 with reasoning
Example scoring criteria:
- Company size: 50-500 employees (+30 points)
- Industry match: SaaS, Technology (+25 points)
- Revenue: $5M-$50M (+25 points)
- Technology stack alignment (+20 points)
Set temperature to 0.2 for consistent scoring.
Step 5: Set Up the Lead Score Condition
The Check Lead Score node routes leads to qualified or not-qualified paths:
- Condition type: Number comparison
- Value to check:
{{lead_scoring_agent.score}}
- Operator: Greater than or equal to
- Threshold:
70 (adjust based on your qualification criteria)
Leads scoring 70+ follow the "qualified" path; others follow the "not qualified" path.
Step 6: Configure Qualified Lead Path
For qualified leads, three actions occur in sequence:
Create/Update Contact (Qualified):
- Email:
{{trigger.email}}
- First name:
{{trigger.first_name}}
- Last name:
{{trigger.last_name}}
- Lead score:
{{lead_scoring_agent.score}}
- Lead status: Set to "Qualified"
Search Company (Qualified):
- Search by domain extracted from
{{trigger.website}}
- This finds existing company records to avoid duplicates
Update Company (Qualified):
- Company ID:
{{search_company.company_id}}
- Update fields with enriched data from parsing step
- Add tags like "AI-Qualified" for segmentation
Notify Team (Qualified Lead):
- Channel: Your designated qualified leads channel
- Message template:
🔥 New Qualified Lead! Score: {{lead_scoring_agent.score}}
Name: {{trigger.first_name}} {{trigger.last_name}}
Company: {{trigger.company}}
Email: {{trigger.email}}
Reasoning: {{lead_scoring_agent.reasoning}}
Step 7: Configure Not Qualified Lead Path
For leads below the threshold, follow similar steps but with different handling:
Create/Update Contact (Not Qualified):
- Same fields as qualified, but set lead status to "Nurture"
Search Company (Not Qualified):
Update Company (Not Qualified):
- Update with enriched data
- Add tags like "Needs-Nurturing"
These leads skip the Slack notification but are still captured in your CRM for future nurturing campaigns.
Testing Your Agent
Running Your First Test
- Click Test Workflow in the top-right corner of the workflow editor
- Fill out the test form with realistic data:
- Use a real company website for accurate enrichment
- Try both a high-quality lead (matches your ICP) and a low-quality lead
- Click Submit and watch the execution in real-time
Verification Checklist
After Lead Enricher Agent:
- ✅ Verify enriched data includes company size, industry, and relevant details
- ✅ Check that the data format is consistent and complete
After Lead Scoring:
- ✅ Confirm the score is between 0-100
- ✅ Review the reasoning to ensure it aligns with your criteria
- ✅ Test edge cases (missing data, unclear company info)
After Condition Split:
- ✅ Verify high-scoring leads (70+) follow the qualified path
- ✅ Confirm low-scoring leads take the not-qualified path
In HubSpot:
- ✅ Check that the contact was created/updated with correct information
- ✅ Verify the company record exists and is properly linked
- ✅ Confirm enriched data populated the right fields
In Slack:
- ✅ Ensure qualified lead notifications appear in the correct channel
- ✅ Verify all data fields display properly in the message
- ✅ Confirm no notifications sent for unqualified leads
Expected Results
A successful execution should complete in 15-30 seconds with all nodes showing green checkmarks. You should see:
- One new/updated contact in HubSpot
- One new/updated company record
- One Slack notification (if qualified)
- Complete enrichment data in all fields
Troubleshooting
"OpenAI API Error: Insufficient Quota"
Problem: Your OpenAI account doesn't have credits or billing isn't set up.
Solution:
- Visit platform.openai.com/account/billing
- Add a payment method and purchase credits
- Wait 5-10 minutes for activation
- Retry the workflow
"HubSpot: Contact Already Exists" Error
Problem: The workflow is trying to create a contact that already exists, and you haven't enabled the update option.
Solution:
- Open the HubSpot contact creation node
- Enable "Create or Update" mode instead of "Create only"
- Set the unique identifier to email address
- Save and retest
Enrichment Returns Incomplete Data
Problem: The Lead Enricher Agent returns partial or missing information.
Solution:
- Ensure the website URL is valid and accessible
- Check that the company has a public web presence
- Adjust the enrichment prompt to be more flexible with missing data
- Add fallback values in the parsing step for optional fields
Lead Score Always Returns Same Value
Problem: All leads receive similar scores regardless of quality.
Solution:
- Review your scoring prompt for specificity
- Ensure you're passing all enriched data to the scoring agent
- Lower the temperature setting to 0.1 for more deterministic results
- Add more distinct scoring criteria that differentiate your ICP
Slack Notifications Not Appearing
Problem: Qualified leads aren't triggering Slack messages.
Solution:
- Verify the Slack bot is added to the target channel (type
/invite @TaskAGI Lead Alerts)
- Check that the bot has
chat:write permissions
- Confirm the channel name is spelled correctly
- Test the Slack integration independently using the Test button
Company Search Returns No Results
Problem: The workflow can't find the company in HubSpot.
Solution:
- Verify the domain extraction is working correctly
- Check if the company exists in HubSpot with that exact domain
- Add a fallback to create a new company if search returns empty
- Ensure the domain format is clean (no http://, www., or trailing slashes)
Next Steps
Immediate Actions After Setup
-
Run 10-20 test leads with varying quality levels to calibrate your scoring threshold
-
Monitor the first 50 real leads closely and adjust scoring criteria based on sales feedback
-
Set up a weekly review of qualified vs. not-qualified leads to refine your ICP definition
-
Create a nurture campaign in HubSpot for leads that didn't qualify initially
Optimization Suggestions
Refine Your Scoring Model:
- After 100 leads, analyze which scored leads actually converted
- Adjust point values for different criteria based on conversion data
- Consider adding negative scoring for disqualifying factors (competitors, students, etc.)
Enhance Enrichment:
- Add social media profile enrichment (LinkedIn, Twitter)
- Include recent company news or funding information
- Integrate with additional data providers like Clearbit or ZoomInfo
Improve Team Workflow:
- Add automatic task creation in HubSpot for qualified leads
- Set up round-robin assignment to distribute leads fairly
- Create custom Slack buttons for "Contacted" or "Not Interested" quick actions
Scale Your Process:
- Duplicate this workflow for different lead sources (webinars, content downloads, demo requests)
- Create source-specific scoring models
- Build a dashboard to track qualification rates and conversion metrics
Advanced Usage Tips
A/B Test Your Scoring: Create two versions of the workflow with different scoring thresholds (e.g., 70 vs. 80) and compare conversion rates after 30 days.
Add Lead Routing: Extend the qualified path to assign leads to specific sales reps based on territory, industry, or company size.
Implement Lead Decay: Set up a follow-up workflow that reduces lead scores over time if there's no engagement, automatically moving them to nurture status.
Create Feedback Loops: Add a monthly workflow that asks sales reps to rate lead quality, then use that data to retrain your scoring criteria.
Build a Lead Intelligence Dashboard: Export scoring data and enrichment results to a BI tool to identify patterns in your highest-converting leads.
Congratulations! You've now set up an intelligent lead qualification system that will save your team hours of manual work while ensuring no high-value opportunity slips through the cracks. As you gather more data, continuously refine your criteria to make the system even more accurate and valuable.