AI-Powered Multi-Agent Inbox Manager using GPT-4o and Pinecone - n8n Workflow

Automate email management using this powerful n8n workflow. It classifies incoming Gmail using specialized GPT agents, handles support, finance, and sales leads, and integrates Pinecone DB for RAG.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Business owners and executives dealing with high volumes of incoming emails.

  • Teams looking to implement AI-driven triage and automated initial responses.

  • n8n users seeking advanced examples of multi-agent and Retrieval-Augmented Generation (RAG) architectures.

  • Developers needing robust n8n templates for integrating vector databases like Pinecone.

Overview

Managing a high-volume inbox is a significant drain on productivity. This solution, built as a comprehensive n8n workflow, solves this problem by creating a sophisticated email management system. By leveraging powerful LLMs like GPT via OpenRouter, the initial n8n trigger routes the email to specialized AI agents.

This specific n8n workflow demonstrates a multi-agent architecture designed for maximum efficiency. It automates critical functions: providing instant answers to customer support queries using a Pinecone knowledge base, accurately classifying and routing financial documents, and intelligently handling sales leads with built-in human escalation logic. Deploying this n8n template ensures that every incoming email is instantly categorized and processed by the correct system, drastically reducing manual effort and improving response speed.

How it Works

The automation begins with the Gmail Trigger n8n node, which activates the flow whenever a new email lands in the connected inbox.


  1. Initial Routing (Inbox Router): The email content is first processed by the Inbox Router (a Text Classifier node powered by GPT 5 mini). This core n8n node analyzes the subject and body to classify the email into one of five branches: Customer Support, Finance, Sales Opportunities, Internal, or Others.

  2. Customer Support: If routed here, the Customer Support Agent n8n node uses RAG, querying the Database of FAQs and Policies (Pinecone DB) via an Embeddings OpenAI n8n node. It drafts a friendly response using GPT 4o mini, replies via a Gmail n8n node, and then labels the thread.

  3. Finance Processing: The Finance Agent n8n node uses a structured output parser to extract key data (Amount, From, DueDate) and classifies the item as a customer receipt or vendor invoice. A subsequent Switch n8n node routes the flow to notify the appropriate team (Payments or Receivables) via Gmail and sends an immediate real-time alert to the user via the Telegram n8n node.

  4. Sales Leads: The Leads Agent uses the Database of Business Services (Pinecone) to answer prospect questions. A crucial If n8n node checks the agent’s confidence (escalate flag). If confident, a draft is created in Gmail, and the user is notified. If unsure, a direct Telegram message alerts the user that manual review is needed.

  5. Internal Communication: The Internal Agent n8n node summarizes the email content, labels the thread, and notifies the user with a summary via a dedicated Telegram n8n node.

Installation Guide

To successfully deploy this advanced n8n workflow template, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and import it directly into your n8n instance.

  2. Gmail Credentials Setup: Configure the Gmail Trigger n8n node and all subsequent Gmail n8n nodes with your authenticated Gmail OAuth2 credentials.

  3. AI Service Credentials (OpenRouter): This workflow relies on specialized LLMs. You must set up OpenRouter API credentials and connect them to the GPT 5 mini, GPT 4o mini, and other LLM n8n nodes.

  4. Vector Database Setup (Pinecone): Set up your Pinecone API credentials. Configure the Database of FAQs and Policies and Database of Business Services n8n nodes to point to your indexed data, ensuring the necessary embeddings are generated using the associated Embeddings OpenAI n8n node.

  5. Telegram Configuration: Set up a Telegram Bot via BotFather and obtain the API Token. Configure the required Telegram n8n node credentials. Crucially, manually input your personal Chat ID into all Telegram n8n node parameters for notifications to work correctly.

  6. Customization: Review the label IDs in the Gmail n8n nodes (e.g., Label as Finance) and update them to match the IDs used in your Gmail account, ensuring proper organization.

Node Details

Gmail Trigger: The essential starting n8n trigger. It listens for new, unread emails to initiate the process.
Inbox Router (Text Classifier): Uses GPT via OpenRouter to analyze and categorize the email content, determining the correct branch of the n8n workflow.
Embeddings OpenAI: An n8n node used to convert text data into vector representations for RAG operations, powering the knowledge base tools.
Database of FAQs and Policies (Pinecone Vector Store): Serves as the RAG tool for the Customer Support Agent, providing contextual knowledge for automated replies.
Customer Support Agent (LangChain Agent): A specialized AI agent n8n node that drafts personalized, knowledgeable replies based on the Pinecone data.
Finance Agent (LangChain Agent): An n8n node designed to extract and structure financial details from emails, classifying them as receipts or invoices.
Output Format (Structured Output Parser): Ensures the AI agents provide highly reliable JSON output, critical for the Route by Email Type Switch n8n node to function correctly.
Gmail (Reply/Send/Label): Multiple instances of this n8n node handle specific actions: replying to customers, drafting responses for leads, sending internal notifications to finance teams, and applying categorization labels to the original email thread.


  • Telegram: The primary notification n8n node used throughout the workflow to send real-time alerts to the user regarding payments, new leads, and internal communications.

Related n8n Workflows

Free

Nodes: 14 Nodes
Updated: December 26 2025
View all
Created by
Zawanah
Zawanah

Analytics and AI Engineer | Building automation for efficiency

Featured*