Quick overview
This workflow runs daily to fetch newly published YouTube video transcripts via Apify, generates OpenAI embeddings for transcript chunks, and stores them with metadata in a Pinecone index for retrieval-augmented generation (RAG).
How it works
- Runs every day at 6:00 on a schedule.
- Calls the Apify YouTube Channel Transcripts actor to pull transcript chunks for the configured YouTube channels or playlists, returning only videos that are new since the last run.
- Filters the results to keep only videos where transcript extraction succeeds.
- Splits each video’s chunks array into individual items and attaches citation metadata like title, channel, publish date, start time, and a timestamped URL.
- Creates OpenAI embeddings for each transcript chunk and inserts the vectors and metadata into a Pinecone index under the specified namespace.
Setup
- Install the Apify community node (@apify/n8n-nodes-apify) in your n8n instance.
- Add credentials for Apify, OpenAI, and Pinecone.
- Create or select a Pinecone index compatible with the OpenAI embedding model (text-embedding-3-small) and set the target index in the Pinecone node.
- Update the Settings values to include your YouTube channel URLs/@handles or playlist URLs and adjust maxVideosPerChannel and chunkSizeWords as needed.