Inbox-to-Lead: turning inbound emails into a clean lead list in n8n (structure + optional pack)

Hi all, Hamza here (imdifferent01).

A problem I keep seeing with small businesses: real inquiries sit in the inbox next to newsletters, receipts and auto-replies, and nobody turns them into a lead list until it’s too late.

The structure I use in n8n:

  1. Gmail Trigger on new mail (an IMAP trigger is included as an alternative).
  2. A Code node filters noise with plain rules (no-reply senders, auto-replies/OOO, receipts, newsletters via List-Unsubscribe) and strips quoted reply chains, so you don’t pay an LLM to read junk.
  3. A Basic LLM Chain with a Structured Output Parser (OpenAI or Gemini, picked by one field) classifies lead / support / spam / other and extracts name, company, need and contact, plus a 1-10 score.
  4. Lead and support rows are appended to Google Sheets with a status column (deduped on sender email), and a reply is created as a Gmail draft. Nothing is sent automatically. A separate Error Trigger workflow logs failures.

You can build all of that yourself from the steps above, and I’m happy to answer questions about it here.

Disclosure: I packaged my own version as “Inbox-to-Lead Desk”: three JSON workflows (main, error handler, a no-credentials logic test) plus a setup guide, $9. It’s new, so there are no reviews yet. The logic was tested with mocked AI/Sheets on 20 sample emails; you connect your own Gmail, AI key and sheet.

Question for you: how do you handle the “is this a real lead?” decision? Rules, an LLM, or both?

I’d use a combination of rules and an LLM.

First, I’d filter obvious noise with deterministic rules, such as newsletters, automated replies, and no-reply senders. Then I’d use an LLM to classify the remaining emails and extract structured fields like the company, contact details, business need, and lead score.

I’d also validate the structured output, deduplicate leads using a stable identifier, and route ambiguous cases for human review instead of automatically treating every high-scoring email as a qualified lead.

For me, the key is separating classification confidence from actual lead qualification. A promising email still needs to meet clear business criteria.

I like your approach of creating Gmail drafts instead of sending replies automatically!