Workflow automation with n8n and artificial intelligence
How I built an n8n workflow that reads incoming emails with AI and leaves a draft reply for me in Outlook.

Many of the emails I receive ask questions I have already answered, in much the same way, many times before. So I built a workflow with n8n: an AI reads incoming emails, finds relevant information and leaves a draft reply for me in Outlook. All I do is review and send it. In this post I show how it works and which models I tested.
Why n8n as an Automation Platform?
n8n is a low-code workflow platform: you connect building blocks (nodes) visually and can add your own JavaScript at any step. There are ready-made connectors for many products and services, and AI nodes plug in like any other step.
I self-host n8n on a Synology NAS with Docker. Compared to the cloud version, I keep control of the data, pay no ongoing fees and can use community nodes and npm packages in my own code.

How the Email Workflow Runs
1. Automated Retrieval and Processing of Incoming Emails
- Connection to Microsoft 365 Outlook via the ready-made n8n connector
- Filters on defined criteria so only relevant messages go further
- The content is extracted and prepared for analysis
2. Semantic Analysis by Artificial Intelligence
- The AI works out what the email is about
- A vector store with embeddings (RAG) adds relevant information from earlier correspondence and documents
- Emails are classified and prioritised by topic
3. Automated Generation of Response Suggestions
- OpenAI GPT-4o writes a reply based on this context
- Earlier correspondence is taken into account so the tone and content fit
- The reply lands in Outlook as a draft; I review it and send it
For recurring questions this saves me a lot of typing, and the answers stay consistent.
How good the drafts are depends heavily on the prompt. The more clearly it is structured and the more relevant context it carries, the less I have to correct.
Cloud vs. Local AI Models
During development I tested several models (as of March 2025):
- OpenAI GPT-4o: understands context very well and writes good text, but needs a cloud connection.
- Ollama with deepseek-r1:14b: runs locally on my MacBook Pro M1, but quality and speed aren't good enough.
- Ollama with deepseek-r1:671b: promising, but needs enormous hardware (I estimate at least 480 GB of VRAM, i.e. more than ten high-end Nvidia GPUs). Not realistic for production use in my case.
I went with GPT-4o because it gives the best answers for the least effort. Once suitable hardware gets cheaper, I'll test local models again.
Other Use Cases for n8n
n8n works for conventional workflows as well as AI automation; the AI part is optional. A few examples:
- Web scraping to collect data from websites automatically
- Data synchronisation between several systems and APIs
- Automated reports from several data sources
- AI chatbots that answer support requests, for example
- Social media analysis to spot trends early
- AI image recognition to categorise images automatically
More use cases: https://n8n.io/workflows/
Looking Ahead: AI-assisted Accounting
Alongside the email automation, I'm working on bringing AI into accounting. One piece of this is automatic document analysis: invoices and balance sheet reports are turned into embeddings so similar documents can be found quickly.
What matters here: sensitive and personal data never leave our network and are not processed by any cloud model. They are stored locally.
Conclusion: I am thrilled!
Tasks that used to take weeks of development I now build with n8n and an AI model in a few afternoons, without much code. For me, the most important point is that n8n runs on our own infrastructure: business data stays under our control, and only what I deliberately share goes to a model in the cloud.
Got a similar project in mind?
In a free initial call we look at your situation and tell you what's realistic and what the next step looks like.

// about the author
Alexander J. Gassner, MSc
Founder and managing director of agsolutions, with more than 15 years in software development (MSc Software Engineering, FH Hagenberg). Builds and runs business-critical software from requirements to operations: Kotlin, Spring Boot and React in the code, Kubernetes, Pulumi and GitOps in operations, as an Exoscale Certified Solution Architect.


