Skip to main content

Automate email management with OpenAI classification, Gmail drafts & Slack alerts

Workflow preview

Workflow preview
100%
Automate email management with OpenAI classification, Gmail drafts & 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

What it does This workflow automatically processes incoming emails with intelligent AI classification, creating draft responses and sending Slack notifications based on email content. How it works ...

Best for

  • Ticket Management automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.gmailtrigger, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.code, n8n-nodes-base.gmail, n8n-nodes-base.switch

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Automate email management with OpenAI classification, Gmail drafts & Slack alerts
Workflow name
Automate email management with OpenAI classification, Gmail drafts & Slack alerts

What it does

This workflow automatically processes incoming emails with intelligent AI classification, creating draft responses and sending Slack notifications based on email content.

How it works

  1. Monitors emails with the 'AI-Agent' label
  2. AI classification into categories: Inquiry, Support, Newsletter, Action Item
  3. Adds appropriate labels to emails automatically
  4. Creates draft replies for Support and Inquiry emails
  5. Sends Slack notifications for Action Items and Newsletter summaries

Setup Requirements

  • Gmail OAuth2 credentials configured
  • OpenAI API credentials (or other AI provider)
  • Slack OAuth2 credentials (if notifications desired)
  • Gmail labels created (see setup instructions below)

How to customize

  • Modify classification categories in the AI Agent
  • Adjust label mappings in the Parse Classification node
  • Customize draft response templates
  • Configure different Slack channels for different email types

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 - Workflow Description

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

Block 2 - Gmail Setup Instructions

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

Block 3 - Gmail Trigger - AI Agent Label

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

Block 4 - Extract Email Data

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

Block 5 - AI Agent - Email Classifier

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

Block 6 - OpenAI Chat Model

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

Block 7 - Parse AI Classification

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

Block 8 - AI Classification Info

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

Block 9 - Add Classification Label

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

Block 10 - Route by Category

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3

Block 11 - Success Actions Info

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

Block 12 - Error Handling Info

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

Block 13 - Create Draft Response

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

Block 14 - Send Action Item Slack Alert

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

Block 15 - Send Newsletter Summary to Slack

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

Block 16 - Slack Setup Instructions

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

3. Summary Table

Workflow Automate email management with OpenAI classification, Gmail drafts & Slack alerts
Complexity advanced
Nodes 16
Categories Ticket Management, AI Summarization
Author Fabian ZNTL
Published 30 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5475/5475.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 Automate email management with OpenAI classification, Gmail drafts & Slack alerts do?

What it does This workflow automatically processes incoming emails with intelligent AI classification, creating draft responses and sending Slack notifications based on email content. How it works ...

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