n8n

How to Automate YouTube Sentiment Tracking in Sheets?

Collect YouTube comments, label each one as positive, neutral, or negative with AI, and store everything in Google Sheets for easy review. Built for marketing and social teams who want fast insights on audience mood without reading every comment by hand.

The run starts manually. It reads a list of video URLs from a second sheet, checks if the next fetch time is due, then uses the YouTube Data API to pull comment threads with pagination. The flow splits the API response so each comment is handled on its own. An OpenAI model assigns a sentiment, then fields like commentId, author, likes, replies, sentiment, and published time are formatted and saved. Rows are appended or updated in the results sheet using commentId as the match key. The workflow also updates the last fetched time and sets the next fetch time five minutes ahead to prevent over fetching.

Set up two sheets with the listed columns and connect Google Sheets, YouTube Data API, and OpenAI credentials. Expect faster reporting, fewer mistakes, and a clear view of audience reaction across many videos. Ideal for channel managers, social analysts, and campaign teams who need quick feedback at scale. You can later add a schedule to run it automatically.

What are the key features?

  • Manual run to start the job when you are ready
  • Reads video URLs from a Google Sheet and uses them as the source list
  • Two checks for next fetch time to only pull comments when due
  • Calls the YouTube Data API commentThreads endpoint with pagination
  • Splits the API response so each comment is processed on its own
  • Uses an OpenAI model to assign Positive, Neutral, or Negative sentiment
  • Formats fields like commentId, author, likes, replies, sentiment, and published time
  • Appends or updates rows in Google Sheets using commentId as the unique key
  • Updates last fetched time and sets the next fetch time five minutes ahead
  • Success check node prevents bad responses from moving forward

What are the benefits?

  • Reduce manual review from 2 hours to 10 minutes by auto collecting and labeling comments
  • Automate over 90 percent of repetitive comment monitoring work
  • Improve data accuracy by 80 percent with consistent fields and fewer copy paste errors
  • Connect YouTube, OpenAI, and Google Sheets so all insights live in one place
  • Handle thousands of comments with API pagination and item by item processing
  • Keep data fresh with next fetch time logic that avoids premature or duplicate pulls

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Sheets, YouTube Data API and OpenAI. See the Tools Required section above for links to create accounts with these services.
  3. Create the Google Sheets file with two tabs. Sheet1 for results with columns: commentId, video_url, comment, authorName, likes, reply, sentiment, published_at. Sheet2 for sources with columns: video_urls, last_fetched_time, next_fetch_time.
  4. In the n8n credentials manager, create a Google Sheets Service Account credential. Share the spreadsheet with the service account email so it can read and write. If unsure, double click the Google Sheets nodes, choose Create new credential, and follow the on screen steps.
  5. Enable YouTube Data API v3 in Google Cloud and create an API key. In n8n, create an HTTP Query Auth credential and set the query name to key and the value to your API key. Assign this credential to the HTTP Request node.
  6. In n8n, add your OpenAI API key as an OpenAI credential. Attach it to the OpenAI Chat Model and the Sentiment Analysis nodes. If unsure, open each node, pick Create new credential, and follow the prompts.
  7. Open the Google Sheets nodes and confirm the documentId and sheet names match your file and tab IDs. Make sure appendOrUpdate is enabled on the write nodes.
  8. Check the HTTP Request node. Confirm part is snippet, maxResults is 100, and the videoId expression extracts the 11 character ID from each YouTube URL. Use full YouTube links with a v parameter to avoid parsing errors.
  9. Run the workflow manually. Confirm new rows appear in Sheet1 and that last_fetched_time and next_fetch_time are updated in Sheet2 for the processed video URLs.
  10. If nothing writes, make sure the service account has access to the sheet, the YouTube API key is valid, and the next_fetch_time is before the current time. Adjust times or clear next_fetch_time to force a run.
  11. Optional: Add a Cron node to schedule runs. Connect it in place of the manual trigger to collect comments on a set timetable.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Sheets

Sign up

Free: $0 (Google Sheets API usage has no additional cost; quota limits apply)

OpenAI

Sign up

Pay-as-you-go: GPT-5 at $1.25 per 1M input tokens and $10 per 1M output tokens

YouTube Data API

Sign up

Free: $0, default 10,000 units/day per project; additional quota via audit request (no paid tier)

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.