The "Executive Assistant" workflow that reads, sorts, and answers your emails 24/7.
See the Flow • Key Features • Prompt Lab • Deploy
🤯 The "Why"
"Be honest — how many times have you opened your inbox and instantly felt overwhelmed?"
It’s not the volume. It’s the decision fatigue. Every unread email is a micro-decision waiting to be made.
-
"Is this urgent?"
-
"Is this spam?"
-
"Do I need to pay this?"
🛑 OLD WAY (Manual Pilot) ✅ NEW WAY (AI Pilot) ❌ Mental Load: High. ❌ Response: Hours/Days. ❌ Stress: Constant. 🧠 Mental Load: Zero. ⚡ Response: Seconds. 🧘 State: Zen.
✨ Key Features
🧠 Contextual Understanding
Doesn't just keyword match. It reads the entire email body to understand sentiment, intent, and urgency.
⚡ Instant Classification
Sorts emails into Priority, Support, Finance, or Promo within seconds of arrival.
✍️ Human-Like Drafting
Pre-writes replies in your tone. You just review and hit send. Zero writing required.
🛡️ Spam Shield
Identifies sophisticated spam that bypasses Gmail's default filters.
🧩 The Workflow Visualized
This is not just a script. It's a cognitive architecture running on n8n.
📂 Repository Structure
A clean look at what resides in this repo.
bashai-inbox-automation/ ├── README.md # 📖 You are reading this ├── JUx2ZfNfD64 - 1.json # 🧠 The Master Workflow (Import this!) └── assets/ # 🖼️ Images & Icons └── banner.gif # (Header Animation)
🧠 Prompt Engineering Lab
This agent isn't just "calling GPT". It uses Role-Based Prompting to switch personas.
🕵️ The Classifier (The Brain)
"Please classify the text provided by the user into one of the following categories: {categories}, and use the provided formatting instructions below. Don't explain, and only output the json."
Categories Defined:
High Priority: Urgent, key stakeholders, deadlines.
Customer Support: Service requests, feedback.
Promotions: Marketing, newsletters.
Finance/Billing: Invoices, receipts.
👔 The Executive Assistant (High Priority)
"You are an executive assistant. Your job is to respond to incoming high priority inquiries as accurately as you can."
(Generates a draft response for your review)
🎧 The Support Rep (Customer Service)
"You are a customer service representative. Your job is to respond to incoming customer support inquiries as accurately as you can, and if it is an inquiry you cannot handle, please refer the user to the following email: customersupport@abccorp.com"
(Sends an automatic reply immediately)
💼 The Accountant (Finance)
"You are a finance/billing assistant. Your job is to summarize incoming emails relating to finance and billing and summarize them in a short and concise way."
(Summarizes and forwards the email)
🚀 Setup Guide (5 Minutes)
1. Pre-Flight Check 📋
- n8n Instance: Running on Cloud or Self-Hosted.
- OpenAI Key: Needs
gpt-4oaccess. - Gmail Account: Accessible via OAuth2.
2. Import & Config 📥
- Download the
JSONfile from this repo. - Import into n8n.
- Credentials: You will see nodes asking for credentials.
Gmail account 2: Create a new Gmail OAuth2 credential.OpenAi account 2: Enter your OpenAI API Key.
3. Critical Customization ⚠️
The workflow has some hardcoded values you MUST change for it to work for you:
| Node Name | Setting to Change | Current Value (CHANGE THIS) |
|---|---|---|
| Send to Finance Dept | To Email | uppitdigital@gmail.com |
| Gmail Trigger | Poll Time | Every Minute (Adjust if needed) |
| Creating Email | System Prompt | customersupport@abccorp.com |
Node-by-Node Explanation
1. Gmail Trigger (Gmail Trigger)
- Role: The Watchdog.
- Settings: Polls every 1 minute.
- Why: Ensures we only process new, unseen emails.
2. Text Classifier (Text Classifier)
- Role: The Router.
- Logic: Uses a specific schema to map email content to one of 4 keys.
3. OpenAI Chat Model
- Role: The Brain.
- Model:
gpt-4o. - Reasoning: We need high intelligence to distinguish between a "Support Request" and a "Support Complaint" (Priority).
4. Action Nodes
- Creating Draft (GPT): Generates a human-like response.
- Draft (Gmail): Saves that response to your drafts folder.
- Auto Reply (Gmail): Automatically replies to the thread.
❓ Frequently Asked Questions
Q: Does this cost money to run?
A: Yes.
- n8n: Free if self-hosted.
- OpenAI: You pay per 1k tokens.
Q: Is it safe to give n8n access to my Gmail?
A: If you self-host n8n, yes. The data never leaves your server except to go to OpenAI for processing.
🛡️ Privacy & Security Policy
Your email data is sensitive. Here is how this workflow handles it:
- Data Transmission: Email bodies are sent to OpenAI API.
- Storage: n8n stores execution logs (inputs/outputs).
- Access Control: The
Gmail Credentialhas read/write access.
Built for the "30 Days of AI Agents" Challenge