Skip to main content

Ai-powered email triage & auto-response system with OpenAI agents & Gmail

Workflow preview

Workflow preview
100%
Ai-powered email triage & auto-response system with OpenAI agents & Gmail preview
Open on n8n.io

Important notice

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

1. Workflow Overview

AI Email Dispatcher: Classify, Process, and Route Emails with Multiple Agents This n8n template automatically classifies incoming emails (Sales, Support, Internal, Finance, Promotions) and routes t...

Best for

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

Tools used

n8n-nodes-base.manualtrigger, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.gmail, @n8n/n8n-nodes-langchain.textclassifier, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.if, n8n-nodes-base.gmailtrigger, n8n-nodes-base.telegram

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Ai-powered email triage & auto-response system with OpenAI agents & Gmail
Workflow name
Ai-powered email triage & auto-response system with OpenAI agents & Gmail

AI Email Dispatcher: Classify, Process, and Route Emails with Multiple Agents

This n8n template automatically classifies incoming emails (Sales, Support, Internal, Finance, Promotions) and routes them to a dedicated OpenAI LLM Agent for processing. Depending on the category, the agent will then:

  • Internal/Customer Support: Draft a reply and send it.
  • Sales/Finance/Promotions: Generate a summary, notification, or draft reply for a human to review.

This is the ultimate workflow for managing a high volume of emails, ensuring every message gets a fast, appropriate, and structured AI-powered response or initial analysis.

How it works

  • The Gmail Trigger node monitors your inbox for unread emails.
  • The Text Classifier node uses AI to read the email body and subject to categorize it as Internal, Customer Support, Sales, Promotions, or Admin/Finance.
  • The workflow then uses a Split In Batches node and multiple If nodes to send the email data to a specific, specialized OpenAI Agent (LLM node) based on the classification.
  • Each AI Agent has a custom system prompt (e.g., "Customer Support Agent," "Promotions Analyst") to ensure it processes the email with the right rules, tone, and output format.
  • Finally, the workflow either automatically replies via Gmail (for Internal and Support) or creates a draft/summary and sends a notification (for Sales, Finance, and Promotions) for human review.

Set up steps

Setting up the accounts and nodes should take about 10–15 minutes.

  1. Gmail Account: You'll need to set up two Gmail credentials for the workflow:
    • One for the Gmail Trigger to watch for new unread emails.
    • A second one for the Gmail action nodes to label, draft, and reply to messages.
  2. OpenAI Account: Connect your OpenAI API Key to the five different LLM Agent nodes.
  3. Telegram/Slack: Set up your Telegram or Slack credentials to receive the 'New Sales Opportunity' and 'New Finance' notifications.
  4. Labels in Gmail: Before activating the workflow, make sure you have created the necessary labels in your Gmail account for the classifier (Internal, Customer Support, Promotions, Admin/Finance, Sales Opportunity).
  5. Review Agent Prompts: The instructions and logic for each AI Agent are in the system messages. You might want to review and customize these prompts to match your specific business rules and tone.

Requirements

  • Gmail Account
  • OpenAI Account (or another LLM provider for the agents)
  • Telegram (or Slack/other notification tool of your choice)

Customising this workflow

You can easily adapt this template to suit your needs!

  • New Categories: Modify the Text Classifier node to add or remove categories (e.g., "Job Applications," "Partnerships"). You would then add a new LLM Agent and routing logic for the new category.
  • Different LLMs: You can swap the OpenAI nodes for any other LLM service supported by n8n, such as Gemini or Anthropic Claude, by simply changing the node type or model ID.
  • More Actions: Instead of just sending a notification to Telegram, you could modify the logic to create a task in ClickUp, a lead in Salesforce, or an entry in a Google Sheet when a "Sales Opportunity" email is identified. 📬✨

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 - When clicking ‘Execute workflow’

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

Block 2 - Message a model

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 3 - Send a message

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

Block 4 - Text Classifier

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

Block 5 - OpenAI Chat Model

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

Block 6 - Add Label: Internal

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

Block 7 - Add Label: Customer Support

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

Block 8 - Add Label: Promotions

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

Block 9 - Add Label: Admin/Finance

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

Block 10 - Add Label: Sales Opportunities

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

Block 11 - If

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

Block 12 - Gmail3

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

Block 13 - Gmail4

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

Block 14 - Gmail Trigger1

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

Block 15 - Customer Support Agent

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 16 - Internal Agent

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 17 - Promotions Analyst Agent

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 18 - Finance & Billing Assistant Agent

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 19 - Sales Agent

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 20 - Gmail1

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

Block 21 - Gmail5

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

Block 22 - Finance & Billing Assistant notifier

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

Block 23 - Sales Notifier

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

Block 24 - Internal notifier

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

Showing the first 24 of 68 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Ai-powered email triage & auto-response system with OpenAI agents & Gmail
Complexity advanced
Nodes 68
Categories Ticket Management, AI Chatbot
Author Abdullahi Ahmed
Published 01 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9157/9157.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 Ai-powered email triage & auto-response system with OpenAI agents & Gmail do?

AI Email Dispatcher: Classify, Process, and Route Emails with Multiple Agents This n8n template automatically classifies incoming emails (Sales, Support, Internal, Finance, Promotions) and routes t...

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 Chatbot use case.