Create AI-Summarized Email Digests from Gmail Labels with OpenAI O4-Mini

Go to Workflow
20 views
Built by German Velibekov German Velibekov
Created on June 07, 2026

Description

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Transform email overload into actionable insights with this automated daily digest workflow that intelligently summarizes categorized emails using AI.

Who's it for

This workflow is perfect for busy professionals, content creators, and newsletter subscribers who need to stay informed without spending hours reading through multiple emails. Whether you're tracking industry news, monitoring competitor updates, or managing content subscriptions, this automation helps you extract key insights efficiently.

How it works

The workflow runs automatically each morning at 9 AM, fetching emails from a specific Gmail label received in the last 24 hours. Each email is processed through OpenAI's language model using LangChain to create concise, readable summaries that preserve important links and formatting. All summaries are then combined into a single, well-formatted digest email and sent to your inbox, replacing dozens of individual emails with one comprehensive overview.

How to set up

Create a Gmail label for emails you want summarized (e.g., "Tech News", "Industry Updates")
Configure credentials for both Gmail OAuth2 and OpenAI API in their respective nodes
Update the Gmail label ID in the "Get mails (last 24h)" node with your specific label
Set your email address in the "Send Digested mail" node
Adjust the schedule in the Schedule Trigger if you prefer a different time than 9 AM
Test the workflow with a few labeled emails to ensure proper formatting

Requirements

Gmail account with OAuth2 authentication configured
OpenAI API account and valid API key
At least one Gmail label set up for email categorization
Basic understanding of n8n workflow execution

How to customize the workflow

Change summarization style: Modify the prompt in the "Summarization Mails" node to adjust tone, length, or format of summaries. You can make summaries more technical, casual, or focus on specific aspects like action items.

Adjust time range: Change the receivedAfter parameter in the Gmail node to fetch emails from different time periods (last 2 days, last week, etc.).

Multiple labels: Duplicate the Gmail retrieval section to process multiple labels and combine them into categories within your digest.

Add filtering: Insert additional conditions to filter emails by sender, subject keywords, or other criteria before summarization.

Custom formatting: Modify the "Combine Subject and Body" code node to change the HTML structure, add styling, or include additional metadata like email timestamps or priority indicators.

Nodes Used (6)

Code
n8n-nodes-base.code
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Gmail
n8n-nodes-base.gmail
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter
Summarization Chain
@n8n/n8n-nodes-langchain.chainSummarization