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.
SplitInBatches.emails table in SupabaseBefore 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:
ALTER TABLE emails ADD CONSTRAINT unique_email_id UNIQUE (email_id);
An OpenAI API key with access to GPT-4o or GPT-3.5-turbo
| 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 | 
Supabase_TaskManagement_URI β e.g., https://your-project.supabase.coSupabase_TaskManagement_ANON_KEY β Your Supabase anon keyThese are used in the HTTP request to Supabase.
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).
Each processed email includes:
email_idsubjectsenderreceived_atbody (email snippet)gpt_summary (structured task)requires_deep_work (from GPT logic)deleted (initially false)

