Skip to main content

Summarize YouTube video transcripts in Discord with Gemini and Supabase

Workflow preview

Workflow preview
100%
Summarize YouTube video transcripts in Discord with Gemini and Supabase preview
Open on n8n.io

1. Workflow Overview

YouTube Video Transcript Summarizer — Discord Bot Paste a YouTube URL into a Discord channel and this workflow automatically extracts the transcript, uses an LLM to generate a concise summary,...

Best for

  • Content Creation automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.code, n8n-nodes-discord-trigger.discordtrigger, n8n-nodes-base.if, n8n-nodes-base.executecommand, @n8n/n8n-nodes-langchain.googlegemini, n8n-nodes-base.supabase, n8n-nodes-base.discord, n8n-nodes-base.errortrigger

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Summarize YouTube video transcripts in Discord with Gemini and Supabase
Workflow name
Summarize YouTube video transcripts in Discord with Gemini and Supabase

YouTube Video Transcript Summarizer — Discord Bot

> Paste a YouTube URL into a Discord channel and this workflow automatically extracts the transcript, uses an LLM to generate a concise summary, and stores everything in a database — all in seconds.

> Self-hosted n8n only. This workflow uses the Execute Command node to run yt-dlp inside the n8n container. This requires shell access, which is only available on self-hosted instances (Docker, VPS, etc.) — it will not work on n8n Cloud.

Import this workflow into n8n


Prerequisites

Tool Purpose
Discord Bot Listens for messages and sends replies
yt-dlp Downloads subtitles and video metadata (must be installed in the n8n container)
Google Gemini API Summarizes video transcripts (Gemini 2.5 Flash)
Supabase Stores video data and run logs

Credentials

Node Credential Type Notes
Discord Trigger Discord Bot Trigger Bot token with Message Content Intent enabled
Discord Reply / Discord Not YouTube Reply / Discord Error Reply Discord Bot Same bot, used for sending messages
Message a model (Gemini) Google Gemini (PaLM) API API key from Google AI Studio
Save to Supabase / Log Run / Log Run Error Supabase Project URL + anon key

What It Does

When a user pastes a YouTube URL into a Discord channel, the workflow:

  1. Detects the YouTube URL using RegEx (supports youtube.com, youtu.be, shorts, live)
  2. Extracts the video's subtitles (English and Vietnamese) and metadata using yt-dlp
  3. Cleans the raw VTT subtitle file into plain-text transcript
  4. Summarizes the transcript using an LLM (Gemini 2.5 Flash) into a TLDR + detailed summary (in the original language)
  5. Stores the video metadata, full transcript, and AI summary in a Supabase database
  6. Logs every run (success or error) to a separate runs table for tracking
  7. Chunks long summaries into Discord-safe messages (≤2000 characters each)
  8. Replies in Discord with the video title, stats, and the full summary

Non-YouTube messages get a friendly "not a YouTube link" reply. Errors are caught, classified, logged to the database, and reported back to Discord.


How It Works

Main Flow (Happy Path)

Discord Trigger → Extract YouTube URL → Is YouTube URL?
 ├─ Yes → yt-dlp Get Metadata → Parse Metadata → Read Subtitle File → Parse Transcript
 │ → Message a model (Gemini) → Prepare Insert Data → Save to Supabase
 │ → Prepare Success Log → Log Run → Prepare Messages for Discord → Discord Reply
 └─ No → Discord Not YouTube Reply

Error Flow

Error Trigger → Prepare Error Data → Log Run Error → Discord Error Reply

Node Breakdown

# Node Type Description
1 Discord Trigger Discord Bot Trigger Fires on every message in the configured channel
2 Extract YouTube URL Code RegEx extracts video ID from message content
3 Is YouTube URL? IF Routes YouTube URLs to processing, others to rejection reply
4 yt-dlp Get Metadata Execute Command Downloads subtitles (.vtt, English/Vietnamese) and prints metadata JSON
5 Parse Metadata Code Extracts title, channel, views, duration via RegEx; decodes Unicode for multi-language support
6 Read Subtitle File Execute Command Dynamically finds and reads the .vtt file (continueOnFail enabled)
7 Parse Transcript Code Strips VTT timestamps/tags, deduplicates lines
8 Message a model Google Gemini Sends transcript to Gemini 2.5 Flash for TLDR + detailed summary (in original language)
9 Prepare Insert Data Code Merges summary with all metadata fields
10 Save to Supabase Supabase Inserts full record into videos table
11 Prepare Success Log Code Builds success run record
12 Log Run Supabase Inserts into runs table
13 Prepare Messages for Discord Code Chunks long summaries into Discord-safe messages (≤2000 chars)
14 Discord Reply Discord Posts summary preview to channel
15 Discord Not YouTube Reply Discord Replies when message isn't a YouTube link
16 Error Trigger Error Trigger Catches any unhandled node failure
17 Prepare Error Data Code Classifies error type and extracts context
18 Log Run Error Supabase Logs error to runs table
19 Discord Error Reply Discord Posts error message to channel

