Templates / Qualify Gmail leads and draft replies with OpenAI and HubSpot

Qualify Gmail leads and draft replies with OpenAI and HubSpot

Ready for 3.0

by Nabil Samari · 0 views · created 2026-11-05 · Lead Generation, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This AI workflow has 21 nodes and runs on Gmail events. Along the way it connects Gmail, OpenAI Chat Model and HubSpot.

How it runs

Trigger: On Gmail events.

  1. Your business details (Edit Fields (Set)): sets 11 fields: companyName, whatYouSell, businessFacts…
  2. Skip already processed emails (Remove Duplicates): removes duplicate items
  3. Clean up email (Code): runs custom JavaScript code
  4. Classify email (Basic LLM Chain): sends a prompt to an LLM, with model: AI model; output parser: Classification format
  5. Decide what to do (Code): runs custom JavaScript code
  6. Route by result (Switch): routes items into 3 branches
  7. Write reply (Basic LLM Chain): sends a prompt to an LLM, with model: AI model; output parser: Reply format
  8. Find contact (HubSpot): search (contact)
  9. Alert me: manual review (Gmail): send (message)
  10. Prepare draft (Code): runs custom JavaScript code

…plus 7 more steps. See the full node list below.

Services it uses

GmailOpenAI Chat ModelHubSpot

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (New email in Gmail).
Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (11)

From the author

Quick overview This workflow monitors a Gmail inbox, uses OpenAI to classify and summarize incoming emails, drafts sales replies in Gmail, and creates or updates HubSpot contacts and deals for qualified new leads while sending you notification emails for new…

Excerpt from Nabil Samari's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.