Skip to main content

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

Workflow preview

Workflow preview
100%
Extract email tasks with Gmail, ChatGPT-4o and Supabase preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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 Su...

Best for

  • Personal Productivity automation workflows
  • AI Summarization automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.httprequest, n8n-nodes-base.gmail, n8n-nodes-base.supabase, n8n-nodes-base.if, n8n-nodes-base.splitinbatches

Source and attribution

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

Original n8n.io source

1.1 Workflow description

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

📩 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:
    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

🔐 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

  • Supabase_TaskManagement_URI → e.g., https://your-project.supabase.co
  • Supabase_TaskManagement_ANON_KEY → 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:

  • email_id
  • subject
  • sender
  • received_at
  • body (email snippet)
  • gpt_summary (structured task)
  • requires_deep_work (from GPT logic)
  • deleted (initially false)

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 - Trigger Workflow

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

Block 2 - Prepare ChatGPT Prompt

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

Block 3 - Extract Task Detail from Email

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 4 - Insert Email Detail to Supabase

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

Block 5 - Get Unread Emails from Inbox

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

Block 6 - Get Email from Database

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

Block 7 - Check if Email in Database

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

Block 8 - Loop Over Items

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

Block 9 - Sticky Note

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

3. Summary Table

Workflow Extract email tasks with Gmail, ChatGPT-4o and Supabase
Complexity intermediate
Nodes 9
Categories Personal Productivity, AI Summarization
Author Paul Taylor
Published 30 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/5496/5496.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 Extract email tasks with Gmail, ChatGPT-4o and Supabase do?

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 Su...

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 Personal Productivity, AI Summarization use case.