Tutorials
Create a Personal Email Assistant with n8n and Local LLMs
Build a privacy-first email assistant that drafts replies, categorises messages, and surfaces urgent items using n8n and local models.

Create a Personal Email Assistant with n8n and Local LLMs
Email productivity is one of the most natural applications for local AI. An automated assistant can triage your inbox, draft contextual replies, and flag important messages — all without your email content ever leaving your server.
What a local email assistant should do
A useful assistant does not send emails for you automatically. It reduces the cognitive load of managing the inbox:
- **Classify** every incoming message by type (urgent, FYI, action required, newsletter)
- **Summarise** long threads into digestible bullet points
- **Draft replies** based on the context of the conversation
- **Flag** time-sensitive messages from key contacts
- **Archive** low-signal messages after extraction (receipts, notifications)
For the fundamentals of n8n automation, read Build Your Own AI Assistant with n8n.
Architecture overview
```
Email Server (IMAP) → n8n Poll Trigger → AI Agent Node → Classification → Action
├─ Draft reply (queue for review)
├─ Summarise thread (save to notes)
└─ Flag urgent (push notification)
```
Step-by-step build
Step 1: Email trigger
Use n8n's **Email Trigger (IMAP)** node. Configure it to poll every 5 minutes. Filter to only unseen messages so you don't re-process old mail.
```yaml
Example IMAP config
host: imap.your-provider.com
port: 993
username: you@yourdomain.com
password: ${EMAIL_PASSWORD}
```
Step 2: AI classification
Add an AI Agent node connected to your local Ollama instance. Use a system prompt like:
> You are an email assistant. Given the subject and body of an email, classify it into one category: urgent, action_required, fyi, newsletter, receipt, or spam. Also assign a priority score from 1-5. Return JSON: {"category": string, "priority": number, "reason": string}
Step 3: Route based on classification
| Category | Action |
|----------|--------|
| urgent | Send push notification + summary to phone |
| action_required | Draft reply, move to review folder |
| fyi | Summarise and log to daily digest |
| newsletter | Archive after optional summary |
| spam | Move to spam folder, no notification |
Step 4: Draft reply with context
For action_required emails, pass the full thread history to the local model with:
> Draft a professional reply to this email. Use the same language as the original message. Include placeholders [in brackets] where specific information is needed. Keep it concise.
Store the draft in a n8n database node or Google Sheet for you to review and send.
Privacy considerations
Because the model runs locally, your email content never reaches a third-party API. The only data leaving your server is the actual sent email when you choose to hit send. This matters for:
- Confidential business correspondence
- Client communications with non-disclosure agreements
- Personal sensitive matters
For the broader security picture, see How to Secure a Self-Hosted AI Server.
Daily digest workflow
Add a scheduled n8n workflow that runs every morning:
1. Query yesterday's classified emails from the database
2. Ask the local LLM to generate a one-paragraph summary of key developments
3. Send the digest via email or push notification
4. Include action items from messages that need responses
Conclusion
A personal email assistant with n8n and local LLMs is one of the highest-ROI automation projects you can build. It saves daily decision fatigue, keeps your data private, and scales to handle however many messages your inbox receives.
FAQ
Will this work with any email provider?
Yes, if it supports IMAP. Gmail, Outlook, Fastmail, and self-hosted email servers all work.
How do I prevent accidental sends?
Never use an AI-generated draft as the final send without human review. The assistant drafts; the human approves.
What model size is sufficient?
A 7B or 8B model works well for classification and summarisation. Drafting benefits from a larger model if hardware allows.


