An intelligent lead qualification system that uses AI to automatically score, route, and respond to inbound leads in real time. Built for agencies and freelancers who want to automate their sales pipeline.
- A potential client fills out the lead capture form on the frontend
- The form submits to an n8n webhook, which sends the lead data to Google Gemini 2.5 Flash
- Gemini scores the lead (1–10) and generates a personalized email reply
- Based on the score, the system automatically routes the lead:
| Score | Action |
|---|---|
| 7–10 (High Priority) | Slack notification to your team + personalized Gmail with Calendly booking link |
| 1–6 (Low Priority) | Logged to Google Sheets "Lead Database" + polite waitlist email via Gmail |
| Layer | Technology |
|---|---|
| Frontend | React 19, Vite, Tailwind CSS, Framer Motion, React Hook Form |
| Automation | n8n (self-hosted via Docker) |
| AI Model | Google Gemini 2.5 Flash |
| Notifications | Slack API |
| Gmail (OAuth2) | |
| Database | Google Sheets |
The "Lead Database" sheet uses these columns:
| Column | Source |
|---|---|
| Name | User input |
| User input | |
| Company | User input |
| Budget | User input |
| Score | AI-generated (1–10) |
| Reasoning | AI-generated |
| Timestamp | Auto-generated (ISO 8601) |
lead-qualifier/
├── README.md
├── CLAUDE.md # AI assistant context file
├── n8n-workflow.json # Import into n8n to restore the full workflow
└── frontend/
├── package.json
├── vite.config.js
├── tailwind.config.js
├── index.html
└── src/
├── main.jsx
├── App.jsx # Main form component
└── index.css # Tailwind + custom animations
cd frontend
npm install
npm run dev
# Opens at http://localhost:5173- Run n8n via Docker on port 5678
- Import
n8n-workflow.jsoninto n8n - Configure these credentials in n8n:
GOOGLE_API_KEY— Gemini API key- Gmail OAuth2
- Slack webhook URL
- Google Sheets OAuth2
- Replace
REPLACE_WITH_SPREADSHEET_IDin the Google Sheets node with your sheet ID - Activate the workflow
Update the WEBHOOK_URL in frontend/src/App.jsx with your production webhook URL.
- AI-powered scoring — Gemini analyzes budget, project details, and company to assign a quality score
- Automatic routing — high-value leads get instant Slack alerts and personalized emails; low-value leads are logged and waitlisted
- Premium UI — glassmorphism design, animated gradient background, Framer Motion transitions, budget pill toggles
- Form validation — real-time field-level validation with React Hook Form
- Loading states — submit button disables and shows spinner to prevent double submissions
- Zero manual work — from form submission to email response, everything is automated
MIT