Skip to main content

Email AI Agent (with step by step video)

Workflow preview

Workflow preview
100%
Email AI Agent (with step by step video) preview
Open on n8n.io

1. Workflow Overview

Video Introduction Want to ...

Best for

  • Ticket Management automation workflows
  • AI RAG automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmailtrigger, n8n-nodes-base.datatable, n8n-nodes-base.gmail, n8n-nodes-base.aggregate, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.gmailtool, n8n-nodes-base.telegramtool

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Milan Vasarhelyi - SmoothWork.

Original n8n.io source

1.1 Workflow description

Title
Email AI Agent (with step by step video)
Workflow name
Email AI Agent (with step by step video)

Video Introduction

Want to automate your inbox or need a custom workflow? 📞 Book a Call | 💬 DM me on Linkedin

What This Workflow Does

This AI-powered email assistant automatically processes incoming Gmail messages, categorizes them, adds appropriate labels, and drafts intelligent responses based on your company's knowledge base. When a new email arrives, the AI agent analyzes the content, determines the category (such as "existing_order" or "quote_request"), applies the correct Gmail label for organization, and drafts a contextually appropriate response. You receive a Telegram notification with a direct link to review and send the draft with one click.

Key Features

  • Automatic Email Categorization: The AI analyzes incoming emails and assigns them to predefined categories
  • Smart Response Drafting: Generates detailed, personalized responses using your company's knowledge base
  • Gmail Label Management: Automatically applies appropriate labels to keep your inbox organized
  • Instant Notifications: Get Telegram alerts with direct links to review drafts
  • Knowledge Base Integration: Uses n8n Data Tables to store company information, pricing, policies, and common responses

Common Use Cases

  • Customer support teams handling quotation requests
  • Sales teams managing order inquiries
  • Small businesses automating routine email responses
  • Anyone wanting to save hours on email management each week

Setup and Configuration

Required Accounts:

  • Gmail account with OAuth2 connection
  • OpenAI API account for the chat model
  • Telegram bot for notifications

Initial Setup:

  1. Connect your Gmail account to both the Gmail Trigger and Gmail tool nodes
  2. Create a Data Table called "Customer Support Knowledge Base" containing your business information, response style guide, product details, pricing, delivery policies, and FAQs
  3. Configure your Telegram bot credentials and update the chat ID in the Telegram node
  4. Set up your OpenAI API credentials

Customization:

  • Knowledge Base: Populate the Data Table with your specific company information - this is what the AI uses to draft accurate responses
  • AI Prompt: Adjust the categorization rules and response criteria in the AI Agent node to match your business needs
  • Polling Frequency: The Gmail Trigger checks for new emails every minute by default; modify this in the trigger settings if needed

The workflow uses the "Simplify" option turned off in the Gmail Trigger to ensure the AI receives the full email text for processing.

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 - New Email Trigger

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

Block 2 - Get Knowledge Base Data

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

Block 3 - Get Gmail Labels List

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

Block 4 - Aggregate Labels Data

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

Block 5 - Email Categorization AI Agent

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

Block 6 - OpenAI Chat Model

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

Block 7 - Create a draft in Gmail

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

Block 8 - Add label to message in Gmail

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

Block 9 - Send a text message in Telegram

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

Block 10 - Workflow Description

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

Block 11 - Creator Contact Info

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

Block 12 - Video Walkthrough

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

3. Summary Table

Workflow Email AI Agent (with step by step video)
Complexity intermediate
Nodes 12
Categories Ticket Management, AI RAG
Author Milan Vasarhelyi - SmoothWork
Published 23 Jan 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/12955/12955.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 Email AI Agent (with step by step video) do?

Video Introduction Want to ...

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