YouTube Channel Content Database Sync to Google Sheets - n8n Workflow

Automate synchronizing all videos from your YouTube channel to a Google Sheet database. This advanced n8n workflow handles API pagination and extracts detailed metadata, including video captions.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Content creators and YouTubers managing large video libraries.
Digital marketers needing a structured, searchable database of video metadata (titles, tags, descriptions, and statuses).
Users who require complex n8n templates demonstrating advanced API pagination and looping logic.
Anyone seeking to use n8n to centralize content data for analysis or repurposing.

Overview

Managing content databases manually is time-consuming, especially for creators with hundreds of videos. This powerful n8n workflow solves this by fully automating the sync process between YouTube and Google Sheets. The n8n workflow is designed to handle YouTube Data API limitations, performing complex pagination to ensure every single video is processed. It first identifies your channel's 'uploads' playlist, then systematically iterates through all video pages, fetches detailed metadata (titles, tags, descriptions, status, and privacy settings), and crucially, attempts to download the associated video captions in SRT format. Everything is then saved or updated in a central Google Sheet. This n8n node configuration provides a robust and reliable way to maintain a current content inventory.

How it Works

This comprehensive n8n workflow is initiated manually and follows a strict multi-stage process involving API calls and complex internal looping:


  1. Start and Initialization: The n8n trigger (Manual Trigger) starts the process. The Get My Channel n8n node uses the YouTube API to retrieve the current user's channel ID and the special 'uploads' playlist ID.

  2. Setup Variables: The Variables Set n8n node initializes pagination control variables, including setting the dynamic playlistId.

  3. Pagination Logic: The Loop Vars Code n8n node is the engine of the pagination, updating the current_page count and fetching the nextPageToken required for the next API call.

  4. Fetch Video List: The List Uploads HTTP Request n8n node retrieves a batch of video items (50 per call) using the stored playlistId and nextPageToken.

  5. Initial Sheet Update: Basic video metadata (ID, publish date) is saved to Google Sheets via the Update Posts Google Sheets n8n node.

  6. Collect and Loop Check: The Collect ids Code n8n node aggregates all video IDs processed in the current loop. The subsequent If n8n node determines if all pages have been fetched. If more pages exist, the n8n workflow loops back to Loop Vars.

  7. Fetch Detailed Metadata: Once the pagination is complete, the n8n workflow uses the aggregated video IDs to make a single detailed request to Get Video Details, retrieving rich metadata like title, tags, description, and privacy status.

  8. Detailed Sheet Update: The Update Posts1 Google Sheets n8n node updates the corresponding rows with the detailed information.

  9. Caption Retrieval: For each video, the n8n workflow attempts to retrieve the caption ID (Get captions ID). The If1 n8n node checks if captions are available. If so, the full captions text is downloaded using another HTTP Request n8n node (Get captions text).

  10. Final Update: The Update Posts2 Google Sheets n8n node saves the downloaded caption text, completing the video entry in the database. This entire process demonstrates highly effective use of the n8n node structure for reliable data synchronization.

Installation Guide

To use this n8n template, follow these steps:


  1. Import: Copy the provided JSON into your n8n instance using the 'Import from JSON' function.

  2. Google Account Credentials: You will need two types of Google credentials:

YouTube API (OAuth2): Update the credentials in the Get My Channel, List Uploads, Get Video Details, Get captions ID, and Get captions text HTTP Request n8n nodes. Ensure your Google credentials have permission to access your YouTube data.
Google Sheets API (OAuth2): Update the credentials in all Update Posts Google Sheets n8n nodes. Ensure these credentials have read/write access to your target spreadsheet.

  1. Google Sheet Setup: Replace the Document ID and Sheet Name parameters in all three Google Sheets n8n nodes (Update Posts, Update Posts1, Update Posts2) with the details of your own Google Sheets document. It is crucial that your spreadsheet columns match the fields being mapped (e.g., youtube_id, title, description, tags, captions).

  2. Execute: Run the n8n workflow using the manual trigger.

Node Details

Manual Trigger: The starting n8n trigger point for execution.
Get My Channel (HTTP Request): Function: Retrieves the unique 'uploads' playlist ID necessary for fetching video lists. Key Configuration: Uses part=contentDetails and mine=true.
Variables (Set): Function: Initializes critical variables for pagination, including setting the playlistId dynamically from the previous n8n node's output. Key Configuration: Sets perpage to 50.
Loop Vars (Code): Function: Manages the iterative state of the n8n workflow. It increments the current
page and extracts the nextPageToken from the List Uploads response to ensure continuous paging.
List Uploads (HTTP Request): Function: Fetches video items page by page using playlistId and pageToken to handle API pagination effectively. Key Configuration: Uses OAuth2 credentials.
Update Posts (Google Sheets): Function: Saves initial video data (ID, publish date). Key Configuration: Operation is set to Append or Update, matching on youtubeid.
If: Function: Controls the pagination loop. If the current page count is less than the total pages, the n8n workflow loops back to Loop Vars.
Get Video Details (HTTP Request): Function: Fetches comprehensive metadata (snippet, status) for the batch of video IDs. Key Configuration: Uses the aggregated ID string in the query parameter.
Update Posts1 (Google Sheets): Function: Updates the spreadsheet with rich data like title, description, tags, and status. Key Configuration: Matches on youtubeid.
Get captions ID & Get captions text (HTTP Request): Function: Specialized n8n node sequence to locate and download the video's caption track in SRT format.


  • Update Posts2 (Google Sheets): Function: Saves the final downloaded caption text into the respective row, completing the data enrichment for the n8n template.

Related n8n Workflows

Free

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

🎯 Digital Marketing & Web Dev Expert | 20+ Years of Results-Driven Experience. Helping businesses reduce ad spend and boost revenue through smart digital strategies.

Featured*