DEV Community

Turning inbox emails into structured tickets with n8n

If you run a small services or support business, you've probably had client requests slip through a crowded inbox. Here's a small n8n workflow that turns every incoming email into a structured, categorized ticket automatically.

The setup: an IMAP trigger watches the inbox, a Code node parses and categorizes each email, then it's logged to a Google Sheet and the sender gets an automatic confirmation with a ticket ID.

Categorization without an LLM

Instead of reaching for an AI classifier (slower, costs tokens, another thing to configure), this uses simple keyword matching on the subject and body:

const motsClesUrgent = ['urgent', 'bloquΓ©', 'panne', 'ne fonctionne plus'];
const motsClesFacturation = ['facture', 'devis', 'paiement'];
let categorie = 'GΓ©nΓ©ral';
if (motsClesUrgent.some(m => texteAnalyse.includes(m))) { categorie = 'Urgent'; } else if (motsClesFacturation.some(m => texteAnalyse.includes(m))) { categorie = 'Facturation'; }

It's not going to catch every nuance, but for a solo operator or small team, "does this contain the word urgent/panne" is a genuinely useful first filter, and it's free and instant.

Why log to a spreadsheet instead of a real ticketing tool

Because for a one or two person operation, Zendesk-style tooling is overkill. A spreadsheet with columns for ticket ID, sender, subject, category and status is enough to know what's open and what's been handled, and everyone on the team already knows how to use a spreadsheet.

The confirmation email

Immediately replying with a ticket ID matters more than people expect: it tells the client their message didn't vanish into a void, even before anyone reads it.

I packaged this as a ready-to-import template (with setup docs) alongside two related invoice-automation workflows I posted about earlier: https://kevinspark2623.gumroad.com/l/thxihg. The logic above is simple enough to rebuild yourself if you'd rather DIY it.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.