To classify and reply to emails with AI, define a few categories (quote, appointment, invoice, urgent, other), let the workflow label each message and draft a reply, and send only low-risk ones. Anything urgent, legal or uncertain goes to a person. You save time without answering blindly.
What does classifying and replying to emails with AI mean?
It means an automated workflow reads each incoming email, decides what it is about and prepares an action: label it, draft a reply, book a slot or alert someone. It does not replace your judgment; it removes the repetitive work of opening, reading and pasting the same answer. According to the McKinsey Global Institute, the average knowledge worker spends about 28% of the workweek managing email. That study dates from 2012 and is general in scope, so treat it as an order of magnitude, not a measurement of your office. In a Houston office that gets inquiries in English and Spanish, classification keeps an important request from getting buried among notifications.
What do you need before you start?
You need a shared inbox (for example, info@ on your domain), a list of the 10 questions you receive most, and one person responsible for reviewing whatever the workflow does not resolve. To connect it, n8n offers a Gmail Trigger node that starts the workflow on each new message, and you can filter by sender or label. If you use Outlook or another provider, the principle is the same. Before automating, check which data arrives by email: invoices, health data or client information may call for stricter privacy rules. Our AI automation in Houston page summarizes how we approach these projects.
Step 1: define categories and escalation rules
Start with five categories at most. Each needs three things: words or signals that identify it, a template reply, and a rule saying when a person steps in. For example, "urgent" and "other" always escalate; "appointment" can reply with a scheduling link. Add an "other" category from day one: it is the safety net for whatever the classifier does not understand. Review 30 real emails from your inbox, note how you would handle each, and turn that into rules. A simple system that gets the basics right every time beats an ambitious one that improvises with your customers.
Step 2: write drafts, don't send blindly
In the first weeks, the workflow should leave the reply as a draft that someone approves with one click. Once a category has gone weeks without corrections, you can switch only that one to automatic sending. Keep replies short, with a clear next step (a link, a specific question) and no promises about timelines, prices or results you cannot keep. If the customer writes in Spanish, reply in Spanish; a simple language check handles this. To see how a conversational assistant behaves with these rules, check our demos and the examples of automation by industry.
Step 3: the n8n workflow, node by node
The workflow below is a minimal, generic example with no credentials. The Webhook node receives a POST with from, subject and body (in your real version you replace it with Gmail Trigger). The Code node classifies by keyword, sets needsHuman and proposes a draft; edit the lists and texts. The IF node separates what needs a person. Notify the team is an HTTP Request: replace TU_SERVICIO_DE_AVISOS with your alerting tool. The two Respond nodes return the result. To move from rules to AI, swap the Code node for a language model that returns only the category.
{
"name": "Classify emails and prepare a draft",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "clasificar-correo",
"responseMode": "responseNode",
"options": {}
},
"name": "Webhook correo",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
0,
0
]
},
{
"parameters": {
"jsCode": "const d = $input.first().json.body || {};\nconst text = ((d.subject || '') + ' ' + (d.body || '')).toLowerCase();\nconst rules = [\n ['urgente', ['urgente','urgent','hoy mismo','today','asap','demanda','lawsuit','chargeback']],\n ['factura', ['factura','invoice','pago','payment','recibo','receipt']],\n ['cita', ['cita','agendar','appointment','schedule','reservar','booking']],\n ['cotizacion', ['cotizacion','cotización','presupuesto','quote','estimate','precio','price']]\n];\nlet category = 'otro';\nfor (const [name, words] of rules) {\n if (words.some(w => text.includes(w))) { category = name; break; }\n}\nconst needsHuman = category === 'urgente' || category === 'otro';\nconst drafts = {\n factura: 'Gracias por escribirnos. Recibimos tu mensaje sobre facturación y lo revisaremos en el horario de oficina.',\n cita: 'Gracias por tu mensaje. Puedes elegir un horario aquí: TU_ENLACE_DE_AGENDA',\n cotizacion: 'Gracias por tu interés. Para preparar tu cotización necesitamos algunos datos. ¿Puedes responder con los detalles del servicio?'\n};\nreturn [{ json: { from: d.from || '', subject: d.subject || '', category, needsHuman, draft: drafts[category] || '' } }];"
},
"name": "Clasificar y redactar borrador",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
240,
0
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict"
},
"conditions": [
{
"id": "necesita-humano",
"leftValue": "={{ $json.needsHuman }}",
"rightValue": true,
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"name": "¿Necesita a una persona?",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
480,
0
]
},
{
"parameters": {
"method": "POST",
"url": "https://TU_SERVICIO_DE_AVISOS.example.com/notificar",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({ asunto: $json.subject, categoria: $json.category, de: $json.from }) }}",
"options": {}
},
"name": "Avisar al equipo",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
720,
-100
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify({ accion: 'revisar_por_persona', categoria: $('Clasificar y redactar borrador').item.json.category }) }}",
"options": {}
},
"name": "Responder: persona",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
960,
-100
]
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify({ accion: 'borrador_listo', categoria: $json.category, borrador: $json.draft }) }}",
"options": {}
},
"name": "Responder: borrador",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
720,
100
]
}
],
"connections": {
"Webhook correo": {
"main": [
[
{
"node": "Clasificar y redactar borrador",
"type": "main",
"index": 0
}
]
]
},
"Clasificar y redactar borrador": {
"main": [
[
{
"node": "¿Necesita a una persona?",
"type": "main",
"index": 0
}
]
]
},
"¿Necesita a una persona?": {
"main": [
[
{
"node": "Avisar al equipo",
"type": "main",
"index": 0
}
],
[
{
"node": "Responder: borrador",
"type": "main",
"index": 0
}
]
]
},
"Avisar al equipo": {
"main": [
[
{
"node": "Responder: persona",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
}
}- 01Short categories: five at most, plus "other" for whatever does not fit.
- 02Escalation rules: urgent, legal, complaints and disputed payments always go to a person.
- 03Drafts first: nothing sends itself until a category has weeks without corrections.
- 04Template replies: one per category, with a clear next step.
- 05Language: reply in the customer's language, English or Spanish.
- 06Privacy: keep sensitive data out of automatic replies and decide how long you store messages.
- 07Owner: one person reviews the "other" category and the drafts every day.
- 08Logging: store category, time and decision so you can tune the rules.
"A good automatic email doesn't sound like a robot or pretend to be a person: it handles the simple and flags in time what needs someone."
Equipo DavarionStep 4: review and adjust every week
Spend 15 minutes a week reviewing the emails that landed in "other" and the drafts someone corrected. Each correction is a new rule or a better sentence. Track how many messages were classified correctly, how many escalated and how long the first reply took; with those numbers you can decide whether to expand. Results vary with volume and the quality of your rules, and it is wise not to project savings until you have your own measurements. If you also get chat messages, the same approach works for WhatsApp, where the SPARK package combines a chatbot with one automation and ORBIT adds an SDR agent and CRM.
Can AI reply to customer emails without supervision?
It can, but it is not wise at the start. Begin with drafts approved by a person and automate only simple categories, like sending a scheduling link. Legal, medical, disputed-payment or complaint topics should always be reviewed. Supervision is not distrust of the tool: it is how you catch wrong replies before they reach a customer.
What if the email arrives in English or Spanish?
The workflow should detect the language and answer in kind. With keyword rules, include terms in both languages, as the example does. With a language model, ask it to return the category and the language separately. Keep reply templates in both languages, reviewed by someone who speaks them well, because a clumsy translation damages trust more than a late reply.
Is it safe to connect my email to an AI tool?
It depends on the provider and the data. Check what information is sent to the model, whether the provider uses it for training and where it is stored. Give the account minimum permissions, avoid sending sensitive data and define how long you keep logs. For emails with medical or financial information, consult your legal or compliance advisor first.
Want to review your inbox with us?
In a free 15-minute audit we review which emails eat the most of your time and which categories are worth automating first, no strings attached. Write to ceo@davarion.com or book from our site and we will tell you what is feasible in your case.