Process description This automation is a full-fledged intelligent system for automatically searching, analyzing and creating viral clips. The system automatically searches for trending videos through the YouTube API, analyzes their potential using AI, keeps a record of processed videos in Google Sheets, creates clips through Vizard AI, generates attractive titles and automatically publishes them to TikTok via Blotato.
API keys and services: YouTube Data API v3 - to search for trending videosVizard AI API - for analyzing videos and creating clipsOpenAI API Key - for AI content analysis and generation (gpt-4o-mini)Blotato API - for uploading media and publishing on social networksGoogle Sheets OAuth2 - to maintain a database of processed videosTikTok Account ID - for automatic publication (ID: 6545)System architecture by blocks SECTION 1: VIDEO SEARCH AND FILTER 1.1 When clicking 'Test workflow' - Manual launch Purpose: Starts the process of searching for trending videos to create clips
Startup alternatives:
Manual Trigger for testing Schedule Trigger to run automatically on schedule Webhook for external integrations 1.2 HTTP Request2 — Search for trending YouTube videos Purpose: Gets a list of the most popular YouTube videos through the official API
HTTP Request settings:
URL: https://www.googleapis.com/youtube/v3/videosMethod: GETQuery Parameters: part: snippet, statistics, contentDetailschart: MostPopular (top popular videos)MaxResults: 50 (number of videos to analyze)key: (Your API key)What we get:
{
“items”: [
{
“id”: “dqw4w9wgxCQ”,
“snippet”: {
“title”: “Amazing viral moment!” ,
“description”: “This video shows incredible... “,
“ChannelTitle”: “Popular Channel”,
PublishEdat: 2024-01-15T 10:30:00 Z,
“categoryID”: “22"
},
“statistics”: {
“viewCount”: “1500000",
“LikeCount”: “85000",
“CommentCount”: “12000"
},
“ContentDetails”: {
“duration”: “PT5M30S”,
“caption”: “true”
}
}
]
}
1.3 Split Out1 - Video Splitting
Purpose: Converts an array of videos into separate elements for individual analysis
1.4 Filter - Filter by category Purpose: Selects videos only from categories suitable for creating clips
Filtering conditions (OR logic):
CategoryID === “22" - People & Blogs (people and blogs)CategoryID === “24" - EntertainmentCategoryID === “25" - News & Politics (news and politics)CategoryID === “27" - EducationCategoryID === “28" - Science & Technology (science and technology)Why filter categories:
Excludes music, games, sports (low potential for clips) Focuses on content with high viral potential Optimizes the quality of the source material 1.5 Code - Virus potential analysis Purpose: Calculates the viral potential of each video based on metrics and content
Analysis algorithm:
1. Duration parsing:
//Convert ISO 8601 (PT5M30S) to minutes
const duration = video.contentDetails?. duration;
const DurationMatch = duration.match (/PT (? : (\ d+) H)? (? : (\ d+) M)? (? : (\ d+) S)? /);
const TotalMinutes = hours * 60+ minutes+seconds/60;
2. Freshness analysis:
//Check how long ago it was published
const PublishedDate = new Date (video.snippet?. PublishEdat);
const HoursDiff = (now - PublishedDate)/(1000 * 60 * 60);
3. Viral keyword detection:
const ViralKeywords = [
'shocking', 'amazing', 'incredible', 'unbelievable',
'must watch', 'viral', 'trending', 'insane',
'you won\'t believe', 'this will', 'watch this'
];
4. Virus score calculation:
const LikeRatio = likes/views;
const commentRatio = comments/views;
const ViralScore = LikeRatio * 1000+ CommentRatio * 5000+ (HasviralKeywords? 20:0);
Output data:
{
“id”: “dqw4w9wgxCQ”,
“title”: “Amazing viral moment!” ,
“VideoURL”: "https://www.youtube.com/watch?v=dQw4w9WgXcQ “,
“views”: 1500000,
“likes”: 85000,
“LikeRatio”: 5.67,
ViralScore: 45.2,
“hasviralKeywords”: true,
“TotalMinutes”: 5.5,
“HoursSincePublished”: 24
}
1.6 Code1 — Preparing data for AI
Purpose: Aggregates all analyzed videos and generates a prompt for AI selection
Prompt formation:
const AiPrompt = `Choose ONE of the most viral videos from the list:
1. Amazing viral moment!
URL: https://www.youtube.com/watch?v=dQw4w9WgXcQ
Visningar: 1,500,000
Virus score: 45.2
2. Incredible transformation!
URL: https://www.youtube.com/watch?v=abc123
Visningar: 850,000
Virus Score: 38.7
Answer with a video number and justification. `;
SECTION 2: AI CHOOSING THE BEST VIDEO
2.1 AI Agent1 — Intelligent video selection Purpose: AI analyzes the list of videos and selects the most promising one for creating clips
Connected components:
OpenAI Chat Model1 (gpt-4o-mini) - main language modelSimple Memory - memory for avoiding repetitionsSheets - a tool for checking the database of processed videosStructured Output Parser - structured JSON responseSystem prompt:
You're a TikTok content expert.
From the list of videos, choose ONE of the most viral ones.
IMPORTANT! Before choosing, use the Sheets tool to make sure that the selected video doesn't match and hasn't been used before.
Use the Sheets tool every time you start.
Be sure to make sure that the video has not been used before!
It is MANDATORY to reply ONLY in JSON format:
{
“videoURL”: “link to the selected video”,
“title”: “video title”,
“description”: “video description”
}
AI algorithm:
Gets a list of videos with virality metrics Turns to Google Sheets to check for duplicates Analyzes the potential of each video Selects the best unused video Returns a structured JSON response 2.2 Sheets — Duplicate Checker Tool Purpose: Allows AI to check whether a video has already been processed before
Settings:
Tool Description: “Video repetition test”Document ID: (your document)Sheet Name: (your document)The structure of the accounting table:
date
Video
Status
clip
2024-01-15
https://youtube.com/watch?v=abc123
Done
clip1.mp4
2024-01-16
https://youtube.com/watch?v=def456
To do
-
2.3 Structured Output Parser - JSON parsing Purpose: Provides a correct JSON response from AI
JSON Schema:
{
“VideoURL”: "https://www.youtube.com/watch?v=dQw4w9WgXcQ “,
“title”: “Example Video Title”,
“description”: “Example video description”
}
SECTION 3: DATABASE MANAGEMENT
3.1 Google Sheets2 - Adding to the database Purpose: Writes the selected video to the database with the “To do” status
Speaker mapping:
Video: {{$json.output.videoURL}}Date: {{$now}}Status: “To do”3.2 Google Sheets — Getting Tasks Purpose: Reads videos with the “To do” status for processing
Filters:
Lookup Column: StatusLookup Value: “To do”3.3 Google Sheets3 — Status Update Purpose: Changes status to “Done” after successful publication
Operation: AppendorUpdate Matching Columns: Video The fields to be updated are: Status = “Done”
SECTION 4: CREATING CLIPS 4.1 HTTP Request - Creating a Vizard Project Purpose: Sends videos to Vizard AI to analyze and create clips
JSON Body:
{
“lang”: “en”,
“preferLength”: [0],
“videoURL”: “{{$json ['Video']}}”,
VideoType: 2,
“MaxClipNumber”: 8
}
4.2 Wait → HTTP Request1 → If - Waiting cycle
Logic: Similar to the first version - waiting 60 seconds and checking readiness
SECTION 5: CLIP PROCESSING 5.1 Edit Fields → Split Out → Limit Purpose: Prepares clips for individual processing
Limit: Limits the number of clips that can be processed (the default is 1)
5.2 AI Agent - Generating descriptions Purpose: Creates engaging titles and descriptions for TikTok
Updated prompt:
Clip title: {{$ ('AI Agent1') .item.json.output.title}}
Description: {{$ ('AI Agent1') .item.json.output.description}}
Transcription: {{$json.videos.transcript}}
Viral reason: {{$JSON.videos.ViralReason}}
Benefit: AI uses data from both Vizard and YouTube to describe it more accurately
SECTION 6: PUBLICATION 6.1 Set Accounts → Upload → TIKTOK Logic: Similar to the first version - uploading to Blotato and posting to TikTok
Update to Set Accounts:
{
“video_caption”: “{{json.stringify ($json.output) .slice (1, -1)}}”
}
Node connection diagram Main stream: Manual Trigger → HTTP Request2 (YouTube video search)HTTP Request2 → Split Out1 → Filter → Code → Code1 Code1 → AI Agent1 (choosing the best video)AI Agent1 → Google Sheets2 (database entry)Google Sheets2 → Google Sheets (reading tasks)Google Sheets → HTTP Request (creating clips)Clip processing: HTTP Request → Wait → HTTP Request1 → If If (True) → Edit Fields → Split Out → Limit Limit → AI Agent → Set Accounts → Upload → TIKTOK TIKTOK → Google Sheets3 (status update)AI connections: OpenAI Chat Model1 + Simple Memory + Sheets + Structured Output Parser → AI Agent1 OpenAI Chat Model → AI Agent Required services and their settings YouTube Data API setup: Create a project in Google Cloud Console Enable YouTube Data API v3 Get the API key: (your API key from google cloud console) Setting up Google Sheets: Create a “Video Accounting for Clips” table ID: Your spreadsheet ID Speakers: Date, Video, Status, Clip Set up OAuth2 access Other services: Vizard AI, Blotato, OpenAI - similar to the first version New features of the v2.0 system Automatic content search: YouTube API integration - search for the most popular videosCategory filtering - only suitable content typesVirality metrics - capacity calculation based on statisticsKeywords - detection of viral patterns in headlinesIntelligent selection: AI video selection - analysis of all candidates simultaneouslyPrevent duplicates - checking the database of processed videosStructured answers - guaranteed JSON formatSystem memory - avoid re-selectionDatabase and accounting: Google Sheets integration - full accounting of all transactionsProcessing statuses - To do/Done for process controlTransaction history - date, video, resultAutomatic update - statuses change automaticallyImproved content generation: Dual context - data from YouTube+ VizardMore accurate descriptions - AI knows the source and contentOptimization for TikTok - specific formats and trendsApplication of the v2.0 system To automate content production: Full autonomy - from search to publication without human interventionDaily publications - setting Schedule Trigger to run regularlyHigh-quality filtration - only verified sources are processedEliminate duplicates - each video is only processed onceFor agencies and studios: Scalable search - analysis of 50 top videos at a timeAI expertise - objective selection of the best candidatesSystematization of the process - full control via Google SheetsOptimizing ROI - focus only on the most promising videosThe result of the v2.0 system What happens is: Intelligent content pipeline with AI source selectionAutomatic trend search via YouTube APIExcluding the human factor in choosing contentFull transparency of the process through the accounting systemGuaranteed uniqueness contentPerformance metrics v2.0: Analysis: 50 trending videos per launchFiltering: only 5 relevant categoriesAI choice: 1 best video out of all candidatesPreventing duplicates: 100% uniquenessFull cycle: from search to publication in 2-3 minutesThe advantages of v2.0 over v1.0: Autonomy - no need to manually search for videosQuality of sources - only trending YouTube videosAI expertise - objective analysis of potentialSystematicity - full accounting and control of the processScalability - easy to increase the number of analyzed videosThe v2.0 system turns viral content creation into a fully automated and intelligent process!