Skip to main content

Create AI-summarized email digests from Gmail labels with OpenAI O4-Mini

Workflow preview

Workflow preview
100%
Create AI-summarized email digests from Gmail labels with OpenAI O4-Mini preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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...

Best for

  • Personal Productivity automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.if, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.documentdefaultdataloader, @n8n/n8n-nodes-langchain.textsplitterrecursivecharactertextsplitter, n8n-nodes-base.noop, n8n-nodes-base.set, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.chainsummarization

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by German Velibekov.

Original n8n.io source

1.1 Workflow description

Title
Create AI-summarized email digests from Gmail labels with OpenAI O4-Mini
Workflow name
Create AI-summarized email digests from Gmail labels with OpenAI O4-Mini

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

  1. Create a Gmail label for emails you want summarized (e.g., "Tech News", "Industry Updates")
  2. Configure credentials for both Gmail OAuth2 and OpenAI API in their respective nodes
  3. Update the Gmail label ID in the "Get mails (last 24h)" node with your specific label
  4. Set your email address in the "Send Digested mail" node
  5. Adjust the schedule in the Schedule Trigger if you prefer a different time than 9 AM
  6. 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.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 2 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 3 - Default Data Loader

Type / Role
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - documentDefaultDataLoader
Config choices
Version 1.1

Block 4 - Recursive Character Text Splitter

Type / Role
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - textSplitterRecursiveCharacterTextSplitter
Config choices
Version 1

Block 5 - No Operation, do nothing

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 6 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Combine Subject and Body

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Summarization Mails

Type / Role
@n8n/n8n-nodes-langchain.chainSummarization - chainSummarization
Config choices
Version 2.1

Block 9 - Send Digested mail

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 10 - Get mails (last 24h)

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 11 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 12 - Main Workflow Explanation

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Email Retrieval Section

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - AI Processing Section

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Formatting and Output Section

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Conditional Processing

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Create AI-summarized email digests from Gmail labels with OpenAI O4-Mini
Complexity advanced
Nodes 16
Categories Personal Productivity, AI Summarization
Author German Velibekov
Published 10 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5839/5839.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Create AI-summarized email digests from Gmail labels with OpenAI O4-Mini do?

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...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity, AI Summarization use case.