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

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

Ready for 3.0

by Stephan Koning ✓ · 50 views · created 2026-05-01 · 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 25 nodes and runs on Gmail events (plus 2 other triggers). Along the way it connects Redis, Postgres, Gmail and Groq Chat Model. It also calls api.mem0.ai over HTTP.

How it runs

Trigger: On Gmail events (plus 2 other triggers).

  1. Pre-Filter Gmail by Labels (Code): runs custom JavaScript code
  2. Setup SLA Database (Postgres): run a query
  3. Set Parsing Fields (Edit Fields (Set)): sets 5 fields: message, execution, workflow…
  4. Batch Process Emails (Loop Over Items (Split in Batches)): loops over the items in batches
  5. Finalize SLA Setup (Code): runs custom JavaScript code
  6. Direct Emails by SLA Status (Switch): routes items into 4 branches
  7. Retrieve Gmail Email (Gmail): get
  8. Log to Supabase (Postgres): run a query
  9. Extract Email Info for Classification (Code): runs custom JavaScript code
  10. Classify Email Content (Information Extractor): extracts structured fields from text with AI, with model: Integrate Chat Model

…plus 11 more steps. See the full node list below.

Services it uses

RedisPostgresGmailGroq Chat Model

HTTP calls to: api.mem0.ai

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) (When Gmail Received).

Nodes used (15)

From the author

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…

Excerpt from Stephan Koning'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.