Quick overview
This workflow receives lead form submissions via webhook, classifies the email domain locally, scores the lead with OpenAI, assigns hot leads to SDRs in a round-robin rotation, and then logs the result to Notion and Google Sheets while sending Slack alerts and a Gmail confirmation.
How it works
- Receives a new lead submission as a POST request to an n8n webhook.
- Loads workflow configuration (Slack channels, Notion database, Google Sheet, and SDR email list) and classifies the lead’s email domain as business or personal.
- Sends the lead details to OpenAI to return a JSON lead score, tier (hot/warm/cold), reasoning, and suggested next step.
- If the OpenAI response cannot be parsed, posts a Slack message to a review channel so the lead can be scored manually.
- If the lead is hot, assigns the next SDR using round-robin rotation and posts a Slack alert with the score and assignment; otherwise marks the lead for the nurture queue.
- Creates a lead record in Notion, sends a tailored confirmation email via Gmail, and appends the lead data (tier, score, timestamp, and assignment) to Google Sheets.
Setup
- Add credentials for OpenAI, Slack, Notion, Gmail, and Google Sheets.
- Update the Config values for slackAlertChannelId, slackReviewChannelId, notionDatabaseId, googleSheetId, and the sdrEmails list used for round-robin assignment.
- Create a Notion database with properties that match the workflow’s mapped fields (Status, Email, Lead Score, Assigned SDR, and Reasoning).
- Create (or select) a Google Sheet and ensure the target sheet has columns for name, tier, email, company, leadScore, receivedAt, and assignedSdr.
- Copy the webhook production URL and configure your form to POST JSON with at least name, email, company, and message.
Requirements
- OpenAI API key
- Slack workspace with two channels (alerts and review)
- Notion database for lead records
- Gmail account with OAuth2 access
- Google Sheet for lead logging
- A lead form that can POST JSON to a webhook URL
Customization
- Adjust the AI prompt's scoring criteria (add industry, budget, or company size signals)
- Change the round-robin logic to weighted assignment if needed
- Swap Notion for a real CRM