InboxGuardian is a local AI-powered email cleaner built with n8n.
It automatically scans your inbox on a schedule, classifies emails with AI, and then:
- β Sends important emails as notifications via Discord
- ποΈ Automatically deletes unimportant emails from Gmail
Runs fully on your machine β your data stays private.
- Scheduler Trigger β runs the workflow at intervals you define
- Gmail Get Message Node β fetches unread emails
- AI Classifier (Gemini 2.5 Flash Lite) β analyzes & labels emails as
KEEPorDELETE - Code Node β parses AI output into JSON
- IF Node β routes based on classification:
- KEEP β sends you a notification in Discord via webhook
- DELETE β removes the message using Gmail Delete Message Node
ββ inboxguardian-workflow.json # exported n8n workflow
ββ screenshots/ # workflow visuals
β ββ inboxguardian-flow.png # screenshot of workflow
ββ demo.mp4 # short demo video (download & open locally)
ββ README.md # project description & instructions
ββ .gitignore # ignores sensitive files
## π οΈ Run Locally with Docker
### 1. Install Docker Desktop
- Download & install [Docker Desktop](https://www.docker.com/products/docker-desktop/)
- Start Docker Desktop
### 2. Verify Installation
Run this command in terminal/PowerShell:
docker --version
### 3.Create a folder on your machine to persist workflow data (Windows example):
mkdir D:\N8N\inboxguardian
### 4. Run InboxGuardian
Start n8n with the following command:
docker run -it -p 5678:5678 ^
-v D:\N8N\inboxguardian:/home/node/.n8n ^
n8nio/n8n
### π‘ Replace D:\N8N\inboxguardian with your local folder path if different.
### 5. Open n8n
Once the container is running, open:
π http://localhost:5678
-
In n8n, create new Gmail credentials (OAuth2 or service account)
-
Allow read + delete access
-
Discord Webhook
-
Go to your Discord server β Integrations β Webhooks
-
Copy webhook URL and paste into the Discord node in n8n
-
AI Classifier
-
Replace with your own Gemini API Key (from Google AI Studio ) in the workflow
-
In n8n, click Import from File
-
Upload inboxguardian-workflow.json
-
Update credentials with yours
-
Save & activate
πΈ Screenshot: See screenshots/inboxguardian-flow.png
π₯ Video Demo: Watch inboxguardian.mp4
- π Runs on schedule β no IMAP connection needed
- π¨ Connect Gmail node (Get Message)
- π€ Smart AI classification using Gemini 2.5 Flash Lite
- π¨ Important emails β instant Discord alerts
- ποΈ Junk emails β auto-deleted from Gmail
- π Local setup β you control your data
### β
Quick Start:
Clone the repo, run Docker, import the workflow, add your credentials β InboxGuardian is ready π
git clone https://github.com/YOUR-USERNAME/inboxguardian.git
cd inboxguardian
docker run -it -p 5678:5678 -v %cd%:/home/node/.n8n n8nio/n8n
π© Connect with me:
- Email: afnanshoukat35@gmail.com
- LinkedIn: www.linkedin.com/in/afnan-shoukat-030306267