Email Automation
Score and route inbound leads with Gemini, website enrichment, Slack and Sheets
When an API call/webhook arrives, it handles email with Google Gemini using Google Sheets, Slack.
What it does
## Score and route inbound form leads to Slack and Google Sheets with Gemini ### Who it's for Founders, sales and RevOps teams who get demo requests and contact-form leads and want the good ones answered first, without a lead-routing tool. ### How it works 1. Receive & clean: a webhook takes the form post and answers 200 at once. Normalize & Validate Lead cleans the fields and flags junk (disposable addresses, SEO pitches, honeypot, test entries). A free email-check API also catches burner and invalid addresses (green note). 2. Spam & duplicates: junk goes to the Spam tab. The Leads tab is read once per run; an email already there is a returning lead: its row gets submissions, last_seen_at and the latest message, and nobody is alerted twice. 3. Enrich: the company homepage is fetched (10s timeout). If it fails, the lead is marked enrichment = failed and scored on the form alone; the run never stops. 4. Score: Gemini scores the lead 0-100 against the Ideal Customer Profile in Config and returns industry, size, reasons and a next step as strict JSON. If Gemini fails, simple rules score it instead (title seniority, free mail, buying-intent words) and the row says scored_by = rules. 5. Save & route: every new lead is saved to Leads. Tiers use your thresholds: hot → Slack alert, warm → short Slack note (switch off with notifyWarmInSlack), cold → Nurture tab. 6. Errors: if a Sheets or Slack step fails, the error goes to the Errors tab and a Slack warning, and the other leads carry on. ### Setup (about 10 minutes) 1. Create a Google Sheet with four tabs: Leads, Spam, Nurture, Errors (headers are written on the first run). 2. Open Config: paste the sheet ID into sheetId, the Slack channel ID into slackChannelId, and describe your buyer in icpDescription. Adjust hotThreshold (75) and warmThreshold (45) if you like. 3. Add credentials: Google Gemini (key from Google AI Studio), Google Sheets OAuth2, Slack OAuth2 (chat:write). 4. Copy the Production URL from Receive Lead Webhook into your form's webhook settings and activate. Test with: curl -X POST -H 'Content-Type: application/json' -d '{"name":"Dana Whitfield","email":"dana@example.com","company":"Example Co","website":"example.com","job_title":"VP Revenue","message":"Can we get a demo?"}' ### Requirements n8n 2.x (tested on 2.43.7), a Google Gemini API key, Google Sheets, Slack. ### Customize Typeform, Tally o
The steps
- Receive Lead Webhook
- Config
- Normalize & Validate Lead
- Respond 200 to Form
- Check Email with Demo API?
- Score Email (Free Demo API)
- Apply Email Verdict
- Is Valid Lead?
- Log Spam to Sheet
- Read Existing Leads
- Check Duplicates
- New or Returning?
- Update Returning Lead in Sheet
- Fetch Company Homepage
32 steps in total.
Similar automations
Email AutomationEnrich and score LinkedIn inbound leads with OpenAI, Slack and Gmail21 stepsEmail AutomationScore and triage inbound leads with OpenAI, HubSpot, and Slack9 stepsCRM & Sales PipelineQualify, enrich, and route B2B inbound leads with GPT-4o, HubSpot, and Slack10 stepsAI Agents & AssistantsQualify and route inbound leads with GPT-4.1, HubSpot, Google Calendar and Slack38 steps