Global AI Network

Simple Lead Qualification Automation with OpenAI

Automatically qualify leads with AI, route hot prospects to HubSpot and Slack, and log all submissions to Google Sheets—no manual screening required.

56+
Total Deployments
5 min
Setup Time
v1.0
Version

Need Help Getting Started? Our AI Specialists Will Set It Up For Free

1-Click Deployment 5-Min Setup Free Expert Support
Technology Partners

Required Integrations

This agent works seamlessly with these platforms to deliver powerful automation.

Google Sheets

Google Sheets

Read / Write data from / to Google Sheets

HubSpot

HubSpot

Comprehensive CRM and marketing automation platform with contacts, companies, de...

OpenAI

OpenAI

Leverage OpenAI's powerful language models to generate text, answer questions, a...

Slack

Slack

Send messages, manage channels, and automate workflows in Slack workspaces

Step by Step

Setup Tutorial

mission-briefing.md

What This Agent Does

This intelligent lead qualification workflow automatically captures, evaluates, and routes incoming leads based on their potential value to your business. When a prospect submits their information through your lead capture form, the workflow uses AI to analyze and score the lead, logs all data to Google Sheets for tracking, creates contacts in your CRM, and sends targeted Slack notifications to your sales team based on lead temperature (hot, warm, or cold).

Key benefits include:

  • Save 15-20 hours per week on manual lead qualification and data entry
  • Respond to hot leads 10x faster with instant Slack alerts to your sales team
  • Never lose a lead with automatic logging and CRM integration
  • Make data-driven decisions with AI-powered lead scoring that's consistent and unbiased
  • Eliminate human error in data transfer between systems

Perfect for: Sales teams, marketing agencies, SaaS companies, real estate professionals, and any business that needs to quickly identify and act on high-value leads while maintaining comprehensive records of all prospects.

Who Is It For

This workflow is designed for sales and marketing teams who receive leads through online forms and need an intelligent system to prioritize follow-up actions. It's particularly valuable if you:

  • Receive more than 20 leads per week and struggle to respond quickly to the most promising ones
  • Have a sales team that needs real-time notifications about hot prospects
  • Want to eliminate manual data entry between your lead forms, spreadsheets, and CRM
  • Need consistent lead qualification criteria applied to every prospect
  • Manage leads across multiple tools (forms, spreadsheets, Slack, CRM) and want seamless integration
  • Are looking to scale your lead management without hiring additional staff

Whether you're a startup founder handling leads yourself or a sales manager coordinating a team, this workflow ensures no opportunity slips through the cracks while focusing human attention where it matters most.

Required Integrations

OpenAI

Why it's needed: OpenAI's GPT-4 model powers the intelligent lead qualification, analyzing prospect information to determine if they're a hot, warm, or cold lead based on criteria you define.

