🤖 Smart email manager with Gmail, GPT-4 classification & auto-responses

1,111 views · 🤖 AI Chatbots & Agents

Description

AI Email Assistant - Smart Email Processing & Response 🤖

A sophisticated n8n workflow that transforms your email management with AI-powered classification, automatic responses, and intelligent organization.

🎯 What This Workflow Does

This advanced AI email assistant automatically:

Perfect for busy professionals, customer service teams, and anyone drowning in email!

✨ Key Features

🧠 Intelligent Email Analysis

📝 AI-Powered Response Generation

🔔 Smart Notification System

📎 Advanced Attachment Management

🏷️ Intelligent Organization

🛠️ Setup Instructions

Prerequisites

Step 1: Import the Workflow

  1. Download AI_Email_Assistant_Community_Template.json
  2. In n8n, navigate to Templates → Import from File
  3. Select the downloaded JSON file
  4. The workflow will import as inactive

Step 2: Configure Credentials

Gmail Setup:

  1. Create Gmail OAuth2 credentials in n8n
  2. Configure the following nodes:
    • Email_Trigger
    • Get Conversation Thread
    • Get Latest Message Content
    • Create Draft Response
    • Assign Classification Label
    • Mark as Processed
    • Get All Gmail Labels
  3. Test connections to ensure proper authentication

AI Model Setup:

  1. Configure the AI Language Model node
  2. Options include:
    • OpenAI (GPT-4, GPT-3.5-turbo)
    • Anthropic Claude (recommended)
    • Local LLMs via Ollama
  3. Add your API credentials
  4. Test the connection

Google Drive Setup (Optional):

  1. Create Google Drive OAuth2 credentials
  2. Configure nodes:
    • Upload to Google Drive
    • Check Existing Attachments
  3. Replace YOUR_GOOGLE_DRIVE_FOLDER_ID with your folder ID
  4. Create a dedicated folder for email attachments

Telegram Alerts (Optional):

  1. Create a Telegram bot via @BotFather
  2. Get your chat ID
  3. Configure the Send Urgent Alert node
  4. Replace YOUR_TELEGRAM_CHAT_ID with your actual chat ID

Step 3: Customize AI Instructions

Email Classification (AI Email Classifier node):

  1. Review the classification criteria in the system message
  2. Adjust urgency keywords for your business
  3. Modify priority levels based on your needs
  4. Customize category definitions

Response Generation (AI Response Generator node):

  1. Update the response guidelines
  2. Replace [YOUR NAME] with your actual name
  3. Adjust tone and style preferences
  4. Add company-specific response templates

Step 4: Configure Gmail Labels

Create Custom Labels in Gmail:

Update Label IDs:

  1. Run the workflow once to get label IDs
  2. Replace YOUR_PROCESSED_LABEL_ID in the “Mark as Processed” node
  3. Update any hardcoded label references

Step 5: Test and Deploy

Testing Process:

  1. Send yourself a test email
  2. Monitor the workflow execution
  3. Verify classification accuracy
  4. Check draft response quality
  5. Confirm labeling works correctly
  6. Test urgent alert functionality

Fine-Tuning:

  1. Adjust AI prompts based on test results
  2. Refine classification criteria
  3. Update response templates
  4. Modify notification preferences

Go Live:

  1. Activate the workflow
  2. Monitor initial performance
  3. Adjust settings as needed

📊 Email Classification System

Priority Levels

Classification Categories

Response Generation Guidelines

🔧 Advanced Customization

File Type Filtering

// In Get Specific File Types node, modify:
if (mimeType === 'application/pdf' || 
    mimeType === 'text/xml' || 
    mimeType === 'image/jpeg') {
    // Process file
}

Custom Urgency Keywords

Update the AI classifier prompt with your business-specific urgent terms:

- Keywords: "URGENT", "EMERGENCY", "CRITICAL", "ASAP", "IMMEDIATE"
- Custom terms: "CLIENT ESCALATION", "SYSTEM DOWN", "LEGAL DEADLINE"

Response Templates

Customize the response generator with your company voice:

- Greeting style: "Hi [Name]" vs "Dear [Name]"
- Closing: "Best Regards" vs "Thank you" vs "Cheers"
- Company-specific phrases and terminology

Integration Options

🚨 Troubleshooting

Common Issues

1. Gmail Authentication Errors

2. AI Classification Inconsistency

3. Response Generation Problems

4. Attachment Upload Failures

5. Missing Notifications

Performance Optimization

📈 Best Practices

1. Email Management

2. AI Optimization

3. Security Considerations

4. Workflow Maintenance

🤝 Contributing to the Community

This workflow template demonstrates:

📄 License & Support

This workflow is provided free to the n8n community under MIT License.

Community Resources:

Professional Support: For enterprise deployments or custom modifications, consider:


Transform your email workflow today! 🚀

This AI Email Assistant reduces email processing time by up to 90% while ensuring no important message goes unnoticed. Perfect for busy professionals who want to stay responsive without being overwhelmed by their inbox.

🔗 Nodes Used

Function, Telegram, Google Drive, Gmail, Gmail Trigger, Basic LLM Chain

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup