Generate AI YouTube comments and replies from a video URL using GPT-4 and Google Sheets
Ready for 3.0What this workflow does
This AI workflow has 18 nodes and runs when someone submits an n8n form (“YouTube Video Comment Generator”). Along the way it connects OpenAI Chat Model and Google Sheets.
How it runs
Trigger: When someone submits an n8n form (“YouTube Video Comment Generator”).
- Extract Video ID from URL (Code): runs custom JavaScript code
- Get Video Statistics (HTTP Request): calls an HTTP API
- Format Video Data (Code): runs custom JavaScript code
- Get Video Comments (HTTP Request): calls an HTTP API
- Video Comment Generator (AI Agent): runs an AI agent, with model: OpenAI Chat Model; output parser: Video Comment Parser
- Extract Comments (Edit Fields (Set)): sets 1 field: items
- Add VideoId to VideoComments (Edit Fields (Set)): sets 1 field: videoId
- Process Each Comment (Code): runs custom JavaScript code
- Merge: merges the data from its input branches
- Select Top 10 Comments (Code): runs custom JavaScript code
…plus 4 more steps. See the full node list below.
Services it uses
Other OpenAI + Google Sheets templates (2,011) · Other YouTube + Google Sheets templates (78) · Other YouTube + OpenAI templates (68)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (9)
- n8n Form Trigger
n8n-nodes-base.formTrigger - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Edit Fields (Set)
n8n-nodes-base.set - AI Agent
@n8n/n8n-nodes-langchain.agent - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured - Merge
n8n-nodes-base.merge - Google Sheets
n8n-nodes-base.googleSheets
From the author
How it works - A form trigger accepts any YouTube URL: youtube.com/watch?v=ID, youtu.be/ID, youtube.com/embed/ID, or just a plain video ID - A code node normalises the URL and extracts a clean video ID for the YouTube Data API v3 - Calls the API to fetch…