Templates / Route Gmail emails to Slack by intent using OpenAI and log to Sheets

Route Gmail emails to Slack by intent using OpenAI and log to Sheets

Ready for 3.0

by Anwar Bouilouta ✓ · 10 views · created 2026-03-19 · Ticket Management, AI Summarization

Ready 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.

What this workflow does

This AI workflow has 9 nodes and runs on Gmail events. Along the way it connects Gmail, OpenAI, Slack and Google Sheets.

How it runs

Trigger: On Gmail events.

  1. Configure Settings (Edit Fields (Set)): sets 7 fields: slackChannel_sales, slackChannel_support, slackChannel_billing…
  2. Classify Email Intent (OpenAI): uses OpenAI
  3. Parse AI Response (Code): runs custom JavaScript code
  4. Route by Category (Switch): routes items into 3 branches
  5. Log to Google Sheet (Google Sheets): append
  6. Send to Sales Channel (Slack): uses Slack
  7. Send to Support Channel (Slack): uses Slack
  8. Send to Billing Channel (Slack): uses Slack

Services it uses

GmailOpenAISlackGoogle Sheets

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Watch for New Emails).

Nodes used (7)

From the author

If your team shares an inbox and someone has to manually read every email to decide where it goes, this workflow takes that off your plate. Emails come in, AI reads them, and the right Slack channel gets notified with a summary and priority level. Who is this…

Excerpt from Anwar Bouilouta's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.