Skip to main content

Multi-account email classifier with AI, Gmail, Discord & Google Sheets

Workflow preview

Workflow preview
100%
Multi-account email classifier with AI, Gmail, Discord & Google Sheets 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 Classifier Automate Email Classification, Prioritization, and Spam Detection Across Multiple Accounts Created by: Jayant Kumar (@jharilela) Powered by...

Best for

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

Tools used

n8n-nodes-base.gmailtrigger, n8n-nodes-base.stickynote, n8n-nodes-base.merge, n8n-nodes-base.set, n8n-nodes-base.webhook, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.googlesheetstool

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Multi-account email classifier with AI, Gmail, Discord & Google Sheets
Workflow name
Multi-account email classifier with AI, Gmail, Discord & Google Sheets

AI Email Classifier πŸ“¬

Automate Email Classification, Prioritization, and Spam Detection Across Multiple Accounts

Created by: Jayant Kumar (@jharilela)
πŸ›  Powered by: Gmail, Google Sheets, OpenAI, Discord, and n8n


Sample Discord labelling as Spam

Sample Discord labelling as Legit


Why I Built This

Focus is Expensive. Managing multiple email inboxes every dayβ€”personal, business, partnerships, invoices. Logging into each, skimming through noise, flagging important stuff, and deleting spam started eating up hours of my week. I needed a system that helped me focus only on what matters without building an entire helpdesk dashboard.

I already live in Discord. It made sense to push my emails thereβ€”but in a fun, digestible, and actionable way. I built AI Email Classifier πŸ“¬ to summarize emails, detect spam, assign priority, and make everything skimmable with pictures and links.

And it works across multiple Gmail accounts.


Key Features

  • βœ… Works with multiple Gmail inboxes
  • 🧠 Uses AI to classify spam vs legit
  • 🎯 Assigns priority levels: High / Medium / Low
  • πŸ—‚ Appends everything to a central Google Sheet
  • πŸ“Έ Sends visual summaries to Discord (with image + action links)
  • πŸ›  Powered by open-source: n8n_discord_trigger_bot

How It Works

Here’s the high-level flow:

  1. New Email in any inbox triggers the worfklow to start
  2. The AI Agent reads the raw content, subject, sender, Gmail labels.
  3. It calls a Google Sheet that acts as our feedback memory:
    • Emails and domains manually marked as spam or legit.
  4. AI classifies the incoming email using logic:
    • Spam if sender or domain is blacklisted, or content matches patterns like:
      "promotions, phishing, ads, mass emails, cold offers"
    • Priority is assigned by:
      • High: deadlines, legal, payments, clients, CEO emails
      • Medium: team updates, meetings, project notifications
      • Low: newsletters, FYIs, casual threads
  5. It produces a compact JSON output with:
    • Sender, recipient, subject, summary, priority, priority color, image URL, action URL
  6. The message is formatted visually and posted back to Discord as an embed with:
    • Summary text
    • Actionable links
    • Priority color code
    • Thumbnail (if any)

Google Sheet Training Table

The system uses this sheet as live memory to label spam and legit senders:

╔════════════════════╦══════════════╦═════════════════╦══════════════╦════════════════╗
β•‘       Email        β•‘    Domain    β•‘  Classification β•‘  Labelled By β•‘  Labelled Date β•‘
╠════════════════════╬══════════════╬═════════════════╬══════════════╬════════════════╣
β•‘ [email protected] β•‘  badsite.com β•‘  Spam           β•‘  Jayant      β•‘  08/07/2025    β•‘
β•‘ [email protected]    β•‘  trusted.com β•‘  Legit          β•‘  Jayant      β•‘  08/07/2025    β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

This allows manual control to teach the AI which senders to trust or ignore. Every time I see something marked wrong, I just reply in Discord with "spam" or "legit" on that message thread. That triggers an update to the Sheet via AI parsing and n8n.


Why Manual Input Still Matters

AI isn’t perfect.
Some spam emails are cleverly disguised. And some senders are contextually important only to you.

That’s why I kept a simple feedback loop:

  • You tell the bot "spam" or "legit" on any Discord email message. Or anything along that line
  • The AI agent detects the intent and updates the Sheet.
  • The AI improves its judgment next time as it now remembers your preference

Why Discord?

Because Slack charges per seat and email feels lonely.
I run most of my operations inside Discord community chats, client rooms, bot alerts.
Instead of making a full email UI, I turned each email into a Discord card with a thumbnail, summary, and quick actions.
It’s fun. It’s visual. It doesn’t feel like work.
Email becomes more like a game feed.


Tech Stack

  • Gmail β†’ Discord via Gmail trigger node
  • Discord β†’ n8n Webhook via n8n_discord_trigger_bot
  • OpenAI GPT-4o (classification + summarization)
  • Google Sheets (feedback memory)
  • Discord Node (embed output with JSON + images)

Try It Yourself

Clone the workflow JSON, set up your Gmail integrations, and install the n8n Discord Trigger Bot.
I made this workaround because i couldnt find a discord trigger on n8n.

Now I just scroll my Discord DMs and know what to reply to, and ignore everything else.Dont let Email spam your brain. Let your AI do the thinking.


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 - Gmail Trigger

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

Block 2 - Sticky Note2

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

Block 3 - Sticky Note

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

Block 4 - Sticky Note1

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

Block 5 - Sticky Note3

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

Block 6 - Gmail Trigger1

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

Block 7 - Gmail Trigger2

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

Block 8 - Gmail Trigger3

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

Block 9 - Merge4

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 10 - medium4

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

Block 11 - medium5

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

Block 12 - medium6

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

Block 13 - medium7

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

Block 14 - Webhook

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

Block 15 - AI Agent1

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

Block 16 - OpenAI Chat Model1

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

Block 17 - Get spam list

Type / Role
n8n-nodes-base.googleSheetsTool - googleSheetsTool
Config choices
Version 4.5

Block 18 - Discord - reply1

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

Block 19 - Get a message in Discord

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

Block 20 - update spam list

Type / Role
n8n-nodes-base.googleSheetsTool - googleSheetsTool
Config choices
Version 4.5

Block 21 - AI Agent2

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

Block 22 - OpenAI Chat Model3

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

Block 23 - Get spam list1

Type / Role
n8n-nodes-base.googleSheetsTool - googleSheetsTool
Config choices
Version 4.5

Block 24 - Sticky Note4

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

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

3. Summary Table

Workflow Multi-account email classifier with AI, Gmail, Discord & Google Sheets
Complexity advanced
Nodes 28
Categories Ticket Management, AI Summarization
Author Jay Emp0
Published 08 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5789/5789.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 Multi-account email classifier with AI, Gmail, Discord & Google Sheets do?

AI Email Classifier Automate Email Classification, Prioritization, and Spam Detection Across Multiple Accounts Created by: Jayant Kumar (@jharilela) Powered by...

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.