What is n8n?
n8n is an automation tool that helps you connect different apps and services using workflows.
Instead of doing tasks manually, n8n allows you to automate them using simple steps called nodes.
In this activity, you will learn how n8n works by importing an existing workflow and understanding what each part of the workflow does.
Step 1: Open n8n
Open n8n using the link given below:
👉 [n8n.io - AI workflow automation tool]
Step 2: Import the Workflow
Follow these steps inside n8n:
Click on the three dots (⋮) in the top-right corner.
Click Import.
Select Import from JSON.
Step 3: Get the Workflow JSON File
The workflow you need is available in a separate document.
👉 [https://docs.google.com/document/d/1dQKlz1I96ROY4UJs6r9yxU5P3sKOdqkm/edit?usp=sharing&ouid=102152989217281512477&rtpof=true&sd=true]
From that document:
Copy the entire JSON code
Paste it into n8n
Click Import
Step 4: Understand the Workflow
Once the workflow is imported, you will see multiple nodes connected together.
Each node represents one action or step in the automation.
Below is a simple explanation of what each node does.
Node-by-Node Explanation
1. Schedule Trigger
This node starts the workflow automatically at regular intervals.
In this workflow, it runs once every 7 minutes, so the system keeps generating and uploading videos without any manual action.
It is the starting point of the automation.
2. AI Agent
This node generates a new creative video idea every time the workflow runs.
It is instructed to:
Generate a viral YouTube Shorts idea
Create a curiosity-driven title
Write a ready-to-use Veo 3.1 video prompt
Output only a clean JSON object with:
title
prompt
This is where the entire creative concept of the video is created.
3. Google Gemini Chat Model
This node provides the AI intelligence for the AI Agent.
It uses Google Gemini to:
Understand the system instructions
Generate structured JSON output
Follow strict formatting rules
Without this node, the AI Agent would not be able to generate responses.
4. Code in JavaScript
This node cleans and prepares the AI output so it can be used by other nodes.
What it does:
Reads the raw AI response
Parses the JSON properly
Extracts only:
title
prompt
Removes any formatting issues
This ensures the workflow does not break due to invalid JSON formatting.
5. Video Call
This node sends the generated prompt to Google’s Veo 3.1 video generation API.
It tells the API:
What the video prompt is
That the video should be vertical (9:16 format)
This step starts the video creation process.
Veo responds with a long-running operation ID because video generation takes time.
6. Video Generation
This node checks the status of the video generation request.
Since video creation is not instant, this node:
Uses the operation ID
Checks whether the video is ready
Returns:
done = true or false
video download URL (if completed)
This is the polling step.
7. If
This node makes a decision based on the video status.
It checks:
Whether the video URL exists
Whether generation is marked as complete
If the video is ready → continue to download
If not ready → go to the Wait node
This prevents errors and incomplete downloads.
8. Wait
This node pauses the workflow for 1 minute before checking again.
It helps:
Avoid excessive API calls
Give Veo enough time to finish generating the video
It creates a loop:
Check → Not Ready → Wait → Check Again
9. Downloading the Video
Once the video is ready, this node:
Downloads the generated MP4 file
Stores it temporarily inside n8n as binary data
Now the workflow has the actual video file.
10. Upload a Video (YouTube)
This node uploads the downloaded video directly to YouTube.
It:
Takes the binary video file
Uses the AI-generated title
Publishes it automatically
This is the final output step.
Summary of the Workflow
The workflow runs automatically every 7 minutes
AI generates a new short-form video idea
Veo 3.1 creates the video
The system waits until the video is ready
The video is downloaded
The final video is uploaded to YouTube automatically
Once set up, the entire process runs without manual effort.
0 Comments
Thank you For Reading Our Blog