This n8n workflow scores incoming leads with OpenAI and sorts them for follow-up. It receives web form submissions through a webhook, including name, email, company, role, and message. It normalizes the data and adds a timestamp to each lead.
Each lead is analyzed through the OpenAI Chat Completions API, which returns a score from 1 to 10, an intent classification, and a rationale. Leads that score 7 or higher trigger a Gmail alert. All leads are saved to Google Sheets, with high scorers in a "Hot Leads" tab and the rest in a "Cold Review" tab.
The workflow also returns a structured JSON response with the score and intent to the webhook caller. It uses JSON parsing and validation to process the AI output reliably. It is built from n8n webhook triggers, OpenAI HTTP requests, conditional logic, Gmail integration, and Google Sheets automation.
- Platform
- n8n workflow
- Trigger
- Webhook receiving web form submissions
- Lead fields
- Name, email, company, role, message
- AI scoring
- OpenAI Chat Completions API; score from 1 to 10, intent classification, and rationale
- Alert threshold
- Gmail alert for leads scoring 7 or higher
- Google Sheets tabs
- "Hot Leads" and "Cold Review"
- Webhook response
- Structured JSON with score and intent data
- Requirements
- OpenAI API credentials, Gmail OAuth2 setup, and a Google Sheet with the designated tabs