0% found this document useful (0 votes)
123 views12 pages

Viral Video Forensics Setup Guide

The Viral Video Forensics Workflow is an n8n automation that analyzes viral short-form videos from Instagram and TikTok, generating detailed manifests for recreating content using AI tools. It requires accounts with Apify and Google Cloud for video scraping and analysis, and can optionally share results via Slack. The setup includes configuring API credentials, importing workflows, and testing components to ensure functionality.

Uploaded by

rovo1801
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views12 pages

Viral Video Forensics Setup Guide

The Viral Video Forensics Workflow is an n8n automation that analyzes viral short-form videos from Instagram and TikTok, generating detailed manifests for recreating content using AI tools. It requires accounts with Apify and Google Cloud for video scraping and analysis, and can optionally share results via Slack. The setup includes configuring API credentials, importing workflows, and testing components to ensure functionality.

Uploaded by

rovo1801
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Viral Video Forensics Workflow - Complete Setup Guide

🎯 What This Workflow Does


This n8n automation performs forensic analysis of viral short-form videos from Instagram and TikTok,
generating detailed "Generative Manifests" that can be used to recreate similar content with AI video
tools like Google Veo or Sora.
Key Features:
Scrapes video content from Instagram Reels and TikTok
Downloads videos and converts to base64 for analysis
Uses Google Gemini 2.5 Pro for detailed video breakdown
Generates shot-by-shot recreation instructions
Shares results via Slack (optional)
Processes both platforms automatically

🔧 Prerequisites & Required Accounts


Essential Services (Required)
1. Apify Account
Purpose: Video scraping from Instagram/TikTok
Sign up: [Link]
Cost: Free tier (5,000 requests), paid plans from $49/month
Discount: Use code 30NATEHERK for 30% off credits
2. Google Cloud Platform Account
Purpose: Gemini AI video analysis
Sign up: [Link]
API needed: Generative Language API (Gemini 2.5 Pro)
Cost: ~$0.002 per video analysis request
3. n8n Instance
Purpose: Workflow execution platform
Options: Self-hosted or n8n Cloud
Minimum version: 1.0+
Recommended: Latest version for full compatibility
Optional Services
4. Slack Workspace
Purpose: Result sharing and notifications
Requirements: Admin access to create apps
Cost: Free tier available

🚀 Step-by-Step Setup Process


Phase 1: API Credentials Configuration
Step 1: Configure Apify Integration
Get Your Apify API Token:
1. Login to your Apify account
2. Navigate to Settings → Integrations → API tokens
3. Click "Create new token"
4. Name: n8n-video-scraper
5. Copy the token (format: apify_api_... )
Configure in n8n:
1. Go to Settings → Credentials
2. Click "+ Add Credential"
3. Select "HTTP Header Auth"
4. Set up as follows:
Name: "Apify-TripleWhale"
Header Name: "Authorization"
Header Value: "Bearer YOUR_APIFY_TOKEN_HERE"
5. Save credential
Step 2: Set Up Google Gemini API
Enable Gemini API:
1. Open Google Cloud Console
2. Create new project or select existing
3. Navigate to APIs & Services → Library
4. Search for "Generative Language API"
5. Click Enable
Create API Key:
1. Go to APIs & Services → Credentials
2. Click "+ Create Credentials" → API Key
3. Copy the generated key
4. (Recommended) Restrict key to Generative Language API
Configure in n8n:
1. Go to Settings → Credentials
2. Click "+ Add Credential"
3. Select "HTTP Header Auth"
4. Set up as follows:
Name: "Gemini-API"
Header Name: "x-goog-api-key"
Header Value: "YOUR_GEMINI_API_KEY_HERE"
5. Save credential
Step 3: Slack Integration (Optional)
Create Slack App:
1. Go to [Link]/apps
2. Click "Create New App" → "From scratch"
3. App Name: Video Forensics Bot
4. Select your workspace
Configure Permissions:
1. Go to OAuth & Permissions
2. Add these Bot Token Scopes:
chat:write (Send messages)
files:write (Upload files)
channels:read (Access channel info)
3. Click "Install to Workspace"
4. Copy the Bot User OAuth Token
Add Bot to Channel:
1. In Slack, go to your target channel
2. Type /invite @Video Forensics Bot
3. Get Channel ID: Right-click channel → View channel details → Copy ID
Configure in n8n:
1. Go to Settings → Credentials
2. Click "+ Add Credential"
3. Select "Slack API"
4. Enter your Bot User OAuth Token
5. Save credential

