Skip to main content

Route and log incoming emails with GPT-4, Excel 365 and Telegram

Workflow preview

Workflow preview
100%
Route and log incoming emails with GPT-4, Excel 365 and Telegram preview
Open on n8n.io

1. Workflow Overview

AI Email Analyzer with Department Routing and Excel Logging (n8n Workflow) Overview This workflow automatically analyzes incoming emails using AI, categorizes them, routes them to the appropriate d...

Best for

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

Tools used

n8n-nodes-base.emailreadimap, n8n-nodes-base.set, n8n-nodes-base.code, n8n-nodes-base.microsoftexcel, n8n-nodes-base.stickynote, n8n-nodes-base.emailsend, n8n-nodes-base.telegram, n8n-nodes-base.if

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Route and log incoming emails with GPT-4, Excel 365 and Telegram
Workflow name
Route and log incoming emails with GPT-4, Excel 365 and Telegram

AI Email Analyzer with Department Routing and Excel Logging (n8n Workflow)

Overview

This workflow automatically analyzes incoming emails using AI, categorizes them, routes them to the appropriate department, logs the results in Excel 365, and sends notifications to the responsible team member via Telegram.

It helps teams automate email triage, prioritize issues, and ensure that important messages are routed to the correct department without manual sorting.

This workflow is designed to be scalable, easy to configure, and adaptable for multiple business use cases such as support management, internal operations, finance monitoring, and technical issue tracking.

Features

  • AI-powered email analysis
  • Automatic email categorization
  • Department routing based on AI classification
  • Priority detection (High / Medium / Low)
  • Attachment detection
  • Action-required detection
  • Spam filtering
  • Excel 365 email logging
  • Department contact lookup from Excel
  • Telegram notifications to the responsible team member
  • Modular workflow design for easy extension

How It Works

  1. Email Trigger
  • The workflow listens for new incoming emails using IMAP, Gmail, or Outlook.
  1. Email Data Extraction
  • Key email information such as sender, subject, and body content is extracted and prepared for analysis.
  1. Email Body Limiting
  • The email body is truncated to avoid excessive token usage when sending content to the AI model.
  1. Batch Processing
  • Emails are processed one by one to prevent rate limits when calling the AI API.
  1. AI Email Analysis
  • The email is sent to an AI model that analyzes the message and returns structured JSON data including:
  • summary
  • category
  • priority
  • department
  • attachment detection
  • action required
  • spam detection
  1. Department Lookup
  • The workflow looks up the responsible department contact using an Excel 365 sheet that maps departments to their respective PIC (Person in Charge).
  1. Email Logging
  • The analyzed email data is appended to an Excel sheet for tracking and auditing.
  1. Telegram Notification
  • The responsible department PIC receives a Telegram notification containing the email summary and priority details.

Setup Steps

1. Import the Workflow

Import the workflow JSON file into your n8n instance.

2. Configure Email Trigger

Connect your email account using one of the following: - IMAP - Gmail - Outlook

Set the trigger to detect new incoming emails.

3. Configure OpenAI

Add your OpenAI API credentials in n8n.

The AI model is used to analyze incoming email content and generate structured data such as summary, category, department, and priority.

4. Prepare the Excel File

Create an Excel file with two sheets.

File example: Email_Automation.xlsx

Sheet 1: Email_Log

Timestamp Sender Subject Category Priority Department Action Attachment Spam Summary Required


This sheet stores the processed email records for auditing and tracking.

Sheet 2: Department_Routing

Department PIC_Name Email Telegram_Chat_ID


Support Andi [email protected] 12345678 Sales Rina [email protected] 23456789 Finance Budi [email protected] 34567890 Technical Dodi [email protected] 45678901 Management CEO [email protected] 56789012 General Admin [email protected] 67890123

This sheet maps departments to the responsible team member and their Telegram chat ID.

5. Configure Telegram

Create a Telegram Bot and connect it to n8n.

Ensure the Telegram Chat IDs in the Excel routing sheet are correct so notifications are delivered to the right person.

6. Configure Excel Credentials

Connect your Excel 365 account to n8n and select the Excel file used for logging and department routing.

7. Test the Workflow

Send a test email to your monitored inbox.

The workflow should: 1. Analyze the email using AI 2. Determine category and department 3. Log the result in Excel 4. Send a Telegram notification to the responsible department

Example Output

Example AI output:

{
 "summary": "Customer asking about invoice payment status",
 "category": "Invoice",
 "priority": "Medium",
 "department": "Finance",
 "has_attachment": true,
 "action_required": true,
 "spam": false
}

Example Telegram notification:

📩 New Email Routed

Department: Finance
Priority: Medium

From: [email protected]
Subject: Invoice payment status

Summary:
Customer asking about invoice payment status

Action Required: Yes
Attachment: Yes

Requirements

  • n8n
  • OpenAI API key
  • Email account (IMAP / Gmail / Outlook)
  • Microsoft Excel 365
  • Telegram Bot

Customization Ideas

You can extend this workflow by adding: - Jira ticket creation for technical issues - Slack or Microsoft Teams notifications - CRM integration for sales leads - sentiment analysis for customer emails - automated support ticket creation - SLA monitoring and escalation

Notes

This workflow demonstrates how AI can automate email intake, classification, and operational routing for teams.

It can be adapted for customer support, internal operations, finance monitoring, and technical issue tracking.

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 - Email Trigger (IMAP)

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

Block 2 - Extract Email Fields

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

Block 3 - Parse Summary

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

Block 4 - Append rows to table

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

Block 5 - Prepare Excel Row

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

Block 6 - Sticky Note

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

Block 7 - Send email

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

Block 8 - Send Notification

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

Block 9 - Validate Department

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

Block 10 - Lookup Department

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

Block 11 - Sticky Note1

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

Block 12 - Sticky Note2

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

Block 13 - Sticky Note4

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

Block 14 - Message a model

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

Block 15 - Sticky Note5

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

3. Summary Table

Workflow Route and log incoming emails with GPT-4, Excel 365 and Telegram
Complexity advanced
Nodes 15
Categories Ticket Management, AI Summarization
Author Ramdoni
Published 11 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13989/13989.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 Route and log incoming emails with GPT-4, Excel 365 and Telegram do?

AI Email Analyzer with Department Routing and Excel Logging (n8n Workflow) Overview This workflow automatically analyzes incoming emails using AI, categorizes them, routes them to the appropriate d...

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.