Automate routine Gmail tasks with this advanced n8n workflow template. Use the n8n node for OpenAI (GPT-4o-mini) to intelligently filter unread emails and automatically draft high-quality responses for review.
Download this n8n workflow template and start using it instantly.
Managing a busy inbox is time-consuming, especially when routine replies must be drafted manually. This powerful n8n workflow solves this by introducing AI-powered filtration and drafting directly into your Gmail process. The system uses a specialized n8n node setup to first identify unread emails, extract context, and then employ the GPT-4o-mini model to determine if a reply is necessary. If a reply is required, the AI crafts a concise, polite response. Unlike auto-responders, this n8n workflow generates a draft within the existing thread and labels the email, ensuring you retain final oversight while drastically cutting down on drafting time. This is one of the most practical n8n templates for boosting productivity.
This automation begins with a scheduled n8n trigger, constantly monitoring your Gmail for new, unread messages.
isReply: true/false). If a reply is needed, it drafts a short response (under 120 words).isReply is set to true, the workflow proceeds down the successful path.To deploy this n8n workflow template, follow these steps:
gpt-4o-mini model, requiring a valid API key. Trigger on New Email (Gmail Trigger n8n node):
Function: Starts the n8n workflow when a new unread email arrives.
Key Configuration: Polls for messages with readStatus: unread every minute.
Get Required Fields (Set n8n node):
Function: Extracts necessary data points (thread ID, message body, subject) for the AI and subsequent Gmail actions.
Key Configuration: Maps incoming JSON fields ($json.text, $json.threadId, etc.) to clean variables.
AI Agent (Langchain Agent n8n node):
Function: The core decision-making and drafting engine. Sends the email content to the OpenAI n8n node for processing.
Key Configuration: Uses a detailed prompt to define the drafting rules (polite, under 120 words) and requires the output to be strictly JSON.
OpenAI (Langchain ChatOpenAi n8n node):
Function: Executes the AI task using the specified large language model.
Key Configuration: Configured to use gpt-4o-mini for cost-effective and fast response generation.
Can AI Agent Respond? (If n8n node):
Function: Controls the flow of the n8n workflow, ensuring drafting only happens if the AI determined a reply was needed.
Key Configuration: Checks if the AI output path ($json.output.isReply) equals true.
Create a draft (Gmail n8n node):
Function: If the AI responded positively, this node creates a draft reply in Gmail.
Key Configuration: Uses the thread ID from the initial email to ensure the draft is correctly attached to the conversation.
Automate Gmail attachment handling using this powerful n8n workflow. Filter by sender and file type, decompress ZIPs, upload to Google Drive, and notify via Slack using this versatile n8n template.

Use this efficient n8n workflow to automatically save email attachments from specific senders directly to Google Drive. A ready-to-use n8n template for reliable file backup.

Use this advanced n8n workflow to classify Gmail messages instantly using Google Gemini AI, generate automated replies requiring human approval via Telegram, and receive daily email digests.

Deploy a powerful automated cold email sequence using n8n. This n8n workflow uses Google Sheets for tracking, Gmail for sending, and Slack for real-time notifications, built using efficient n8n templates.


Automation nerd fueled by good coffee, deep curiosity, and clean flows.







