Setup Guide

1. Discord Bot

  1. Go to the Discord Developer Portal
  2. Create a new Application → Bot
  3. Enable Message Content Intent under Privileged Intents
  4. Copy the Bot Token
  5. Invite the bot to your server with Send Messages + Read Messages permissions
  6. In n8n, create a Discord Bot Trigger credential (for listening) and a Discord Bot credential (for sending replies)
  7. Update the guild ID and channel ID in the Discord Trigger node and all Discord reply nodes

2. yt-dlp

yt-dlp must be installed in your n8n container. For Docker-based installs:

docker exec -it n8n apk add --no-cache python3 py3-pip
docker exec -it n8n pip3 install yt-dlp

Optional: Place a cookies.txt file at /home/node/.n8n/cookies.txt to avoid age-gated or bot-detection issues.

3. Google Gemini API

  1. Go to Google AI Studio
  2. Click Create API Key and copy it
  3. In n8n, click the Gemini node → Credential → Create New
  4. Paste your API key and save

4. Supabase

  1. Create a project at supabase.com
  2. Go to Settings → API and copy the URL and anon key
  3. In n8n, create a Supabase credential with your URL and API key
  4. Run the SQL below in the Supabase SQL Editor to create the required tables

Supabase SQL

-- Videos table: stores video metadata, transcript, and AI summary
CREATE TABLE videos (
 video_id TEXT PRIMARY KEY,
 title TEXT,
 channel TEXT,
 upload_date TEXT,
 duration INT,
 view_count INT,
 description TEXT,
 transcript TEXT,
 ai_summary TEXT,
 thumbnail_url TEXT,
 channel_id TEXT,
 date_added TIMESTAMPTZ DEFAULT now()
);

-- Runs table: logs every workflow execution (success or error)
CREATE TABLE runs (
 video_id TEXT PRIMARY KEY,
 process_status TEXT NOT NULL,
 error_type TEXT,
 notes TEXT,
 date_added TIMESTAMPTZ DEFAULT now()
);

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 - Extract YouTube URL

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

Block 2 - Discord Trigger

Type / Role
n8n-nodes-discord-trigger.discordTrigger - discordTrigger
Config choices
Version 1

Block 3 - Is YouTube URL?

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

Block 4 - yt-dlp Get Metadata

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

Block 5 - Parse Metadata

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

Block 6 - Read Subtitle File

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

Block 7 - Parse Transcript

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

Block 8 - Message a model

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

Block 9 - Prepare Insert Data

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

Block 10 - Save to Supabase

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

Block 11 - Prepare Success Log

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

Block 12 - Log Run

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

Block 13 - Discord Reply

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

Block 14 - Discord Not YouTube Reply

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

Block 15 - Error Trigger

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

Block 16 - Prepare Error Data

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

Block 17 - Log Run Error

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

Block 18 - Discord Error Reply

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

Block 19 - Sticky Note - Overview

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

Block 20 - Sticky Note - Trigger

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

Block 21 - Sticky Note - Video Data Extraction

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

Block 22 - Sticky Note - Transcript Processing

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

Block 23 - Sticky Note - AI Summarization

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

Block 24 - Sticky Note - Save & Notify

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

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

3. Summary Table

Workflow Summarize YouTube video transcripts in Discord with Gemini and Supabase
Complexity advanced
Nodes 29
Categories Content Creation, AI Summarization
Author Tristan V
Published 27 Feb 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13749/13749.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 Summarize YouTube video transcripts in Discord with Gemini and Supabase do?

YouTube Video Transcript Summarizer — Discord Bot Paste a YouTube URL into a Discord channel and this workflow automatically extracts the transcript, uses an LLM to generate a concise summary,...

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 Content Creation, AI Summarization use case.