bettersorted Logo
Employee in front of a screen with a full email inbox
Open source & technologies

Automatically sort emails: Relieve the inbox with n8n and AI

AuthorMuhamed Alahmed
Published on
Reading time4 min

Image: AI-generated

In short

With n8n and a language model, incoming e-mails can be automatically read, sorted according to concerns and forwarded to the right place – such as invoices to the accounting department, inquiries to the CRM, appointment requests to the calendar. This saves time in collective mailboxes every day without e-mails having to leave the company.

Automatically sorting incoming e-mails is possible with a workflow consisting of n8n and a language model: The workflow retrieves each new e-mail, the model recognizes the request and reads important information, and n8n forwards the e-mail to the right place – accounting, sales, customer service or calendar. If n8n and the model run in Germany, the e-mails do not leave the company.

Anyone who manages a collective mailbox like info@ knows the problem: applications, invoices, complaints, newsletters and real customer inquiries end up in the same inbox. Someone has to open, understand and forward every email. This is exactly the step that can be easily automated.

What an email workflow does in concrete terms

  1. Pickup: n8n checks the mailbox at fixed intervals via IMAP or the Microsoft 365 or Gmail interface.
  2. Classify: A language model receives a subject and text and assigns the mail to a fixed list of categories, such as "Invoice", "Request", "Complaint", "Application", "Other".
  3. Readout: Depending on the category, the model reads out information – customer number, order number, desired date, invoice amount.
  4. Forward: n8n moves the mail to the appropriate folder, creates an entry in the CRM or ticket system or stores attachments in the DMS.
  5. Report: In case of uncertainty or urgent cases, a person receives a notification instead of the workflow advising.

Example: Collective mailbox of a craft business

Example: A craft business with 25 employees receives around 80 e-mails to info@ every day. A workflow sorts them into four groups:

Category

What the workflow does

Invoice

PDF attachment to the document archive (e.g. Paperless-ngx), mail in folder "Accounting"

Customer inquiry

Read out name, location and request, create a lead in the CRM, send confirmation to customers

Desired date

Read out the desired date, forward it to MRP

Unclear

Leave unchanged in the inbox, mark "please check"

The last line is important: A good workflow does not decide everything, but returns unclear things to people. This keeps the error rate low and trust in the team high.

Why AI instead of fixed rules?

Classic mailbox rules work with senders and keywords. This works for newsletters, but not for customer inquiries, which everyone formulates differently. A language model, on the other hand, understands the meaning: "The heating is making noise again" and "Need an appointment for maintenance" both land correctly, even though there is no common keyword.

Both can be combined: fixed rules for the unambiguous (known suppliers, newsletters), AI for the rest. This saves model calls and thus costs.

Data protection: Where the e-mails are processed

Emails almost always contain personal data. That's why it's crucial where n8n runs and which model is requested. We use n8n self-hosted in Germany and use models that either run with us or you or come from German data centers, for example via the IONOS AI Model Hub. The article Hosting AI models in compliance with the GDPR explains the options.

Boundaries honestly named

  • A model does not always understand irony and insinuations – hence the category "Unclear".
  • Long e-mail histories have to be shortened, otherwise costs and errors will increase.
  • Answers should only be sent automatically for simple confirmations. It is better to present substantive answers as a draft.
  • Without monitoring, it is not noticeable if, for example, the mailbox password changes and the workflow comes to a standstill.

How to get started

For a week, roughly count the types of mails that end up in the collective mailbox. The three most common ones are your starting point. We build such workflows with n8n as part of our process automation – including testing with real mails before something goes live.

Counselling and accompanied implementation is eligible for funding: Through INQA coaching, the federal government covers 80% of the consulting costs of up to €1,200 per day for up to 12 days, i.e. up to €11,520 subsidy. In Mecklenburg-Western Pomerania and the other new federal states, BAFA consulting funding is also eligible at 80% until 31.12.2026 (50% in the old federal states). Funding is provided for consulting, not software. The funding check shows which program fits.

Frequently Asked Questions

Can AI reliably sort emails?

For clearly definable categories such as invoice, inquiry or application, yes, if the workflow has been tested with real examples. Unclear cases should be returned to people instead of guessing.

Does this work with Microsoft 365 and Outlook?

Yes. n8n can read mailboxes via the Microsoft interface or via IMAP and move, mark or forward mails.

Will my emails be sent to OpenAI?

Not necessarily. The model can be chosen freely; with a self-operated model or a provider with a data center in Germany, the data remains in Germany.

How much does such a workflow cost?

This depends on the number of categories, the connected systems and the mail volume. The running model costs per mail are usually low; the larger part is the one-time setup and test.

Would you like to relieve your collective mailbox? Via the contact page, we will clarify in a short conversation which categories are worthwhile.

Portrait of Muhamed Alahmed, founder of bettersorted
About the author

Muhamed Alahmed

With over 10 years’ experience in IT, I develop solutions that not only work from a technical perspective, but also create real added value and open up new possibilities.

More about bettersorted →

More articles

Newsletter

Stay up to date on AI topics

Short updates on AI automation, funding programs and new posts — no spam, unsubscribe anytime.

We use Brevo as our marketing platform. By submitting, you agree that your data will be transferred according to Brevo's privacy policy .

CallEmailContact form