Skip to main content

Auto-categorize Gmail emails with AI and send prioritized Slack alerts

Workflow preview

Workflow preview
100%
Auto-categorize Gmail emails with AI and send prioritized Slack alerts preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Who is this for? Teams using Gmail and Slack who want to streamline email handling. Customer support, sales, and operations teams that want emails sorted by topic and priority automatically. Anyone...

Best for

  • AI Summarization automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmailtrigger, n8n-nodes-base.gmail, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.set, n8n-nodes-base.slack

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Matt Chong | n8n Creator.

Original n8n.io source

1.1 Workflow description

Title
Auto-categorize Gmail emails with AI and send prioritized Slack alerts
Workflow name
Auto-categorize Gmail emails with AI and send prioritized Slack alerts

Who is this for?

  • Teams using Gmail and Slack who want to streamline email handling.
  • Customer support, sales, and operations teams that want emails sorted by topic and priority automatically.
  • Anyone tired of manually triaging customer emails.

What does it solve?

  • Stops important messages from slipping through the cracks.
  • Automatically identifies the nature and urgency of incoming emails.
  • Routes emails to the right Slack channel with a clear, AI-generated summary.

How it works

  • The workflow watches for unread emails in your Gmail inbox.
  • It fetches the full email content and passes it to OpenAI for classification.
  • The AI returns structured JSON with the email’s category, priority, summary, and sender.
  • Based on the AI result, it assigns a label and Slack channel.
  • A message is sent to the right Slack channel with the details.

How to setup?

  1. Connect credentials:

    • Gmail (OAuth2)
    • Slack (OAuth2)
    • OpenAI (API Key)
  2. Adjust email polling:

    • Open the Gmail Trigger node and set how frequently it should check for new emails.
  3. Verify routing settings:

    • In the “Routing Map” node, update Slack channel IDs for each category if needed.
  4. Customize AI behavior (optional):

    • Tweak the AI Agent prompt to better match your internal categorization rules.

How to customize this workflow to your needs

  • Add more categories: Update the AI prompt and the schema in the “Structured Output Parser.”
  • Change Slack formatting: Modify the message text in the Slack node to include links, emojis, or mentions.
  • Use different routing logic: Expand the Routing Map to assign based on keywords, domains, or even sentiment.
  • Add escalation workflows: Trigger follow-up actions for high-priority or complaint emails.

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 - Trigger on Unread Email

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1.3

Block 2 - Get Email

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

Block 3 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 4 - OpenAI Chat Model

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

Block 5 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 6 - Routing Map

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

Block 7 - Send Notification to Slack

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

3. Summary Table

Workflow Auto-categorize Gmail emails with AI and send prioritized Slack alerts
Complexity intermediate
Nodes 7
Categories AI Summarization, Multimodal AI
Author Matt Chong | n8n Creator
Published 20 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7643/7643.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 Auto-categorize Gmail emails with AI and send prioritized Slack alerts do?

Who is this for? Teams using Gmail and Slack who want to streamline email handling. Customer support, sales, and operations teams that want emails sorted by topic and priority automatically. Anyone...

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 AI Summarization, Multimodal AI use case.