Skip to main content
Automation · Email

Email classification with reply drafts

Automating customer service without a machine replying: an n8n workflow reads every email to info@, assigns a category and a contact person, and creates a reply draft for inquiries. A person has to send it.

draft, not auto-replya person reviews and sends
Mailboxinfo@✦Classifycategory · personContactfill inDraftGmailPersonreviews · sendsinquirylabel onlyno draftError noticeerror

Pain

A shared mailbox mixes inquiries, client emails, invoices and advertising. Someone has to read every email, find the right person, copy contact details and write a reply. An inquiry left lying around often goes unnoticed until the sender follows up.

Solution

  • Read every new email, strip quoted text and skip automatic replies.
  • Use a language model to assign each email a category: inquiry, existing contact, invoice and supplier, advertising and spam, other.
  • Determine the contact person: named explicitly, via a fixed customer mapping, or otherwise unclear.
  • Fill in the contact in a table without overwriting existing values. Conflicting values wait for a decision.
  • Create a draft in the contact person's mailbox for inquiries and existing contacts. Nothing is ever sent automatically.

How it works

  1. 01
    Mailbox fetch
    New emails to info@ are fetched and logged before anything else happens, so an abort never creates duplicate drafts. Own emails, automatic replies and empty emails are skipped.
  2. 02
    LLM · classify
    One call per email returns category, named person, contact details and draft in a fixed JSON schema. Only values that appear verbatim in the email are kept.
  3. 03
    Contact person
    Named explicitly, otherwise via the customer mapping, otherwise unclear. If unclear, no draft is created.
  4. 04
    Fill in contact
    Only for genuine messages from people. Empty fields are filled, existing values are never overwritten.
  5. 05
    Create draft
    Only for inquiries or existing contacts, and only for the latest email in the thread. The draft waits for review in the contact person's mailbox.
  6. 06
    Labels and log
    Labels show category and contact person right in the mailbox. The log records status, category and prompt version, without email text.
  7. 07
    Error notice
    If a run aborts, a separate error workflow reports it by email.

Outcome

Emails to info@ arrive sorted and assigned to a person. Inquiries come with a draft. Nothing goes out until a person has reviewed it.

What you can automate in customer service

The workflow takes over these steps before a person replies:

  • Read and sort incoming emails: inquiry, existing contact, invoice and supplier, advertising and spam, other
  • Determine the contact person and label the email in the mailbox
  • Copy contact details from the email into a table without overwriting existing values
  • Create a reply draft that a person reviews and sends
  • Log every run and report aborts by email

Sending stays with a person. If you are looking for a chatbot or an off-the-shelf ticketing system, a software product is the better fit.

Why this stack

n8n
Fetching, branching, error workflow and log in one interface, self-hosted.
LLM
One call per email with a fixed output schema. An unknown category falls back to “other”.
Gmail
Reads emails and threads, sets labels and creates drafts. The workflow never sends replies.
Data Tables
Contacts, conflicting values and log inside n8n, without a separate database.
More about our AI & Automation services

Related use cases

MailboxPDF✦Classifyorder?Line itemsMaster datacustomer · itemOrder fileERPconfident?Change / queryREVIEWHuman checksunclear
QA review · Order entryQA review plus rebuild

Orders from emails into the ERP without retyping

Order PDFs arrive by email. The workflow recognises order, change or query, extracts the line items, matches them against customer and item master data and only then creates the order file for the ERP. Detected ambiguities are flagged for review.

Detected ambiguities are surfacedinstead of silently waved through
n8nLLM extractionMaster-data matchingERP import
Learn more→
Send
→
HOTMüller GmbH
WARMSchmidt KG
COLDSpam filter
Automation · Lead trackingLive

Website with built-in lead tracking

Contact form with validation, automatic email notification, CRM sync and lead classification at intake. No more lost enquiries.

every leadwith an owner, reminder and escalation deadline
Next.jsResendCRM sync
Learn more→