🎣 Label genuine sales leads in Gmail with OpenAI GPT-4.1-mini
⚡ 0 views · 🎣 Lead Generation & Enrichment
Description
Quick overview
Small business owners, freelancers and solo operators whose Gmail mixes real inbound sales interest with newsletters, vendor pitches and other noise. This workflow uses OpenAI to spot genuine sales leads and labels them in Gmail. It only adds a label; it never sends, deletes or drafts email.
How it works
- Gmail Trigger checks for new emails every minute.
- Settings holds your business name, OpenAI model, the Gmail label to apply (default
AI/Lead) and optional notes. - OpenAI (
gpt-4.1-miniby default) decides whether each email is a genuine sales lead (someone who wants to buy from you) and returns strict JSON withis_lead, a short summary and a reason. - When
is_leadis true, the workflow applies your label. If the label does not exist yet, it is created once (with its parent,AI) and then applied. - Cold pitches, newsletters and invalid AI output are skipped (treated as not-a-lead).
- It only adds a label. It never sends, deletes or drafts email.
Setup
- Attach your Gmail OAuth2 credential to Gmail Trigger, Get Gmail Labels, Create Lead Label, Re-fetch Gmail Labels and Apply Gmail Label, and your OpenAI credential to Classify Email.
- Open Settings: set
business_name, keep or changeopenai_model(defaultgpt-4.1-mini), optionally renamelead_label(the label is created automatically; for a nested label, write its full path, for exampleAI/Lead), and add plain-Englishclassification_notesif you need them (for example, “Inbound demo requests from the website are always leads”). - Send yourself a test enquiry, click Execute workflow, confirm the
AI/Leadlabel appears, then flip the workflow to Active.
Requirements
- n8n (Cloud or self-hosted, version 1.x or 2.x; built on 2.43.5)
- A Gmail / Google Workspace account
- An OpenAI API key (usage billed by OpenAI; with
gpt-4.1-miniusually a fraction of a cent per email)
Customization
- Change what counts as a lead in the Classify Email system prompt.
- Rename the label via
lead_labelin Settings. Use the full path for nested labels (for exampleAI/LeadorSales/Hot). Missing labels are created automatically. - Raise or lower
max_body_charsto control how much of each email is sent to the model. - Swap the OpenAI node for another provider’s chat model with an LLM Chain if you prefer.
🔗 Nodes Used
Gmail, Gmail Trigger, OpenAI
📥 Import
Download workflow.json and import into n8n:
Workflow menu → Import from File