Send us a message and we'll get back to you shortly.
Learn how to automate data collection and use data-driven decision making to find the optimal YouTube video length for educational content using n8n and Google Sheets.
We make too many decisions every day and hour of our lives. Sometimes we make these decisions based on our feelings, and sometimes based on our own previous experiences. Based on your personal experience, which decision led to a positive result in line with your end goal? feeling-based decision or experience-based decision?
I hope your answer is experience-based decision, if your answer is feeling-based based you are not suited for this article, Please leave as soon as possible!!!
That was a joke, but in the business field, decisions should be made based on data. If you want to base your business on feelings, you will probably lose money and time on the trial-and-error process.
Let's say you want to create educational YouTube videos. You can jump right into video recording and keep uploading on YouTube, or you can study existing videos, analyze their likes, comments, length, title, description, and tags, and find the relation between them and their ranking and views. Which path will you pick? If your answer is jump right into the recording, I'm serious, this time leave as soon as possible, this article is not for you.
The answer is really simple: the most important benefit of data-driven decision making is to accomplish your goal and celebrate the result you were looking for.
We are done with the reading part, let's get our hands dirty. We want to create an educational YouTube video about the n8n framework and reach a high number of views. There are many questions, and one of them is how long my video should be. This has a high impact on views number and engagement (likes and comments).
Let's break down what we want to do
| Content Type | Keyword | Goal | What data we need ? |
| Educational | n8n | High number of views, likes, and comments | Youtube videos that has n8n in their title, description and tags, their length and number of likes and comments |
We are going to use n8n to pull YouTube videos and log them in a Google Sheet. If you want to follow along, create an account in n8n and launch your instance, or self-host your n8n in your infrastructure
Let's start by adding a manual trigger node, so when we click on Execute workflow Button it starts
In the Get many videos node, we add n8n in the query field and pull existing videos
This returns ~600 videos.
The previous node provides overall data about the videos, but it doesn't contain data like the number of comments, likes, and duration. To find this information, let's add a loop node to control the number of videos on each batch we want to process, so we don't hit the YouTube rate limit and use a YouTube Get a Video node to find a specific video using its id and write its data to a Google Sheet and wait for a couple of seconds before moving to the next batch. We also need a Code node to convert the Duration ISO 8601 string, like PT26M36S to a more human-readable number in minutes, like 26.6
Before writing the videos to the Google Sheet, let's filter them first. We don't want to use our resources to process videos with a low number of views since we want to analyze and find what works, not what doesn't work. We add a new Conditional If node to only process videos to have X number of videos. In our case, let's use 1000 views as our base number
TO make sure each item is a video and not channel or other content type, we add a condition to make sure {{ $json.id.kind }} is equal to youtube#video
Add a new Get a Video node to pass {{ $json.id.videoId }} as video id
Let's add a new Code Node to sanitize each video data and calculate duration in minutes, and return fields we care about
Let's add a new conditional node to only process videos that have more than 1000 views. Set {{ $json.Views }} to is greater than 1000
Now let's update the Google Sheet with video data
Now let's wait for 15 seconds and go to the next item
In this step, we analyze each video's duration, defined in minutes, and determine which duration is best.
Start By Adding a Sheet Get Rows Node that pulls all of the rows in the Google Sheet we created previously
Add a Code Node to analyze videos by defining different bins of videos by their duration range (the delta starts small, but for higher durations, a couple of minutes doesn't have too much difference)
Now connect the Manual Workflow Execution node to this workflow and see the result. In my case, the result is
I found the answer to my question the length should be between 30-60 minutes. But to have a video that performs well on YouTube, I need to answer more questions
These are important questions you should find answers for before you start creating your videos. I leave them as homework for you.
If you need any help with implementations for those questions, contact me at amir@cubite.io, and I would be more than happy to answer any questions.
Data-driven decision making is a crucial practice to achieve our business goals with the lowest amount of risk and resource cost. To begin with, define your goal. In our example, our goal was getting 1000+ views for our YouTube video. Next, write a list of questions like: What should be the length of the video? What tags should I use? etc and then implement an automation to gather data and implement a logic to process that data to answer your questions.
Looking to learn more about n8n, youtube and data driven decisions? These related articles explore complementary topics, techniques, and strategies.
Discover how to self-host n8n with AI automation for powerful, customizable workflows. Learn setup, scalability with PostgreSQL & Redis, and secure reverse proxy configuration on Hetzner for optimized automation performance.
Learn how to create a powerful AI agent that autonomously analyzes financial news and market data to deliver real-time, actionable market summaries. This step-by-step guide walks you through leveraging n8n’s low-code automation platform combined with AI models like GPT to build a smart financial assistant that senses, plans, acts, and learns — helping investors and traders make informed decisions faster.
Unlock the secrets of N8N SEO Automation! Discover how to optimize your metatags and increase your website's visibility today.
Learn how AI food ordering agents work, enhance customer experience, and integrate with restaurants. Build your own and optimize operations.
Learn how to create a custom SEO scanner using n8n to automate site audits and track performance efficiently.
Learn how to create a powerful AI agent for Airbnb hosts using Telegram and n8n. Automate guest messaging, manage bookings, and streamline operations with AI-driven workflows—no coding required. Boost efficiency and guest satisfaction today!