YouTube Comment Extractor and Google Sheets Loader - n8n Workflow

Automate crawling YouTube video comments using the n8n platform. This powerful n8n workflow extracts comments, likes, and authors, storing them instantly in Google Sheets.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

YouTube creators and social media managers needing to analyze audience feedback at scale.
Data analysts requiring structured datasets of public comments for sentiment analysis or reporting.
Users looking for advanced n8n templates for API integration and data ETL processes.
Anyone interested in leveraging the YouTube API within an n8n node environment.

Overview

Extracting meaningful data from high-volume platforms like YouTube often requires robust API handling and pagination logic. This specialized n8n workflow simplifies this complex process. By using Google Sheets as the input source, users can queue up hundreds of videos for analysis simply by setting the status to 'Ready'. The n8n template handles all the heavy lifting: fetching comments via the YouTube API, iterating through paginated results, processing the data, and inserting clean, structured output back into a dedicated 'Results' tab in Google Sheets. This n8n automation ensures reliable extraction while automatically updating the processing status of each video URL, minimizing reprocessing and tracking errors.

How it Works

This comprehensive n8n workflow operates through a structured sequence of steps:


  1. Trigger and Input: The n8n trigger starts manually (Test Workflow). It immediately connects to the Google Sheets - Get Video URLs n8n node, retrieving all YouTube video URLs marked with the status 'Ready'.

  2. Loop Setup: The flow validates that a URL exists and then uses the Loop Over Items n8n node to process each video URL individually.

  3. API Extraction: For each URL, the HTTP Request - Get Comments n8n node contacts the YouTube Data API (v3). Crucially, this node is configured to handle pagination, ensuring that all comments (up to the limit of the API/workflow) are retrieved for the video.

  4. Validation and Splitting: The flow checks the API response using the If - Check Success Response n8n node (status code 200). If successful, the Split Out n8n node separates the list of returned comments (body.items) into discrete items, ready for individual processing.

  5. Data Storage: The Google Sheets - Insert/Update Comment n8n node extracts key comment details (text, author, likes, publish date) and saves them into the 'Results' sheet. It uses the comment_id for deduplication (append or update operation).

  6. Status Management: Upon successful comment insertion, the Google Sheets - Update Status n8n node updates the original video entry in the 'Video URLs' sheet to 'finish'. If any API or processing error occurs (e.g., failed API call or invalid comment data), the entry is marked 'error' using the fallback path to prevent infinite loops and aid debugging. The loop then advances to the next video URL.

Installation Guide

To deploy this n8n template successfully, follow these steps:


  1. Import: Download the n8n workflow JSON provided and import it into your n8n instance.

  2. Google Sheet Setup: Duplicate the template Google Sheet linked in the workflow comments. This sheet must contain two tabs: 'Video URLs' (for input) and 'Results' (for output).

  3. Credentials: Set up or update the required credentials:

Google Sheets OAuth2 API: Ensure this credential is added to all Google Sheets n8n nodes, granting read/write access to the connected spreadsheet.
YouTube OAuth2 API: This credential must be attached to the HTTP Request - Get Comments n8n node to allow access to the YouTube Data API.

  1. Configuration: Verify the sheet and document IDs within all Google Sheets n8n node configurations match your duplicated spreadsheet.

  2. Preparation: In your Google Sheet, populate the 'Video URLs' tab with the URLs you wish to crawl and set the corresponding status column to 'Ready'.

  3. Execution: Click the 'Execute Workflow' button or run the n8n workflow manually via the Test Workflow n8n trigger.

Node Details

This n8n workflow utilizes several core n8n node types to achieve its goal:

Test Workflow (manualTrigger): The initial n8n trigger. Used to start the automation manually for testing and bulk processing.
Google Sheets - Get Video URLs (Google Sheets n8n node):
Function: Reads the list of video URLs. It filters rows where the status column equals 'ready'.
Key Configuration: Operation: read. Filter applied to fetch only 'ready' items.
Loop Over Items (Split In Batches n8n node):
Function: Manages the iterative process, ensuring the API call block is executed sequentially for every video URL retrieved from the Google Sheet.
HTTP Request - Get Comments (HTTP Request n8n node):
Function: Communicates with the YouTube API v3 to fetch comment threads.
Key Configuration: Uses predefined YouTube OAuth2 credentials, sets query parameters (part=snippet, videoId extracted via regex from the input URL), and implements robust pagination logic based on nextPageToken to retrieve comprehensive results.
If - Check Success Response (If n8n node):
Function: Checks if the preceding API call was successful by validating that the statusCode is 200. Essential flow control for this n8n workflow.
Split Out (Split Out n8n node):
Function: Transforms the array of comments returned by the API (body.items) into individual data items within the n8n platform, allowing subsequent nodes to process each comment separately.
Google Sheets - Insert/Update Comment (Google Sheets n8n node):
Function: Writes the extracted comment data (comment, author, likes, etc.) to the 'Results' sheet.
Key Configuration: Operation: appendOrUpdate. Uses expressions to map API fields to sheet columns.
Google Sheets - Update Status (Google Sheets n8n node):
Function: Updates the status of the processed row in the 'Video URLs' sheet to 'finish' (or 'error' in the alternative path), marking it as complete.
* Key Configuration: Operation: update. Matches the row using the original row_number.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by

Agent Circle - A growing marketplace of AI agents, workflows, and toolkits — built to help teams automate smarter and scale faster

Featured*