This repository contains an n8n workflow that automates email management and intelligent response drafting using Google services and AI. Itβs designed to help you automatically handle common email questions while alerting you about messages that require personal attention.
- Automated Gmail Trigger β Detects new incoming messages.
- AI-Powered Reply Generation β Uses n8n Agent node connected to Google Gemini to understand the email and generate concise, contextually correct replies.
- Google Docs Integration β Drafts the email response in a connected Google Doc.
- Smart Filtering β Determines if the email is a common question; otherwise, flags it for manual review.
- Google Sheets Logging β Logs sender, email body, AI-generated reply, link to the message, and response status.
- Slack Notifications β Sends real-time updates about sent or pending replies.
Monitors Gmail inbox for new βImportantβ emails.
Retrieves full email content and metadata, including sender and subject.
Builds a Gmail link and prepares email data for the agent.
Processes the email through Google Gemini, generating a short and relevant reply (max two sentences).
- Uses a Google Docs tool to draft the reply.
- If not a βcommon question,β asks for manual handling.
Uses an If node to check if the AIβs output contains a Gmail link (meaning manual response required).
- If the email is handled automatically β Sends response via Gmail.
- Otherwise β Sends notification to Slack with link to the message.
Appends the email record (sender, content, response, status, and link) into Google Sheets for tracking.
- n8n.io
- Google Workspace APIs:
- Gmail API
- Google Docs API
- Google Sheets API
- Slack API
- LangChain / Google Gemini (PaLM API)
-
Import the workflow
- Download the
.jsonfile from this repository. - Open your n8n editor β click Import Workflow β upload the file.
- Download the
-
Connect Credentials
- Gmail OAuth2
- Google Docs OAuth2
- Google Sheets OAuth2
- Slack OAuth2
- Google Gemini (PaLM) API key
-
Update Resource IDs
- Replace Google Doc and Google Sheet IDs with your own.
- Update Slack user/channel references.
-
Activate the workflow
- Click execute the workflow to get workflow started
When a client emails you asking a common question like:
βCan you share your availability for next week?β
The workflow will:
- Detect the new email.
- Pass it through the AI agent.
- Draft a polite reply using information from the Google Doc.
- Send the reply automatically if appropriate.
- Log the interaction and notify you on Slack.
If itβs a more complex or personal message, itβll skip sending and notify you to handle it manually.
| File | Description |
|---|---|
email responder assistant.json |
n8n workflow file |
Built by Onyebuchi Nnamani β automating intelligent email operations with n8n & AI.
MIT License. Feel free to modify and adapt for your own workflows.