Skip to main content

Classify Gmail leads with Groq AI and sync SLA cases to Supabase via Redis

Workflow preview

Workflow preview
100%
Classify Gmail leads with Groq AI and sync SLA cases to Supabase via Redis preview
Open on n8n.io

1. Workflow Overview

Who’s it for This workflow is for contractors, freelancers, local service businesses, and small teams that receive leads and customer requests through Gmail but do not have a dedicated sales or adm...

Best for

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

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.redistrigger, n8n-nodes-base.manualtrigger, n8n-nodes-base.switch, n8n-nodes-base.postgres, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.gmail

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Classify Gmail leads with Groq AI and sync SLA cases to Supabase via Redis
Workflow name
Classify Gmail leads with Groq AI and sync SLA cases to Supabase via Redis

Who’s it for

This workflow is for contractors, freelancers, local service businesses, and small teams that receive leads and customer requests through Gmail but do not have a dedicated sales or admin team.

What it does

This template turns Gmail into an AI lead desk and follow-up tracker. It filters inbox noise, reads real customer emails, and classifies each message by urgency, intent, sentiment, department, technical details, and business value.

Each email gets a color-coded response deadline:

  • RED: critical issue, respond within 1 hour
  • ORANGE: urgent lead or follow-up, respond within 4 hours
  • YELLOW: standard lead or request, respond within 24 hours
  • GREEN: low-priority message, respond within 48 hours

The first workflow watches Gmail, retrieves and cleans the email, classifies it with AI, and publishes the structured case to Redis. The second workflow listens for Redis events and logs each case to Supabase/PostgreSQL as a lightweight CRM and follow-up dashboard.

Requirements

  • Gmail OAuth2 credentials
  • Groq API credentials
  • Redis credentials
  • Supabase/PostgreSQL credentials
  • Optional Mem0 API credentials

How to customize

Update the blocked Gmail labels, AI prompt, response deadlines, Redis channel, Supabase schema, owner alert logic, and dashboard views to match your business process.

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 - Sticky Note

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

Block 2 - Sticky Note1

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

Block 3 - Sticky Note2

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

Block 4 - Sticky Note3

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

Block 5 - Sticky Note4

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

Block 6 - Gmail Redis Trigger

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

Block 7 - Manual SLA Trigger

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

Block 8 - Direct Emails by SLA Status

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

Block 9 - Log to Supabase

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 10 - Sticky Note5

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

Block 11 - Sticky Note6

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

Block 12 - Post to Mem0 API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 13 - Pre-Filter Gmail by Labels

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

Block 14 - Retrieve Gmail Email

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

Block 15 - Extract Email Info for Classification

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

Block 16 - Batch Process Emails

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 17 - Classify Email Content

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

Block 18 - Filter Spam Emails

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

Block 19 - Integrate Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGroq - lmChatGroq
Config choices
Version 1

Block 20 - When Gmail Received

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

Block 21 - Wait 12 Seconds

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 22 - Generate Email Labels

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

Block 23 - Create Mem0 API Payload

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

Block 24 - Route Emails Based on SLA

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

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

3. Summary Table

Workflow Classify Gmail leads with Groq AI and sync SLA cases to Supabase via Redis
Complexity advanced
Nodes 37
Categories Ticket Management, AI Summarization
Author Stephan Koning
Published 01 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15432/15432.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 leads with Groq AI and sync SLA cases to Supabase via Redis do?

Who’s it for This workflow is for contractors, freelancers, local service businesses, and small teams that receive leads and customer requests through Gmail but do not have a dedicated sales or adm...

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.