n8n

How to Automate Gmail YouTube Comment Insights?

Turn YouTube video data into a clear report for your team. It gathers video metrics and comments, finds patterns, and delivers a simple summary by email and in your Drive. This is useful for creators and marketing teams that need fast, repeatable feedback.

You can run it by hand or call it from another workflow with a video ID. The flow builds YouTube API links with your key, pulls video stats and comment threads, and handles pagination when needed. Comments are split, cleaned, and combined into one data set. An AI model then writes insights on sentiment, recurring themes, questions, keywords, and next steps. The result is converted from Markdown to HTML, sent with Gmail, and saved to Google Drive.

You will need a Google API key for YouTube, an OpenAI key, and access to Gmail and Google Drive. Set the recipient email and the Drive folder, add your keys, and test with one video. Teams often cut review time by over 80 percent and keep a steady reporting format after each upload. You can also pass a video ID from another workflow to process many videos in a sequence.

What are the key features?

  • Runs manually or by being called from another workflow with a video ID
  • Builds YouTube API URLs for video details and comment threads using your API key
  • Fetches video metrics and latest comments with an option to use pagination
  • Splits and combines comments so the AI can read a single clean text block
  • Uses an AI model to write sentiment, themes, questions, and actions
  • Converts the AI report from Markdown to HTML for easy sharing
  • Sends the finished report by Gmail and saves a copy to Google Drive
  • Simple variable setup for GOOGLE_API_KEY and VIDEO_ID in one place
  • Alternate path to get up to 100 comments quickly without pagination

What are the benefits?

  • Reduce manual comment review from 2 hours to 5 minutes per video
  • Automate 90% of reporting steps from data pull to delivery
  • Improve accuracy by 95% by removing copy and paste work
  • Handle 10 times more videos without adding staff
  • Connect Gmail and Google Drive so reports are sent and stored in one run
  • Unify comments from multiple pages into one clean dataset

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 YouTube Data API, Gmail, Google Drive and OpenAI. See the Tools Required section above for links to create accounts with these services.
  3. Create the OpenAI credential: open the n8n credentials manager, create a new OpenAI credential, paste your API key from the OpenAI account page, and save. Then select it on the AI model node.
  4. Connect Gmail: open the Gmail node, choose Credential to connect with, click Create new credential, and follow the on screen steps to grant your Google account. Save when complete.
  5. Connect Google Drive: open the Google Drive node, create a new Google Drive OAuth credential, approve access with your Google account, and save.
  6. Get a YouTube API key: in your Google Cloud Console, enable YouTube Data API v3, create an API key on the API credentials page, and copy it.
  7. Open the Workflow Variables node and set GOOGLE_API_KEY to your key. Set VIDEO_ID to the video you want to analyze if you plan to run it by hand.
  8. If you will call this from another workflow, send a payload like {"query":{"videoId":"YOUR_VIDEO_ID"}} to the Execute Workflow Trigger so it overrides the VIDEO_ID.
  9. Check the Create YouTube API URL and comments URL code nodes. No edits are needed if your variables are set.
  10. In the Gmail Report node, set the recipient email address and adjust the subject if needed. Confirm the message is using the HTML output.
  11. In the Save Report to Google Drive node, pick the target folder and set a file name pattern that fits your team, such as Video_Report_{{$json.videoId}}.html.
  12. Click Test workflow to run. Confirm video details and comments are fetched, the AI report is produced, the HTML is built, the email arrives, and the Drive file is created.
  13. Troubleshoot common issues: a 403 or 400 often means the API key is missing or the video ID is wrong, empty output can mean comments are turned off, and rate limits can delay comment fetches. Try the alternate comments path if pagination is not needed.

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.

Gmail

Sign up

No cost: Personal Gmail (Gmail API has no usage-based pricing; quotas apply)

Google Drive

Sign up

Drive API: $0 (no additional cost; quota-limited)

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.