Auto-categorize Gmail emails with AI and send prioritized Slack alerts
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
Worth a look
- Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Trigger on Unread Email)
Nodes used (7)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Gmail
n8n-nodes-base.gmail - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Edit Fields (Set)
n8n-nodes-base.set - Slack
n8n-nodes-base.slack
What it does
Who is this for? - Teams using Gmail and Slack who want to streamline email handling. - Customer support, sales, and operations teams that want emails sorted by topic and priority automatically. - Anyone tired of manually triaging customer emails. What does it solve? - Stops important messages from slipping through the cracks. - Automatically identifies the nature and urgency of incoming emails. - Routes emails to the right Slack channel with a clear, AI-generated summary. How it works - The workflow watches for unread emails in your Gmail inbox. - It fetches the full email content and passes it to OpenAI for classification. - The AI returns structured JSON with the email’s category, priority, summary, and sender. - Based on the AI result, it assigns a label and Slack channel. - A message is sent to the right Slack channel with the details. How to setup? 1. Connect credentials: - Gmail (OAuth2) - Slack (OAuth2) - OpenAI (API Key) 2. Adjust email polling: - Open the Gmail Trigger node and set how frequently it should check for new emails. 3. Verify routing settings: - In the “Routing Map” node, update Slack channel IDs for each category if needed. 4. Customize AI behavior (optional): - Tweak the AI Agent prompt to better match your internal categorization rules. How to customize this workflow to your needs - Add more categories: Update the AI prompt and the schema in the “Structured Output Parser.” - Change Slack formatting: Modify the message text in the Slack node to include links, emojis, or mentions. - Use different routing logic: Expand the Routing Map to assign based on keywords, domains, or even sentiment. - Add escalation workflows: Trigger follow-up actions for high-priority or complaint emails.