Automated lead qualification pipeline using AI classification.
- Triggers when someone submits a Google Form (demo request)
- Validates that the message isn't empty
- Classifies the lead using OpenAI:
- ACTIVE_BUYER (hot)
- EVALUATING (warm)
- TIRE_KICKER (cold)
- UNCLEAR
- Routes based on classification:
- Hot leads → Slack alert
- All leads → Logged to Google Sheet
- n8n (automation platform)
- OpenAI API (GPT-4o-mini)
- Google Forms (input)
- Google Sheets (logging)
- Slack (notifications)
- Import
workflow.jsoninto n8n - Connect credentials:
- Google (Forms + Sheets)
- OpenAI API key
- Slack
- Create a Google Form with fields: Name, Email, Company, Company Size, Message
- Create a Google Sheet with columns: Timestamp, Name, Email, Company, Company Size, Message, Intent, Urgency, Reasoning, Route
- Activate workflow
See the OpenAI node in the workflow. Key design choices:
- Fixed categories (prevents hallucination)
- JSON-only output (parseable)
- Low temperature (0.2) for consistency
| 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 |
- 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
- 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
