Daily AI-Powered Email Digest Creation - n8n Workflow

Automate daily email digests using this powerful n8n workflow. Summarize labeled Gmail messages with OpenAI (GPT-4o Mini) and send a consolidated, formatted HTML report.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Professionals overwhelmed by daily newsletters and industry updates.
Content curators and researchers who need efficient summarization.
Teams looking for automated daily reporting from specific email channels.
Anyone seeking pre-built n8n templates to leverage AI for email management.

Overview

Information overload is a major challenge in modern communication. This robust n8n workflow provides a solution by automating the creation of a daily, curated digest of your most important emails. By utilizing the Gmail n8n node to filter emails based on a specific label and leveraging OpenAI’s advanced models (specifically GPT-4o Mini) for summarization, this automation ensures you only review concise, key takeaways once per day.

This sophisticated n8n workflow combines AI processing with custom code to format the summaries beautifully in HTML, preserving original links and sender context. This is one of the most practical n8n templates for transforming chaotic inboxes into structured knowledge summaries, delivering significant time savings and clarity.

How it Works

This automation initiates using an n8n trigger and follows a clear, multi-stage logic flow:


  1. Scheduled Trigger: The process begins with the Schedule Trigger n8n node, set to run daily (e.g., at 9 AM).

  2. Email Retrieval: The Get mails (last 24h) Gmail n8n node fetches all emails received within the last 24 hours that match a specified Gmail label ID (e.g., 'NEWSLETTER').

  3. Conditional Check: An If n8n node checks if any emails were found. If the item count is zero, the workflow stops via the No Operation node, preventing an empty digest email.

  4. AI Summarization: If emails exist, the workflow passes the content through the LangChain Summarization Mails n8n node. This uses the OpenAI Chat Model n8n node (configured for GPT-4o Mini) along with a highly customized prompt to generate HTML-formatted, bulleted summaries that include link preservation.

  5. Data Preparation: The Edit Fields n8n node extracts the AI-generated summary, the original subject line, and the sender's details.

  6. Content Consolidation: The Combine Subject and Body Code n8n node is crucial. It iterates through all summarized items, structuring them into a single, comprehensive HTML block using H3 headings for the subject and including the sender's email address.

  7. Final Delivery: The final Send Digested mail Gmail n8n node uses the consolidated content as the email body, sending the complete, AI-summarized daily digest to a specified recipient with a dynamically generated subject line that includes the current date. This completes the daily n8n workflow cycle.

Installation Guide

To deploy this powerful n8n workflow, follow these setup steps:


  1. Import the n8n Workflow: Copy the provided JSON and import it directly into your n8n instance via the Workflows section (Import from JSON).

  2. Set up Gmail Credentials: You will need OAuth2 credentials for the Gmail n8n node. Configure the credentials for both the 'Get mails' node and the 'Send Digested mail' node.

  3. Configure Email Retrieval: In the Get mails (last 24h) n8n node, replace YOURLABELID with the actual Gmail label ID you wish to track and summarize.

  4. Set up OpenAI Credentials: Configure your OpenAI API credentials. The OpenAI Chat Model n8n node requires access to the API.

  5. Configure Recipient: In the Send Digested mail n8n node, update the sendTo parameter to your preferred email address.

  6. Activate: Save and activate the n8n workflow. The n8n trigger will begin execution daily at the scheduled time.

Node Details

This n8n workflow utilizes a specialized set of nodes to manage scheduling, retrieval, AI processing, and final delivery:

Schedule Trigger (n8n trigger): Sets the automation to run daily at 9:00 AM.
Get mails (last 24h) (Gmail n8n node): Operation is 'getAll'. Key configuration includes filtering by labelIds (YOURLABELID) and receivedAfter (last 24 hours), ensuring only relevant and recent emails are processed by this n8n node.
If (Core Logic n8n node): Checks if the item count ($items().length) is greater than zero, determining whether to proceed with expensive AI operations.
OpenAI Chat Model (LangChain n8n node): Configured to use the o4-mini model for cost-effective, high-quality summarization. Provides the underlying AI engine for the LangChain summarization n8n node.
Summarization Mails (LangChain n8n node): Uses the 'stuff' method. The custom prompt is highly detailed, instructing the AI to create concise, HTML-formatted summaries, use bullet points, and preserve external links.
Combine Subject and Body (Code n8n node): This custom JavaScript n8n node aggregates the individually summarized emails into a single combinedContent output item, formatting each summary with an H3 header containing the subject and truncated sender address.


  • Send Digested mail (Gmail n8n node): Sends the final formatted HTML content as the message body, completing the n8n workflow delivery step.

Related n8n Workflows

Free

Nodes: 11 Nodes
Updated: December 26 2025
View all
Created by

Passionate about building intelligent systems and scalable infrastructure.

Featured*