YouTube to Google Sheets, sentiment you can act on
You read comments in YouTube Studio, copy a few into a doc, and tell yourself you’ll “analyze it later.” Later never comes, and the most useful feedback gets buried under hot takes and one-word reactions.
This is where YouTube sentiment automation pays off. A social media manager needs weekly insights without living in comment threads. A creator wants to know what’s landing (and what’s irritating people). And a small brand team trying to protect a launch can’t afford to miss a wave of negative sentiment.
This workflow turns raw YouTube comments into a filterable Google Sheet with sentiment labels, so you can spot patterns fast and actually act on them.
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: YouTube to Google Sheets, sentiment you can act on
flowchart LR
subgraph sg0["When clicking ‘Test workflow’ Flow"]
direction LR
n0@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Out", pos: "b", h: 48 }
n2@{ icon: "mdi:play-circle", form: "rounded", label: "When clicking ‘Test workflow’", pos: "b", h: 48 }
n3["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>HTTP Request - Get Comments"]
n4@{ icon: "mdi:swap-vertical", form: "rounded", label: "Loop Over Items", pos: "b", h: 48 }
n5@{ icon: "mdi:brain", form: "rounded", label: "Google Gemini Chat Model", pos: "b", h: 48 }
n6@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check If Video URL is Not Em..", pos: "b", h: 48 }
n7@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check If - Success Response", pos: "b", h: 48 }
n8@{ icon: "mdi:swap-horizontal", form: "rounded", label: "Check If - Comment Exists", pos: "b", h: 48 }
n9@{ icon: "mdi:database", form: "rounded", label: "Update Video Status", pos: "b", h: 48 }
n10@{ icon: "mdi:database", form: "rounded", label: "Get Video URLs", pos: "b", h: 48 }
n11@{ icon: "mdi:database", form: "rounded", label: "Insert Comment Data & Analysis", pos: "b", h: 48 }
n12@{ icon: "mdi:robot", form: "rounded", label: "AI Agent - Analyze Sentiment..", pos: "b", h: 48 }
n0 --> n8
n10 --> n6
n4 --> n3
n9 --> n4
n5 -.-> n12
n8 --> n12
n8 --> n9
n7 --> n0
n3 --> n7
n11 --> n9
n6 --> n4
n2 --> n10
n12 --> n11
end
subgraph sg1["Flow 2"]
direction LR
n1@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model", pos: "b", h: 48 }
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n2 trigger
class n12 ai
class n5,n1 aiModel
class n6,n7,n8 decision
class n9,n10,n11 database
class n3 api
classDef customIcon fill:none,stroke:none
class n3 customIcon
The Problem: Comment “analysis” that never becomes insight
YouTube gives you comments. It doesn’t give you structure. So you end up scanning hundreds of messages, trying to remember what you saw last week, and guessing whether the vibe is improving or getting worse. The painful part isn’t reading a single thread. It’s the cumulative grind: checking multiple videos, missing context, and realizing you can’t compare anything because it’s not in one place. Meanwhile, decisions still get made. You pick topics, hooks, and CTAs based on gut feel because the data is messy.
It adds up fast. Here’s where it breaks down in real life.
- You end up sampling a handful of comments, which quietly biases your conclusions.
- Manual copy-paste into spreadsheets creates errors, duplicates, and missing details like the original video URL.
- There’s no consistent “label,” so reporting turns into subjective debates instead of decisions.
- By the time you summarize feedback, the moment to respond or adjust creative has already passed.
The Solution: A Google Sheets dataset of labeled YouTube comments
This n8n workflow pulls YouTube video URLs from a Google Sheet, fetches the latest comments for each video through the YouTube API, then runs each comment through an AI Agent that assigns a clear sentiment label (Positive, Neutral, or Negative). The results are written back into a “Results” tab, which becomes your running dataset for reporting and pattern-spotting. Just as important, the workflow updates each video’s status to “Finished” so it won’t be processed again in the next run. That means you can maintain a simple pipeline: drop URLs in, mark them Ready, and let the workflow do the heavy lifting. Honestly, this is the difference between “we read comments” and “we learn from comments.”
The workflow starts when you run it in n8n (manual trigger by default). It checks the Video URLs sheet for rows marked Ready, pulls comments via HTTP request, then analyzes sentiment with the AI Agent using a chat model (Google Gemini by default). Finally, it stores the labeled comments in Google Sheets and marks each URL as Finished.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you review comments for 10 videos each week, and each video has about 40 comments worth scanning. If you spend even 30 seconds per comment plus a little time copying highlights, that’s roughly 2 hours weekly. With this workflow, you paste the 10 URLs into Google Sheets, mark them Ready (about 5 minutes), then let n8n fetch and label everything in the background. You come back to a Results tab you can filter in minutes, so you’re mostly spending time interpreting patterns, not collecting data.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Google Sheets to store URLs and results.
- YouTube Data API to fetch comments for each video.
- Google Gemini API key (get it from Google AI Studio / your Google Cloud project).
Skill level: Intermediate. You’ll connect APIs (YouTube, Google Sheets, Gemini) and confirm the right sheet tabs are mapped to the right nodes.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
You trigger a run from n8n. By default, you click “Execute Workflow,” which is perfect for weekly reporting or campaign check-ins. If you want it hands-off, you can swap in a Google Sheets trigger later.
Google Sheets provides the work queue. The workflow reads the “Video URLs” tab and only picks up rows marked Ready in Column A (with the URL in Column B). It also skips empty URLs so you don’t burn API calls.
YouTube comments are fetched and cleaned up. For each valid URL, n8n calls the YouTube API, verifies the response succeeded, then splits the payload into individual comment items. No comments on a video? The workflow simply marks that URL as Finished and moves on.
An AI Agent labels sentiment and saves the dataset. Each comment is classified as Positive, Neutral, or Negative using the configured chat model (Gemini by default, with an OpenAI option available). The labeled rows are inserted into the “Results” tab, then the original URL is marked Finished so it won’t get reprocessed next time.
You can easily modify the sentiment categories and the analysis prompt to match your brand voice or reporting needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Manual Trigger
This workflow starts on demand and immediately loads video URLs to process.
- Add and open Manual Run Trigger.
- Keep default settings (this node has no parameters).
- Connect Manual Run Trigger to Retrieve Video Links to match the execution flow.
Execution Flow: Manual Run Trigger → Retrieve Video Links
Step 2: Connect Google Sheets
Google Sheets is used for input video URLs and for storing comment insights and status updates.
- Open Retrieve Video Links and select your spreadsheet in Document and Sheet.
- Confirm the filter is set to retrieve rows where status equals
=Ready. - Credential Required: Connect your
googleSheetsOAuth2Apicredentials in Retrieve Video Links. - Open Store Comment Insights and set Operation to
appendOrUpdate. - Credential Required: Connect your
googleSheetsOAuth2Apicredentials in Store Comment Insights. - Open Set Video Status and set Operation to
update. - Credential Required: Connect your
googleSheetsOAuth2Apicredentials in Set Video Status.
Execution Flow: Retrieve Video Links → Validate Video URL → Batch Iterate Items
Step 3: Configure YouTube Comment Retrieval
The workflow validates each URL, fetches comments from YouTube, verifies the response, and splits comments into individual items.
- Open Validate Video URL and confirm the condition checks for a non-empty URL:
={{ $json.video_url }}. - Open Batch Iterate Items and keep default settings for batch processing.
- Open API Fetch Comments and set URL to
https://www.googleapis.com/youtube/v3/commentThreads. - Set query parameters in API Fetch Comments:
- part:
snippet - videoId:
={{ $json.video_url.match(/(?:v=|\/)([0-9A-Za-z_-]{11})/)[1] || ''}} - limit:
100
- part:
- Credential Required: Connect your
youTubeOAuth2Apicredentials in API Fetch Comments. - Open Verify HTTP Success and confirm the check for
={{ $json.statusCode }}equals200. - Open Separate Items and set Field to Split Out to
body.items.
Execution Flow: API Fetch Comments → Verify HTTP Success → Separate Items → Confirm Comment Exists
video_url.match(/(?:v=|\/)([0-9A-Za-z_-]{11})/)[1]. Ensure your sheet stores valid YouTube URLs.Step 4: Set Up Analyze Comment Sentiment
This step runs sentiment analysis on each comment and passes the results to storage.
- Open Confirm Comment Exists and verify it checks for
={{ $json.snippet.videoId }}existence before analysis. - Open Analyze Comment Sentiment and set Input Text to
={{ $json.snippet.topLevelComment.snippet.textOriginal }}. - Ensure the sentiment categories are configured as
Positive, Neutral, Negativein Analyze Comment Sentiment. - Credential Required: Connect your
googlePalmApicredentials in Gemini Chat Engine (the language model powering Analyze Comment Sentiment). - If you plan to use OpenAI Chat Engine, connect Credential Required:
openAiApiand wire it to a processing node (it is currently not linked to the flow).
Execution Flow: Confirm Comment Exists → Analyze Comment Sentiment → Store Comment Insights
Step 5: Configure Output Updates
Sentiment results are written to a results sheet, and each processed video is marked as finished.
- In Store Comment Insights, map columns using expressions such as:
- sentiment:
={{ $json.sentimentAnalysis.category }} - comment:
={{ $json.snippet.topLevelComment.snippet.textOriginal }} - video_url:
=https://www.youtube.com/watch?v={{ $json.snippet.videoId }} - published_at:
={{ $json.snippet.topLevelComment.snippet.publishedAt.toString().slice(0, 19).replace('T', ' ') }}
- sentiment:
- In Set Video Status, set status to
Finished. - Set row_number to
={{ $('Retrieve Video Links').item.json.row_number }}and last_fetched_time to={{ $now.toISO().toString().slice(0, 19).replace('T', ' ') }}. - Confirm that Store Comment Insights outputs to Set Video Status, then to Batch Iterate Items for the next video.
Execution Flow: Store Comment Insights → Set Video Status → Batch Iterate Items
Final Step: Test and Activate Your Workflow
Run a manual test to validate data flow and ensure sheets are updated correctly.
- Click Execute Workflow from Manual Run Trigger to start the pipeline.
- Verify that Store Comment Insights appends or updates rows with sentiment data.
- Check that Set Video Status updates status to
Finishedand writes a timestamp. - Once confirmed, toggle the workflow to Active to use it in production.
Common Gotchas
- YouTube API credentials can expire or lack the right scope. If calls fail, check your Google Cloud Console credentials and the n8n credential attached to the “HTTP Request – Get Comments” node first.
- If you’re using Wait nodes or external processing, timing can drift. Increase the wait duration if downstream nodes try to analyze before comment data is fully available.
- Default AI prompts are bland, and bland prompts create bland labels. Tighten the instructions inside “AI Agent – Analyze Sentiment Of Every Comment” so the model treats sarcasm, slang, and creator-specific context more reliably.
Frequently Asked Questions
About an hour if your Google APIs are already enabled.
No. You’ll mainly connect accounts and paste in API keys. The “logic” is already built into the workflow.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Gemini API usage (usually small for sentiment labeling) and YouTube API quota limits.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, and you should. In “AI Agent – Analyze Sentiment Of Every Comment,” change the instruction prompt and the allowed labels (for example, add “Feature Request” or “Bug Report” alongside Positive/Neutral/Negative). You can also swap the chat model by replacing the “Google Gemini Chat Model” with the “OpenAI Chat Model” node if that better matches your stack.
Most of the time it’s quota limits or an API key/OAuth credential that doesn’t have the right access. Verify the YouTube Data API is enabled in Google Cloud Console, then confirm the credential attached to “HTTP Request – Get Comments” is the one you intended. Also check the actual video URL format in your sheet, because malformed URLs can lead to empty video IDs and failed requests. If it worked yesterday and fails today, regenerate the credential and re-save it in n8n.
A lot, but you’re constrained by YouTube API quota and how large your runs are. On n8n Cloud, your monthly execution limit depends on plan; on self-hosting, executions are only limited by your server. In practice, most teams process batches of videos (like 10–50 at a time), then review the sheet, then run again.
Usually, yes for this use case. You’re doing multi-step logic (fetch, split into items, analyze each comment, write rows back, update statuses), and n8n handles that kind of branching cleanly. You also get the option to self-host, which is handy if you want high volume without paying per task. Zapier or Make can still work if you only need a very small setup, but sentiment labeling per comment gets expensive and fiddly fast. Talk to an automation expert if you want a quick recommendation for your volume.
Once this is running, your comment sentiment stops living in your head. It lives in a sheet you can filter, report on, and use to make the next decision.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.