AI-Powered Email Assistant with Human Review
Integrates with:
Overview
Unlock Efficient Email Management with this AI Agent
This n8n workflow acts as an intelligent email assistant. It connects to your IMAP email server, fetches new emails, and converts them to markdown for optimal AI processing. The AI Agent then uses a Langchain summarization chain (powered by models like DeepSeek) to create a concise summary. Based on this summary and the original email, a Langchain agent leveraging OpenAI's GPT models (like GPT-4o-mini) drafts a professional reply. Crucially, this draft is first sent to a designated human reviewer via email. Only upon approval is the AI-generated response automatically sent to the original sender. This AI Agent empowers you to manage email overload efficiently while maintaining full control over outbound communications.
Key Features & Benefits
- AI-Driven Summarization: Automatically condenses incoming emails using Langchain and LLMs (e.g., DeepSeek), saving you reading time.
- Intelligent Reply Drafting: Generates context-aware, professional email replies using OpenAI's advanced models (e.g., GPT-4o-mini) through a Langchain agent.
- Human-in-the-Loop Approval: Ensures all AI-generated replies are reviewed and approved by a human before sending, maintaining quality and brand voice.
- Automated Email Handling: Fetches emails via IMAP, processes them, and sends replies via SMTP, reducing manual effort.
- Optimized for AI: Converts HTML emails to Markdown for improved understanding by LLMs.
- Customizable AI Behavior: System prompts for both summarization and reply generation can be tailored to specific needs.
- Increased Productivity: Significantly speeds up email response times and helps manage high email volumes.
Use Cases
- For B2C e-commerce: Triage incoming customer inquiries, with AI drafting initial responses for common questions (e.g., order status, returns), which are then human-verified before sending, improving response speed and consistency.
- For B2B SaaS: Assist sales development reps by summarizing new lead emails and drafting initial outreach or follow-up messages, subject to sales manager approval, ensuring brand alignment.
- For Solopreneurs & Founders: Manage general business inquiries by having the AI draft replies, allowing for quick review and approval, freeing up time for core business activities.
- For CTOs & Heads of Automation: Implement a scalable, AI-enhanced email workflow that balances automation with human oversight, perfect for departments like HR, partnerships, or internal support.
Prerequisites
- An n8n instance (Cloud or self-hosted).
- OpenAI API Key (e.g., for GPT-4o-mini).
- DeepSeek API Key (for the
deepseek-chat
model used in summarization). - IMAP and SMTP credentials for the email account to be monitored and used for sending.
- Email address for receiving approval requests.
Setup Instructions
- Download the n8n workflow JSON file.
- Import the workflow into your n8n instance.
- Configure the 'Email Trigger (IMAP)' node with your IMAP server details and credentials.
- In the 'Email Summarization Chain' node, ensure the connected 'OpenAI Chat Model' (this node might be generically named but is configured for DeepSeek) is set up with your DeepSeek API Key and the
deepseek-chat
model identifier. - In the 'Write email' Langchain Agent node, ensure the connected 'OpenAI' Chat Model node (this node might be generically named 'OpenAI' or similar) is configured with your OpenAI API Key and the desired model (e.g.,
gpt-4o-mini
). - Customize the system prompts within the 'Email Summarization Chain' node (specifically its prompt parameters for
prompt
andcombineMapPrompt
) and the 'Write email' Langchain Agent node (systemMessage
parameter) to tailor the AI's behavior. - Update the 'To Email' field in the 'Approve Email' node to your email address (or the reviewer's email address) for receiving approval requests.
- Configure the 'Send Email' node (connected after the 'Approved?' node) with your SMTP server details and credentials for sending the final AI-assisted reply.
- Review and adjust expressions in the final 'Send Email' node for subject (e.g.,
Re: {{ $('Email Trigger (IMAP)').item.json.subject }}
), recipient ({{ $('Email Trigger (IMAP)').item.json.from }}
), and sender ({{ $('Email Trigger (IMAP)').item.json.to }}
) to ensure they match your email setup (e.g., the sender email might be a fixed address). - Activate the workflow and test with a sample email.
Want your own unique AI agent?
Talk to us - we know how to build custom AI agents for your specific needs.
Schedule a Consultation