Automate Email Categorization & AI Scheduling with n8n

Struggling to manage incoming emails and schedule appointments efficiently? This n8n workflow automates email categorization with AI and offers a smart appointment booking assistant using Google Calendar integration, saving you hours of manual work.
Slack
gmail
@lmChatOpenAi
+15
Workflow Identifier: 1202
NODES in Use: Slack, Sticky Note, Execute JavaScript, @textSplitterRecursiveCharacterTextSplitter, @embeddingsOpenAi, @documentDefaultDataLoader, @lmChatOpenAi, @retrieverVectorStore, HTTP Request, @vectorStorePinecone, @chainRetrievalQa, @lmChatAnthropic, @toolHttpRequest, @agent, @memoryBufferWindow, gmail, @chatTrigger, if

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow watches new emails in your Gmail inbox and sorts them into categories like “automation” or “music” using AI.

It also sends Slack messages to notify your team about new emails.

You can chat with a chatbot to book meetings using Google Calendar, checking availability before scheduling.

The goal is to save time by automating email sorting and appointment booking without manual work.


Who should use this workflow

Anyone who gets many emails and loses time sorting them or scheduling meetings manually.

It is good for project managers, teams using Gmail, Slack, and Google Calendar, and people wanting easy automated scheduling.


Tools and services used

  • Gmail: To monitor inbox and apply labels to emails.
  • OpenAI GPT-4: To read emails and decide their category.
  • Slack: To send messages when new emails are sorted.
  • Google Calendar API: To check free times and book meetings.
  • n8n platform: To run and connect all the nodes for automation.
  • Pinecone vector store: To store information for chatbot answers.
  • LangChain nodes: For AI chat, classification, and memory.

Inputs, process, and outputs

Inputs

Processing steps

  • Use Gmail trigger to detect new emails
  • Send email text to AI text classifier to decide category
  • Apply correct Gmail label for “automation” or “music” categories
  • Send Slack message with email details
  • Accept chat input via chat trigger to start appointment booking
  • Use question-answer chain with Pinecone embeddings for chatbot answers
  • Download and split PDF documents to create embeddings to support chatbot
  • Use Google Calendar to check availability and book 30-minute meetings
  • Store chat conversation context to remember past messages

Outputs

  • Emails automatically labeled in Gmail
  • Slack notifications post for new emails by category
  • Chatbot messages that guide users to book appointments
  • Calendar events created if meeting slots are found free

Beginner step-by-step: How to use this workflow in n8n

Step 1: Import the workflow

  1. Download the workflow file using the Download button on this page.
  2. In the n8n editor, select “Import from File” and choose the downloaded file.

Step 2: Configure credentials and settings

  1. Go through each node and add required API Keys or OAuth details for Gmail, Slack, Google Calendar, and OpenAI.
  2. Edit any IDs, email addresses, Slack channel names, or Gmail label names to match your accounts.
  3. Check text prompts or expressions for correct mapping (for example, {{$json.text}} in text classifier node).

Step 3: Test the workflow

  1. Trigger the workflow by sending a test email to your Gmail inbox to see if labeling and Slack messages happen.
  2. Try the chat interface URL to start a conversation and book an appointment, checking calendar booking works.

Step 4: Activate for production

  1. After testing, activate the workflow in n8n by turning the toggle switch On.
  2. Share the chat webhook URL with your team or users for appointment scheduling.
  3. Monitor executions in the n8n dashboard and fix any errors found.
  4. If you are hosting n8n yourself, consider self-host n8n setup for reliable access.

Common problems and edge cases

  • AI classifier errors: Usually caused by bad text input or OpenAI API key issues. Fix by checking inputs and key limits.
  • Gmail label not applied: Check label IDs and message IDs are correct in Gmail nodes.
  • Slack messages not sent: Verify Slack OAuth access and channel permissions.
  • Appointment booking fails: Often due to wrong date-time formatting or timezone mismatch. Use ISO 8601 with timezone.
  • Chat context lost: Check that memory node connects properly to keep conversation flow.

Ideas for customization

  • Add more email categories to the AI classifier node by editing categories JSON (e.g., “support”, “sales”).
  • Change Slack messages to show more email details or links.
  • Adjust appointment meeting lengths by editing system message and booking parameters.
  • Connect calendars of other team members in Google Calendar nodes.
  • Change conversation memory length to keep more or fewer previous chat entries.

Summary

✓ Automates sorting of Gmail emails by category.

✓ Sends Slack notifications automatically.

✓ Offers chat assistant to book appointments via Google Calendar.

→ Saves time and reduces manual work.

→ Avoids schedule conflicts by checking availability first.

→ Maintains chat context for natural conversations.


{
  "inputText": "{{$json.text}}",
  "categories": [
    { "name": "automation", "description": "Emails about workflows and automation." },
    { "name": "music", "description": "Emails about music events or artists." }
  ]
}

Use this JSON in the Text Classifier node to tell AI how to sort emails.


Frequently Asked Questions

No, the workflow uses Gmail nodes and labels. Using Outlook would require building a new workflow with Outlook nodes.
Yes, both the Text Classifier and Chat nodes consume OpenAI API credits according to your subscription.
Yes, all data stays within your Google account and uses secure OAuth authentication.
Check that Gmail label IDs and message IDs are correct and properly mapped from the trigger node.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free