Setup steps:

  1. Visit platform.openai.com and create an account or sign in
  2. Navigate to API Keys in your account settings
  3. Click "Create new secret key" and give it a descriptive name like "TaskAGI Lead Qualification"
  4. Copy the API key immediately (it won't be shown again)
  5. In TaskAGI, go to IntegrationsOpenAI
  6. Click "Add Integration" and paste your API key
  7. Test the connection to verify it's working

Configuration notes: The workflow uses the gpt-4o model for optimal balance between speed and accuracy. You'll need an OpenAI account with API credits available (typically $5-20/month for moderate lead volumes).

Google Sheets

Why it's needed: Google Sheets serves as your central lead database, automatically logging every submission with qualification scores and timestamps for easy tracking and reporting.

Setup steps:

  1. Create a new Google Sheet or use an existing one for lead tracking
  2. Set up column headers in the first row: Timestamp, First Name, Last Name, Email, Company, Phone, Lead Score, Qualification
  3. Copy the full URL of your Google Sheet
  4. In TaskAGI, go to IntegrationsGoogle Sheets
  5. Click "Add Integration" and choose "Connect with Google"
  6. Authorize TaskAGI to access your Google Sheets
  7. Grant permissions for reading and writing spreadsheets

Configuration notes: Make sure the Google account you connect has edit access to the sheet. The workflow will append new rows automatically, so don't worry about overwriting existing data.

Slack

Why it's needed: Slack delivers instant notifications to your sales team when leads come in, with different channels or messages based on lead temperature to ensure hot prospects get immediate attention.

Setup steps:

  1. Open your Slack workspace where you want to receive notifications
  2. Create dedicated channels like #hot-leads, #warm-leads, and #cold-leads (or use existing channels)
  3. In TaskAGI, go to IntegrationsSlack
  4. Click "Add Integration" and select "Connect with Slack"
  5. Choose your workspace and authorize TaskAGI
  6. Grant permissions to post messages and access channels
  7. Note the channel IDs or names you'll use for notifications

Configuration notes: You can send all notifications to one channel or route them to different channels based on lead temperature. Consider using @mentions for hot leads to ensure immediate visibility.

HubSpot

Why it's needed: HubSpot integration automatically creates contact records for qualified leads, ensuring your CRM stays up-to-date without manual data entry and enabling your sales team to begin nurture sequences immediately.

Setup steps:

  1. Log into your HubSpot account (Marketing Hub, Sales Hub, or CRM)
  2. Navigate to SettingsIntegrationsAPI Key
  3. Click "Create API Key" or use an existing one
  4. Copy the API key to your clipboard
  5. In TaskAGI, go to IntegrationsHubSpot
  6. Click "Add Integration" and paste your API key
  7. Test the connection to verify access

Configuration notes: The workflow creates contacts with standard properties (name, email, company, phone). You can customize which leads get added to HubSpot based on qualification score in the workflow configuration.

Configuration Steps

Step 1: Configure the Lead Capture Form

The Lead Capture Form node is your workflow trigger. Configure these fields:

  • Form Fields: Set up fields for first_name, last_name, email, company, phone, and any custom qualification questions
  • Form URL: After saving, you'll receive a unique form URL to embed on your website or share directly
  • Submission Settings: Enable email notifications if you want backup alerts

Pro tip: Add qualifying questions like "What's your budget?" or "What's your timeline?" to give the AI more context for scoring.

Step 2: Set Up AI Lead Qualification

The AI Lead Qualification node analyzes submitted data. Configure:

  • Model: Use gpt-4o (already set) for best results
  • Prompt: Customize the qualification criteria. Example:
    Qualify this lead based on the following criteria:
    
    Name: [[nodes.3560.first_name]] [[nodes.3560.last_name]]
    Email: [[nodes.3560.email]]
    Company: [[nodes.3560.company]]
    Phone: [[nodes.3560.phone]]
    
    Scoring criteria:
    - HOT: Enterprise company, decision-maker title, urgent timeline
    - WARM: Mid-size company, relevant role, exploring options
    - COLD: Small company, student/personal email, no clear timeline
    
    Return only: HOT, WARM, or COLD
    
  • Temperature: Set to 0.3 for consistent, deterministic scoring
  • Max Tokens: 50 is sufficient for a simple classification

Step 3: Format Lead Data

The Format Lead Data node structures information for downstream systems:

  • Data Mapping: Create fields that combine form data with AI qualification
  • Example mappings:
    • full_name: [[nodes.3560.first_name]] [[nodes.3560.last_name]]
    • lead_score: [[nodes.3561.content]]
    • timestamp: [[nodes.3560.submittedAt]]
    • email: [[nodes.3560.email]]

This ensures consistent data format across Google Sheets, Slack, and HubSpot.

Step 4: Configure Google Sheets Logging

The Log to Google Sheets node records every lead:

  • Sheet URL: Paste your Google Sheet URL (from integration setup)
  • Row Data: Map formatted data to columns in order:
    • Column A: [[nodes.3562.timestamp]]
    • Column B: [[nodes.3562.full_name]]
    • Column C: [[nodes.3562.email]]
    • Column D: [[nodes.3562.company]]
    • Column E: [[nodes.3562.lead_score]]

Important: The order must match your sheet's column headers exactly.

Step 5: Set Up Conditional Routing

Hot Lead Condition node checks if the lead is high-priority:

  • Condition Type: Text comparison
  • Value to Check: [[nodes.3561.content]]
  • Operator: equals
  • Compare To: HOT
  • True Path: Routes to Slack Hot Lead Alert and HubSpot
  • False Path: Routes to Warm Lead check

Warm Lead Condition node (for leads that aren't hot):

  • Condition Type: Text comparison
  • Value to Check: [[nodes.3561.content]]
  • Operator: equals
  • Compare To: WARM
  • True Path: Routes to Slack Warm Lead notification
  • False Path: Routes to Slack Cold Lead notification

Step 6: Configure Slack Notifications

Slack Hot Lead Alert:

  • Channel: #hot-leads or your designated channel
  • Message Template:
    🔥 **HOT LEAD ALERT** 🔥
    
    Name: [[nodes.3562.full_name]]
    Company: [[nodes.3560.company]]
    Email: [[nodes.3560.email]]
    Phone: [[nodes.3560.phone]]
    
    @sales-team - Follow up immediately!
    

Slack Warm Lead:

  • Channel: #warm-leads
  • Message Template:
    ⭐ New Warm Lead
    
    Name: [[nodes.3562.full_name]]
    Company: [[nodes.3560.company]]
    Email: [[nodes.3560.email]]
    
    Follow up within 24 hours.
    

Slack Cold Lead:

  • Channel: #cold-leads
  • Message Template:
    ❄️ New Cold Lead (Nurture Campaign)
    
    Name: [[nodes.3562.full_name]]
    Email: [[nodes.3560.email]]
    
    Added to nurture sequence.
    

Step 7: Configure HubSpot Contact Creation

The Create HubSpot Contact node (triggered for hot leads):

  • Email: [[nodes.3560.email]] (required field)
  • First Name: [[nodes.3560.first_name]]
  • Last Name: [[nodes.3560.last_name]]
  • Company: [[nodes.3560.company]]
  • Phone: [[nodes.3560.phone]]
  • Lead Status: Set to "Hot Lead" or custom property
  • Lifecycle Stage: Set to "Lead" or "Marketing Qualified Lead"

Optional: Add custom properties like lead_source, qualification_date, or ai_score.

Testing Your Agent

Running Your First Test

  1. Activate the workflow by toggling it to "On" in the workflow editor
  2. Submit a test lead through your form with data that should qualify as "HOT" (use a test email like test+hot@yourdomain.com)
  3. Monitor the execution in the TaskAGI dashboard under "Workflow Runs"
  4. Check each integration:
    • Verify the row appears in Google Sheets
    • Confirm Slack notification in the correct channel
    • Check HubSpot for the new contact

Verification Checklist

✓ Form Submission:

  • Form accepts all required fields
  • Submission timestamp is captured
  • Data passes to AI qualification node

✓ AI Qualification:

  • OpenAI returns HOT, WARM, or COLD
  • Response time is under 5 seconds
  • Classification matches your criteria

✓ Data Formatting:

  • All fields are properly mapped
  • No blank or undefined values
  • Timestamps are in correct format

✓ Google Sheets:

  • New row appears at the bottom
  • All columns are populated correctly
  • No data is truncated or malformed

✓ Conditional Logic:

  • Hot leads trigger hot lead path
  • Warm leads trigger warm lead path
  • Cold leads trigger cold lead path

✓ Slack Notifications:

  • Messages appear in correct channels
  • Formatting is clean and readable
  • @mentions work (if configured)

✓ HubSpot Integration:

  • Contact is created (for hot leads)
  • All properties are populated
  • No duplicate contacts are created

Expected Results

For a HOT lead submission:

  • Execution time: 8-12 seconds
  • Google Sheets: New row added
  • Slack: Message in #hot-leads with urgent formatting
  • HubSpot: New contact created
  • Status: All nodes show green checkmarks

For WARM or COLD leads:

  • Similar execution time
  • Google Sheets: New row added
  • Slack: Message in appropriate channel
  • HubSpot: No contact created (only hot leads)
  • Status: All nodes show green checkmarks

Troubleshooting

Common Issues and Solutions

Problem: AI always returns the same classification

Solution:

  • Check your prompt for clarity and specific criteria
  • Reduce temperature to 0.1 for more consistent results
  • Ensure form data is actually passing to the AI node (check data references)
  • Add more context to your prompt about what makes a lead hot/warm/cold

Problem: Google Sheets shows "Permission Denied" error

Solution:

  • Verify the Google account connected in TaskAGI has edit access to the sheet
  • Check that the sheet URL is correct (copy from browser address bar)
  • Re-authenticate the Google Sheets integration
  • Ensure the sheet isn't protected or locked

Problem: Slack notifications not appearing

Solution:

  • Verify TaskAGI app is added to the target channels (type /invite @TaskAGI in the channel)
  • Check channel names are spelled correctly (case-sensitive)
  • Confirm Slack integration has proper permissions
  • Test with a public channel first before using private channels

Problem: HubSpot contact creation fails

Solution:

  • Verify email field is properly mapped (required field)
  • Check for duplicate contacts (HubSpot may reject if email exists)
  • Ensure API key has contact creation permissions
  • Validate that property names match HubSpot's internal names exactly

Problem: Workflow doesn't trigger on form submission

Solution:

  • Confirm workflow is activated (toggle is "On")
  • Check form URL is correctly embedded or shared
  • Test form submission directly from TaskAGI's form preview
  • Review workflow logs for any error messages

Problem: Data references showing as "undefined"

Solution:

  • Verify node IDs in data references match actual node IDs (check in workflow editor)
  • Ensure upstream nodes completed successfully before downstream nodes execute
  • Test each node individually to isolate where data is lost
  • Check for typos in field names (case-sensitive)

Error Message Guide

  • "OpenAI API rate limit exceeded": You've hit your API usage limit. Upgrade your OpenAI plan or wait for the limit to reset.
  • "Invalid sheet URL": The Google Sheets URL format is incorrect. Use the full URL from your browser.
  • "Slack channel not found": Channel name is misspelled or TaskAGI doesn't have access. Invite the bot to the channel.
  • "HubSpot contact already exists": A contact with this email already exists. Consider using an "update or create" approach.
  • "Workflow execution timeout": A node took too long to respond. Check your internet connection and integration service status.

Next Steps

Immediate Actions After Setup

  1. Run 5-10 test submissions with different lead profiles (hot, warm, cold) to ensure routing works correctly
  2. Share the form URL with your marketing team to embed on landing pages, email campaigns, or social media
  3. Train your sales team on the new Slack notification system and response expectations
  4. Set up a weekly review of your Google Sheets lead log to identify trends and optimize qualification criteria

Optimization Suggestions

Refine AI Qualification Criteria:

  • After 50-100 leads, review the AI's classifications in your Google Sheets
  • Adjust your prompt to better match your ideal customer profile
  • Add industry-specific keywords or disqualifiers
  • Consider adding a "MEDIUM" category between warm and cold

Enhance Data Collection:

  • Add custom form fields for budget, timeline, or