Phase 2: Workflow Import & Configuration


Step 4: Import the Workflow
1. Copy the complete workflow JSON
2. In n8n interface, click "+ Add workflow"
3. Click "Import from Clipboard"
4. Paste the JSON content
5. Click "Import"
Step 5: Connect Your Credentials
Update these nodes with your credential IDs:
Instagram Scraping Node ( scrape_ig_reel ):
Click the node
In Authentication section
Select your "Apify-TripleWhale" credential
TikTok Scraping Node ( scrape_tiktok ):
Click the node
In Authentication section
Select your "Apify-TripleWhale" credential
Instagram Analysis Node ( analyze_ig_reel ):
Click the node
In Authentication section
Select your "Gemini-API" credential
TikTok Analysis Node ( analyze_tiktok ):
Click the node
In Authentication section
Select your "Gemini-API" credential
Slack Nodes (if using):
upload_file node → Select your Slack credential
send_prompt_msg node → Select your Slack credential
Update Channel ID in send_prompt_msg :
json
"channelId": "YOUR_CHANNEL_ID_HERE"

Phase 3: Testing & Validation


Step 6: Test Individual Components
Test Apify Instagram Scraping:
1. Click "scrape_ig_reel" node
2. Click "Test step"
3. Use test URL: [Link]
4. Verify response contains videoUrl field
Test Apify TikTok Scraping:
1. Click "scrape_tiktok" node
2. Click "Test step"
3. Use test URL: [Link]
4. Verify response contains video data
Test Gemini Analysis:
1. Run a complete test with a small video
2. Check the analysis output quality
3. Verify detailed breakdown is generated
Step 7: Full Workflow Test
1. Activate the workflow (toggle switch)
2. Access the form URL:
Find in form_trigger node
Copy the webhook URL
3. Submit a test video URL
4. Monitor execution in n8n interface
5. Check Slack for results (if configured)

⚙️ Configuration Details
Form Trigger Setup
The workflow creates a web form with these settings:
Title: "Reverse Engineer Short Form Video"
Description: "Provide an IG Reel url or a TikTok url."
Field Type: URL input with validation
Required: Yes
Platform Detection Logic
The switch node uses these conditions:
javascript
// Instagram detection
{{ $('form_trigger').[Link] }}.contains("[Link]")
// TikTok detection
{{ $('form_trigger').[Link] }}.contains("[Link]")

Critical API Endpoints Used


Apify Instagram: /v2/acts/apify~instagram-api-scraper/run-sync-get-dataset-items
Apify TikTok: /v2/acts/apidojo~tiktok-scraper/run-sync-get-dataset-items
Gemini Vision: /v1beta/models/gemini-2.5-pro:generateContent
🔍 Troubleshooting Guide
Common Issues & Solutions
Authentication Errors
Problem: "Unauthorized" or "Invalid API key" Solutions:
Verify API tokens are active and correct
Check credential configuration format
Ensure proper header names ( Authorization vs x-goog-api-key )
Test credentials outside of n8n
Video Download Failures
Problem: Cannot download video content Solutions:
Ensure videos are from public accounts
Check if video URLs are valid and accessible
Verify Apify scrapers are working (test in Apify console)
Try different video URLs to isolate the issue
Gemini Analysis Timeouts
Problem: Long processing times or timeouts Solutions:
Check video file size (limit: ~50MB)
Verify Google Cloud billing is active
Monitor API quotas in Google Cloud Console
Consider shorter videos for testing
Slack Integration Issues
Problem: Messages not appearing in Slack Solutions:
Verify bot permissions in workspace
Check channel ID format (starts with 'C')
Ensure bot is invited to target channel
Test with different channels
Performance Optimization
Rate Limiting Management
Apify: 100 requests/hour (free tier)
Gemini: 15 requests/minute
Solution: Add wait nodes between requests if hitting limits
Cost Control
Monitor Apify usage in dashboard
Track Gemini costs in Google Cloud Billing
Set up billing alerts for unexpected usage
Cache results for repeated URLs

