Templates / Extract email tasks with Gmail, ChatGPT-4o and Supabase

Extract email tasks with Gmail, ChatGPT-4o and Supabase

Ready for 3.0

by Paul Taylor Β· 1,283 views Β· created 2025-06-30 Β· Personal Productivity, 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.

Nodes used (8)

OpenAIGmailSupabase

What it does

πŸ“© Gmail β†’ GPT β†’ Supabase | Task Extractor This n8n workflow automates the extraction of actionable tasks from unread Gmail messages using OpenAI's GPT API, stores the resulting task metadata in Supabase, and avoids re-processing previously handled emails. --- βœ… What It Does 1. Triggers on a schedule to check for unread emails in your Gmail inbox. 2. Loops through each email individually using SplitInBatches. 3. Checks Supabase to see if the email has already been processed. 4. If it's a new email: - Formats the email content into a structured GPT prompt - Calls ChatGPT-4o to extract structured task data - Inserts the result into your emails table in Supabase --- 🧰 Prerequisites Before using this workflow, you must have: - An active n8n Cloud or self-hosted instance - A connected Gmail account with OAuth credentials in n8n - A Supabase project with an emails table and: sql ALTER TABLE emails ADD CONSTRAINT uniqueemailid UNIQUE (emailid); - An OpenAI API key with access to GPT-4o or GPT-3.5-turbo --- πŸ” Required Credentials | Name | Type | Description | |-----------------|------------|-----------------------------------| | Gmail OAuth | Gmail | To pull unread messages | | OpenAI API Key | OpenAI | To generate task summaries | | Supabase API | HTTP | For inserting rows via REST API | --- πŸ” Environment Variables or Replacements - SupabaseTaskManagementURI β†’ e.g., https://your-project.supabase.co - SupabaseTaskManagementANONKEY β†’ Your Supabase anon key These are used in the HTTP request to Supabase. --- ⏰ Scheduling / Trigger - Triggered using a Schedule node - Default: every X minutes (adjust to your preference) - Uses a Gmail API filter: unread emails with label = INBOX --- 🧠 Intended Use Case > Designed for productivity-minded professionals who want to extract, summarize, and store actionable tasks from incoming email β€” without processing the same email twice or wasting GPT API credits. This is part of a larger system integrating GPT, calendar scheduling, and optional task platforms (like ClickUp). --- πŸ“¦ Output (Stored in Supabase) Each processed email includes: - emailid - subject - sender - receivedat - body (email snippet) - gptsummary (structured task) - requiresdeepwork (from GPT logic) - deleted (initially false)

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.