Skip to content

a-shahrabi/Automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Lead Qualification Automation (n8n)

Automated lead qualification pipeline using AI classification.

What it does

  1. Triggers when someone submits a Google Form (demo request)
  2. Validates that the message isn't empty
  3. Classifies the lead using OpenAI:
    • ACTIVE_BUYER (hot)
    • EVALUATING (warm)
    • TIRE_KICKER (cold)
    • UNCLEAR
  4. Routes based on classification:
    • Hot leads → Slack alert
    • All leads → Logged to Google Sheet

Workflow Screenshot

workflow

Tech Stack

  • n8n (automation platform)
  • OpenAI API (GPT-4o-mini)
  • Google Forms (input)
  • Google Sheets (logging)
  • Slack (notifications)

Setup Instructions

  1. Import workflow.json into n8n
  2. Connect credentials:
    • Google (Forms + Sheets)
    • OpenAI API key
    • Slack
  3. Create a Google Form with fields: Name, Email, Company, Company Size, Message
  4. Create a Google Sheet with columns: Timestamp, Name, Email, Company, Company Size, Message, Intent, Urgency, Reasoning, Route
  5. Activate workflow

AI Prompt Used

See the OpenAI node in the workflow. Key design choices:

  • Fixed categories (prevents hallucination)
  • JSON-only output (parseable)
  • Low temperature (0.2) for consistency

Failure Modes Observed

Issue How I Handled It
Empty form submissions IF node skips AI call
Malformed JSON from AI Code node catches parse errors
Inconsistent classification Low temperature + explicit categories

What I Learned

  • How to chain n8n nodes with conditional logic
  • Prompt design for structured output
  • Importance of logging for debugging AI workflows
  • Building fallbacks for when AI output is unexpected

Improvements I'd Make

  • Add email notification for WARM leads
  • Connect to a real CRM (HubSpot/Salesforce)
  • Add human review queue for UNCLEAR classifications
  • Track classification accuracy over time

About

Automation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published