Automated YouTube Video Scheduling and Interval Upload System - n8n Workflow

Use this powerful n8n workflow to automate scheduled YouTube video uploads (12-hour intervals) directly from your self-hosted environment. Ideal for consistent content publishing.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content creators managing high-volume video backlogs.

  • Users running a self-hosted n8n environment (like Docker) with local file access.

  • Teams requiring consistent, automated video release schedules (e.g., daily or bi-daily).

  • Developers looking for advanced examples of custom scheduling logic within an n8n template.

Overview

Managing a large backlog of video content and ensuring consistent publication times can be time-consuming. This specialized n8n workflow template solves the problem of manual scheduling by automating the entire process, from file discovery to playlist inclusion.

This robust n8n workflow leverages custom JavaScript logic to precisely calculate future upload times, ensuring each video is scheduled exactly 12 hours after the previous one, anchored to a specific timezone (JST, +09:00). This provides unparalleled consistency for your publishing strategy. Once configured, the process requires only a single manual execution via the n8n trigger to initiate the entire upload queue.

How it Works

This automated publishing solution begins with the Manual Trigger n8n node, which kicks off the process.


  1. File Discovery: The List Video Files n8n node executes a system command (find) to locate all .mp4 video files within the specified local directory (/opt/downloads/单词卡/A1-A2).

  2. Sorting and Preparation: The subsequent Code n8n node (Sort and Generate Items) processes the file paths. It extracts a numeric day identifier from the filenames, sorts the videos sequentially based on this number, and generates individual items for the n8n workflow.

  3. Interval Scheduling: The core scheduling intelligence resides in the Calculate Publish Schedule Code n8n node. This custom script determines the next available publishing slot, adds a 30-minute buffer, and then applies the sequential 12-hour interval offset for every subsequent video. It handles timezone conversion (JST to UTC) to generate the correct publishAtUtc timestamp required by YouTube.

  4. Batch Processing: The Split in Batches n8n node ensures that each video is handled individually, improving memory management and workflow reliability, especially for large files.

  5. Data Read: The Read Video File n8n node accesses the local file system and retrieves the actual binary data for the video file.

  6. Scheduled Upload: The Upload to YouTube (Scheduled) n8n node performs the API call to YouTube, using the file data and the calculated publishAtUtc from the previous step. The video is initially uploaded as a private resource.

  7. Playlist Management: Finally, the Add to Playlist n8n node uses the returned uploadId to automatically organize the new video into the specified YouTube playlist. This completes the fully automated n8n workflow cycle.

Installation Guide

To use this n8n template successfully, follow these steps:


  1. Import: Copy the provided JSON data and import it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Credentials Setup: Locate the Upload to YouTube and Add to Playlist n8n nodes. You must configure a YouTube OAuth2 API credential with the necessary scopes (Upload and Playlist management).

  3. File Path Configuration: Review the List Video Files n8n node (Execute Command) and update the find command path to match the directory where your video files are stored on the server hosting n8n.

  4. Scheduling Adjustments: If you need to change the interval (currently 12 hours) or the timezone (currently JST +09:00), edit the variables inside the Calculate Publish Schedule n8n node's Code section.

  5. Metadata Configuration: Update the Upload to YouTube n8n node parameters (Title, Description, Tags, Category ID) to match your content strategy. Also, update the Playlist ID in the Add to Playlist n8n node.

  6. Activation: Save and activate the n8n workflow. Run the Manual Trigger to begin the scheduled upload sequence.

Node Details

This n8n workflow utilizes several specialized n8n nodes:

Manual Trigger: The starting n8n trigger point for initiating the upload sequence on demand.
List Video Files (Execute Command): Uses find command to dynamically locate all target .mp4 files on the local filesystem. Essential for the initial data collection of this n8n template.
Sort and Generate Items (Code): A custom n8n node script that sorts videos based on extracted 'day' numbers from their filenames, ensuring the correct upload order.
Calculate Publish Schedule (+12h Interval) (Code): The core logic n8n node. It calculates the precise future publishAtUtc timestamps for each video, enforcing a 12-hour release interval tailored to the JST (+09:00) timezone.
Split in Batches (Split In Batches): A flow control n8n node that ensures the remaining workflow steps process one video item fully before proceeding to the next, preventing simultaneous resource conflicts during the upload process.
Read Video File (Read/Write File): Reads the binary data of the video file from the path specified in the previous n8n node output, preparing it for the YouTube API.
Upload to YouTube (YouTube n8n node): The primary YouTube n8n node used for uploading the video file. It is configured to use the dynamically calculated publishAt timestamp and sets the video privacy status to private until the scheduled time.
Add to Playlist (YouTube n8n node): Uses the YouTube n8n node again to associate the newly uploaded video (via its uploadId) with a predefined channel playlist, maintaining content organization.

Related n8n Workflows

Free

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

Featured*