Daily Email Digest Summarized by GPT - n8n Workflow

Use this robust n8n workflow to automatically summarize your daily Gmail emails using OpenAI GPT. This powerful n8n template runs daily at 4 PM, combining email content into a concise, actionable summary sent directly to your inbox.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Busy Professionals: Individuals who receive a high volume of emails daily and need a quick, prioritized summary.
Automation Enthusiasts: Users seeking practical n8n templates that combine cloud services (Gmail) and AI (OpenAI).
Team Leaders: Managers who want an efficient way to track critical communications without deep-diving into their full inbox.
n8n Users: Anyone looking for a production-ready example of how to use the Cron n8n trigger and the OpenAI n8n node together.

Overview

Managing a constantly flowing email inbox can be a major drain on productivity. This automated solution tackles inbox overload by leveraging the power of an n8n workflow coupled with advanced artificial intelligence. This specific n8n template is designed to run automatically every afternoon, ensuring you catch up on the day's communications just before logging off.

The n8n workflow first identifies all emails received today. It then securely extracts the key metadata (sender, subject, snippet) and feeds this consolidated text block into the OpenAI n8n node. GPT is instructed to analyze, summarize, and prioritize topics and action items. The final, digestible summary is then delivered back to your inbox via a final Gmail n8n node, creating a seamless, hands-free summary process. This powerful n8n automation ensures you never miss a critical message while regaining hours of time spent scanning irrelevant threads.

How it Works

This comprehensive n8n workflow operates through a structured six-step process, initiated by a scheduled n8n trigger:


  1. Afternoon Trigger (4 PM): The automation begins using the Cron n8n trigger, set to fire daily at 16:00 (4:00 PM). This schedule is fully adjustable within the n8n node parameters.

  2. Calculate Today's Dates: A Function n8n node dynamically determines two critical time markers: midnight today (minDate) and the exact time the workflow is running (nowDate). These variables are essential for scoping the Gmail search.

  3. Get Today's Emails (Gmail): The dedicated Gmail n8n node uses the calculated dates to query the inbox, fetching only emails received between 00:00 and 16:00 today. The query syntax uses after: and before: operators.

  4. Combine Email Content: Another Function n8n node iterates through all retrieved emails. It extracts the sender, subject, and snippet from each item, combining them into a single, structured text string suitable for AI processing.

  5. AI: Summarize Emails: The core logic runs here. The OpenAI n8n node receives the massive block of combined email text. It utilizes a detailed system prompt to instruct the AI (using models like gpt-3.5-turbo or gpt-4o) to generate a concise summary of key topics and action items. This summary is the main output of this n8n node.

  6. Send Summary Email: Finally, a second Gmail n8n node takes the AI-generated summary and sends it as a new email. The recipient and subject are configured to provide a clear, dated digest to the user, finalizing the entire n8n workflow.

Installation Guide

To deploy this efficient n8n workflow template, follow these steps:


  1. Import: Copy the provided JSON code and import it directly into your n8n instance via the 'Workflows' section.

  2. Set Credentials: You will need two main credentials:

Gmail API: Set up a Gmail API credential to allow the n8n node to read your emails and send new ones. Ensure the API scope includes read and compose access.
OpenAI API: Set up your OpenAI API Key credential. This is required for the summarization step using the OpenAI n8n node.

  1. Configure Gmail Settings: In the 'Send Summary Email' n8n node, update the To Email parameter from YOURRECIPIENT[email protected] to your actual email address, and confirm your From Email matches your authenticated Gmail account.

  2. Adjust Trigger (Optional): If 4:00 PM is not your ideal time, modify the 'Afternoon Trigger (4 PM)' n8n trigger node by adjusting the 'Hour' and 'Minute' settings.

  3. Activate: Save the n8n workflow and toggle the status to 'Active'. The n8n automation will now run daily at the scheduled time.

Node Details

Afternoon Trigger (4 PM) (Cron):
Function: Serves as the primary n8n trigger, scheduling the execution.
Key Configuration: Set to run everyDay at 16:00 (4:00 PM) server time.
Calculate Today's Dates (Function):
Function: Generates minDate (start of day) and nowDate (current timestamp) necessary for the Gmail search query.
Key Configuration: Uses the internal DateTime object within n8n to ensure accurate time calculation.
Get Today's Emails (Gmail):
Function: Fetches up to 20 emails received today using the powerful date variables from the previous n8n node.
Key Configuration: Operation: getAll, Email Type: inbox, Query: dynamically constructs after:{{ $json.minDate }} before:{{ $json.nowDate }}.
Combine Email Content (Function):
Function: Parses the JSON output from the Gmail n8n node and formats the sender, subject, and snippet into a single string for AI input.
Key Configuration: Custom JavaScript logic to aggregate email items.
AI: Summarize Emails (OpenAI):
Function: Generates a concise summary of the day’s emails, identifying key topics and action items.
Key Configuration: Model: gpt-3.5-turbo, uses a detailed system prompt for role definition, and feeds the combinedEmails variable into the user prompt. This is a crucial n8n node for the workflow's value.
Send Summary Email (Gmail):
Function: Delivers the final, AI-generated summary to the specified user.
Key Configuration: Uses an expression for the subject line to include the current date: Daily Email Summary: {{ DateTime.now().toFormat('cccc, LLLL dd, yyyy') }}, and injects the AI summary into the email body.

Related n8n Workflows

Free

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

AI PhD with 7 years experience as a game dev CEO, currently teaching, helping others and building something new.

Featured*