Skip to main content

Classify Gmail intents with Google Gemini, Slack and Google Sheets

Workflow preview

Workflow preview
100%
Classify Gmail intents with Google Gemini, Slack and Google Sheets preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow monitors Gmail for new unread emails, uses Google Gemini to classify each email’s intent, then creates Gmail draft replies and Slack alerts for questions/requests, esca...

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.set, @n8n/n8n-nodes-langchain.googlegemini, n8n-nodes-base.aggregate, n8n-nodes-base.code, n8n-nodes-base.switch, n8n-nodes-base.splitout, n8n-nodes-base.googlesheets

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Classify Gmail intents with Google Gemini, Slack and Google Sheets
Workflow name
Classify Gmail intents with Google Gemini, Slack and Google Sheets

Quick Overview

This workflow monitors Gmail for new unread emails, uses Google Gemini to classify each email’s intent, then creates Gmail draft replies and Slack alerts for questions/requests, escalates complaints with Slack and Google Tasks, and logs FYI and spam activity to Google Sheets.

How it works

  1. Triggers when a new unread email arrives in Gmail.
  2. Extracts the sender, subject, body text, and message ID, then bundles incoming emails for batch processing.
  3. Sends the bundled emails to Google Gemini to classify each message as Question, Request, Complaint, FYI, or Spam and to generate the required action payloads.
  4. Parses Gemini’s JSON response, splits it back into one item per email, and routes each email by its classified intent.
  5. For Question or Request emails, creates a Gmail draft reply, posts a Slack notification with a preview, and logs the action to Google Sheets.
  6. For Complaint emails, posts an urgent Slack alert, creates a high-priority follow-up in Google Tasks, and logs the action to Google Sheets.
  7. For FYI and Spam emails, skips external actions and logs the outcome to Google Sheets.

Setup

  1. Connect credentials for Gmail OAuth2, Google Gemini (PaLM) API, Slack OAuth2, Google Sheets OAuth2, and Google Tasks OAuth2.
  2. Update the Gmail trigger settings and mailbox access to match the account and unread-email behavior you want to monitor.
  3. Set the target Google Sheets document and ensure it has columns for Timestamp, Email ID, Sender, Subject, Intent, and Action.
  4. Select the Slack channels for general notifications and urgent complaint alerts.
  5. Choose the Google Tasks list and update the task list ID used for complaint follow-ups.

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 - Watch New Unread Emails

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

Block 2 - Extract Sender Subject Body

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

Block 3 - Classify Intent and Generate Actions

Type / Role
@n8n/n8n-nodes-langchain.googleGemini - googleGemini
Config choices
Version 1.1

Block 4 - Bundle Emails for AI

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

Block 5 - Parse AI JSON Response

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

Block 6 - Route by Email Intent

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

Block 7 - Split AI Results Per Email

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

Block 8 - Log FYI to Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 9 - Create Gmail Draft Reply

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

Block 10 - Log Question or Request to Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 11 - Send Urgent Slack Complaint Alert

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.4

Block 12 - Log Complaint to Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 13 - Create Google Task for Complaint

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

Block 14 - Send Slack Alert for Drafted Email

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.4

Block 15 - Log Spam to Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 16 - Workflow Overview

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

Block 17 - Intake Sticky

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

Block 18 - AI Sticky

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

Block 19 - Routing Sticky

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

3. Summary Table

Workflow Classify Gmail intents with Google Gemini, Slack and Google Sheets
Complexity advanced
Nodes 19
Categories Ticket Management, AI Summarization
Author WeblineIndia
Published 12 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16304/16304.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 Classify Gmail intents with Google Gemini, Slack and Google Sheets do?

Quick Overview This workflow monitors Gmail for new unread emails, uses Google Gemini to classify each email’s intent, then creates Gmail draft replies and Slack alerts for questions/requests, esca...

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.