Quick Overview
This workflow runs manually or weekly to read leads from Google Sheets, filters them against an n8n Data Table suppression list and a cooldown log, drafts short personalised cold emails with OpenAI, creates Gmail drafts for review, and records each draft in Google Sheets and the sent log.
How it works
- Runs on a manual trigger or every week on Monday at 08:00.
- Loads outreach settings, reads the existing sent log from an n8n Data Table, and pulls lead rows from a Google Sheets “Leads” tab.
- Normalizes lead fields (for example trimming text and lowercasing emails) and skips any lead whose email appears in the n8n Data Table suppression list.
- Filters out invalid emails, leads without a research note, duplicate emails within the same run, and any email drafted within the configured cooldown window, then caps the batch size.
- Sends each remaining lead plus your sender details to OpenAI to generate a subject and email body that follow strict length and content rules.
- Validates the AI output, creates a Gmail draft addressed to the lead, upserts the email and timestamp into the sent log Data Table, and appends the draft details (including Gmail draft ID) to a Google Sheets “Draft Log” tab.
Setup
- Add credentials for Google Sheets, Gmail, and OpenAI (Chat) and select an available OpenAI chat model.
- Create two n8n Data Tables named “Suppression List” (email) and “Sent Log” (email, lastDraftedAt) and select them in the Data Table nodes.
- Create a Google Sheets spreadsheet with “Leads” and “Draft Log” tabs, ensure the Leads tab includes columns like name, company, email, title, researchNote, and sourceUrl, and paste the spreadsheet URL into both Google Sheets nodes.
- Fill in the Outreach Settings values (sender name, company one-liner, value proposition, draft cap, and cooldown days) before activating the workflow.