AI Email Summarization and Instant Slack Alerting - n8n Workflow

Automate Gmail analysis. This powerful n8n workflow uses GPT-4o-mini to summarize unread emails and instantly send concise alerts to Slack. Get started with these n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Professionals overwhelmed by high email volume.

  • Teams needing immediate, concise summaries of critical communications.

  • Users looking for advanced n8n templates integrating AI and communication tools.

  • n8n automation specialists setting up complex, reliable information flows.

Overview

This advanced n8n workflow provides a solution for email overload by leveraging large language models (LLMs). Instead of constantly monitoring your inbox, this robust n8n automation flow detects new, unread emails using a specific n8n trigger, fetches the content, and passes it to an OpenAI model (GPT-4o-mini). The result is a highly structured, 250-character summary delivered directly to a specified Slack channel, ensuring high-priority information is never missed. Utilizing a structured output parser, this n8n node setup guarantees the reliability of the summarized data before it hits Slack. This specific n8n workflow demonstrates the power of combining standard communication services with cutting-edge AI.

How it Works

This efficient n8n workflow operates through a sequence of integrated steps:


  1. The n8n trigger, configured as the Gmail Trigger n8n node, continuously polls your inbox (set to check every minute) and activates the n8n workflow only when a new email is marked as unread.

  2. The Get Email n8n node then retrieves the full body content of the triggered email using the message ID passed by the n8n trigger.

  3. The core AI logic begins in the AI Agent n8n node. The email content is injected into a specialized prompt instructing the LLM to summarize the email concisely (max 250 characters) and format the output as strict JSON.

  4. The AI Agent utilizes the connected OpenAI Chat Model n8n node (running the fast and efficient gpt-4o-mini) to perform the summarization task.

  5. A Structured Output Parser n8n node ensures that the AI's output strictly adheres to the defined JSON schema (containing sender and summary fields). This step is crucial for maintaining reliable data quality within the n8n workflow.

  6. Finally, the Slack n8n node takes the validated summary and sender information and delivers a clean, concise alert message to your chosen channel or user, completing the n8n automation.

Installation Guide

To implement this powerful n8n workflow, follow these steps:


  1. Import the n8n workflow JSON: Copy the provided JSON code and import it directly into your n8n instance using the 'New' menu and selecting 'Import from JSON'.

  2. Connect Gmail Credentials: Configure the 'Trigger on Unread Email' and 'Get Email' n8n node with your Gmail OAuth2 credentials.

  3. Connect OpenAI Credentials: Configure the AI Agent's Language Model node ('OpenAI Chat Model') with your OpenAI API Key credentials.

  4. Connect Slack Credentials: Configure the 'Send Notification to Slack' n8n node with your Slack OAuth2 credentials, ensuring it has permission to post to the desired channel or user.

  5. Review Configuration: Optionally, review the frequency setting in the Gmail n8n trigger and the prompt instructions in the AI Agent n8n node if you require different summary lengths or tones.

  6. Activate the n8n workflow: Once all credentials are set up, save and activate the n8n workflow.

Node Details

Trigger on Unread Email (Gmail Trigger n8n node):
Function: Acts as the starting n8n trigger. It listens specifically for new emails that are currently marked as 'unread'.
Key Configuration: Polling is set to check for new items 'every minute'.
Get Email (Gmail n8n node):
Function: Fetches the complete content of the email identified by the trigger.
Key Configuration: Uses the expression ={{ $json.id }} to dynamically retrieve the correct email based on the output of the preceding n8n trigger.
AI Agent (LangChain AI Agent n8n node):
Function: Orchestrates the summarization process. Defines the role, goal, and constraints (JSON output format, 250 character limit) for the LLM.
Key Configuration: The prompt strictly defines the required output JSON fields: sender and summary. It takes input from {{ $json["text"] }}.
OpenAI Chat Model (LangChain LM ChatOpenAI n8n node):
Function: Executes the large language model call.
Key Configuration: Uses the gpt-4o-mini model for fast and cost-effective summarization within this specific n8n workflow.
Structured Output Parser (LangChain Output Parser n8n node):
Function: Enforces a rigid JSON output structure based on a defined schema, maximizing the reliability of the AI's response for downstream nodes.
Key Configuration: Schema enforces two required string properties: sender and summary (with a max length of 250).
Send Notification to Slack (Slack n8n node):
Function: Publishes the finalized, structured summary to Slack.
Key Configuration: Message text is formatted using the parsed AI output: ={{ $json.output.sender }}: {{ $json.output.summary }}.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by
Matt Chong | n8n Creator
Matt Chong | n8n Creator

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

Featured*