🎛️ Customization Options
Modify Analysis Depth
Edit the "set_base_prompt" node to adjust:
Analysis detail level (basic vs comprehensive)
Focus areas (lighting, camera work, editing)
Output format (technical vs creative)
Industry-specific terminology
Add New Platforms
Extend the "switch_platform" node for:
YouTube Shorts
Facebook Reels
Twitter/X videos
LinkedIn videos
Alternative Output Methods
Replace Slack integration with:
Email notifications (SMTP node)
Discord webhooks
Database storage (PostgreSQL/MySQL)
Google Sheets logging
File exports to cloud storage
Enhanced Processing Features
Add nodes for:
Sentiment analysis of comments
Trend identification across videos
Competitive analysis reporting
Performance prediction modeling

🔒 Security & Privacy


API Key Protection
Store credentials securely in n8n
Use environment variables when possible
Regularly rotate API keys (quarterly)
Monitor API usage for anomalies
Data Privacy Compliance
Videos processed temporarily (not stored)
Respect platform terms of service
Honor content creator intellectual property
Implement data retention policies
Access Control
Limit form URL sharing
Use webhook authentication if needed
Monitor workflow execution logs
Set up failure notifications

📊 Success Metrics & Monitoring


Workflow Performance KPIs
Processing Time: Target 30-60 seconds per video
Success Rate: Aim for >95% completion rate
Analysis Quality: Detailed shot-by-shot breakdown
Error Rate: <5% API failures
Business Impact Tracking
Time saved vs manual analysis (typically 95% reduction)
Analysis depth improvement (10x more detailed)
Revenue generated from forensic insights
Client satisfaction scores
Monitoring Setup
Configure workflow execution alerts
Set up API cost monitoring
Track success/failure rates
Log common error patterns

💰 Pricing & Cost Breakdown


Monthly Cost Estimates
Small Scale (10-20 videos/month):
Apify: $0-20 (free tier covers most usage)
Gemini: $5-15 (depending on video length)
n8n: $20-40 (cloud hosting)
Total: $25-75/month
Medium Scale (100-200 videos/month):
Apify: $49-99 (paid plan required)
Gemini: $25-50
n8n: $20-40
Total: $95-190/month
Large Scale (500+ videos/month):
Apify: $199-499
Gemini: $75-150
n8n: $40-60
Total: $315-710/month
ROI Considerations
Manual analysis: 2-4 hours per video at $50-100/hour
Automated analysis: ~$1-3 per video
Savings: 95%+ cost reduction per analysis
Revenue potential: $5-15K per client analysis package

🚀 Getting Started Checklist


Pre-Launch Checklist
Apify account created and API token configured
Google Cloud account set up with Gemini API enabled
All credentials properly configured in n8n
Workflow imported and nodes connected
Test run completed successfully
Slack integration tested (if using)
Form URL bookmarked and accessible
First Week Actions
Test with 5-10 different video types
Monitor API usage and costs
Refine analysis prompts based on output quality
Document any platform-specific issues
Set up regular monitoring and alerts
Scaling Preparation
Identify target client niches
Develop pricing strategy for analysis services
Create sample analysis reports for sales
Set up automated reporting systems
Plan for increased API quotas

This workflow transforms viral video analysis from a manual, time-intensive process into an automated,
scalable system that delivers professional-grade insights in minutes rather than hours. With proper
setup and optimization, it becomes a powerful tool for content creators, marketers, and anyone looking
to understand and replicate viral video success patterns.
For additional support and updates, refer to the original workflow documentation and community
resources.

You might also like