Youtube outlier detector (find trending content based on your competitors)
This n8n workflow helps you identify trending videos within your niche by detecting outlier videos that significantly outperform a channel's average views. It automates the process of monitoring competitor channels, saving time and streamlining content research.
Included in the Workflow
-
Automated Competitor Video Tracking Monitors videos from specified competitor channels, fetching data directly from the YouTube API.
-
Outlier Detection Based on Channel Averages Compares each videoโs performance against the channelโs historical average to identify significant spikes in viewership.
-
Historical Video Data Management Stores video statistics in a PostgreSQL database, allowing the workflow to only fetch new videos and optimize API usage.
-
Short Video Filtering Automatically removes short videos based on duration thresholds.
-
Flexible Video Retrieval Fetches up to 3 months of historical data on the first run and only new videos on subsequent runs.
-
PostgreSQL Database Integration Includes SQL queries for database setup, video insertion, and performance analysis.
-
Configurable Outlier Threshold Focuses on videos published within the last two weeks with view counts at least twice the channel's average.
-
Data Output for Analysis Outputs best-performing videos along with their engagement metrics, making it easier to identify trending topics.
Requirements
-
n8n installed on your machine or server
-
A valid YouTube Data API key
-
Access to a PostgreSQL database
This workflow is intended for educational and research purposes, helping content creators gain insights into what topics resonate with audiences without manual daily monitoring.
YouTube Outlier Detector: Find Trending Content Based on Your Competitors
This n8n workflow helps you identify YouTube videos that are performing exceptionally well (outliers) compared to other videos from a specified channel. It allows you to monitor competitor channels or your own for content that is quickly gaining traction, potentially indicating trending topics or successful content strategies.
What it does
- Triggers Manually: The workflow can be initiated manually by clicking "Execute workflow".
- Fetches YouTube Channel Videos: It retrieves a list of videos from a specified YouTube channel.
- Loops Through Videos: It processes each video individually to gather statistics.
- Calculates Outlier Metrics: It calculates a "score" for each video based on its views, likes, and comments, and then identifies videos that significantly deviate from the average.
- Stores Data in PostgreSQL: It inserts the details of these outlier videos into a PostgreSQL database.
- Conditional Logic: It includes an "If" node, though its specific conditions are not defined in the provided JSON, suggesting a placeholder for further filtering or branching logic.
- Prepares Data for Database: Uses a "Set" node to format the data before insertion into the database.
- Code Execution: Includes a "Code" node, which can be used for custom data manipulation or logic.
Prerequisites/Requirements
- n8n Instance: A running n8n instance.
- YouTube API Key: A Google Cloud Project with the YouTube Data API v3 enabled and an associated API key or OAuth 2.0 credentials.
- PostgreSQL Database: Access to a PostgreSQL database instance to store the detected outliers. You will need the connection details (host, port, database, user, password).
Setup/Usage
- Import the workflow: Import the provided JSON into your n8n instance.
- Configure YouTube Node:
- Select or create a new YouTube credential (OAuth 2.0 or API Key).
- Specify the YouTube channel ID or username you want to monitor.
- Configure the desired number of videos to fetch.
- Configure PostgreSQL Node:
- Select or create a new PostgreSQL credential.
- Provide your PostgreSQL database connection details.
- Ensure your database has a table structured to store the video information (e.g.,
video_id,title,views,likes,comments,score,is_outlier,channel_id,published_at).
- Configure "Edit Fields (Set)" Node: Review and adjust the fields being set to match your PostgreSQL table schema if necessary.
- Configure "Code" Node: If you have specific custom logic for calculating the outlier score or other data transformations, implement it within the "Code" node. The current JSON does not specify custom code, so this might be a placeholder.
- Configure "If" Node: Define the conditions in the "If" node to filter outliers based on your specific criteria (e.g.,
score > 2 * average_score). - Activate the workflow: Once configured, activate the workflow. You can then execute it manually using the "Manual Trigger" node.
This workflow provides a robust foundation for identifying high-performing YouTube content, which can be invaluable for content strategy, competitive analysis, and trend spotting.
Related Templates
Auto-create TikTok videos with VEED.io AI avatars, ElevenLabs & GPT-4
๐ฅ Viral TikTok Video Machine: Auto-Create Videos with Your AI Avatar --- ๐ฏ Who is this for? This workflow is for content creators, marketers, and agencies who want to use Veed.ioโs AI avatar technology to produce short, engaging TikTok videos automatically. Itโs ideal for creators who want to appear on camera without recording themselves, and for teams managing multiple brands who need to generate videos at scale. --- โ๏ธ What problem this workflow solves Manually creating videos for TikTok can take hours โ finding trends, writing scripts, recording, and editing. By combining Veed.io, ElevenLabs, and GPT-4, this workflow transforms a simple Telegram input into a ready-to-post TikTok video featuring your AI avatar powered by Veed.io โ speaking naturally with your cloned voice. --- ๐ What this workflow does This automation links Veed.ioโs video-generation API with multiple AI tools: Analyzes TikTok trends via Perplexity AI Writes a 10-second viral script using GPT-4 Generates your voiceover via ElevenLabs Uses Veed.io (Fabric 1.0 via FAL.ai) to animate your avatar and sync the lips to the voice Creates an engaging caption + hashtags for TikTok virality Publishes the video automatically via Blotato TikTok API Logs all results to Google Sheets for tracking --- ๐งฉ Setup Telegram Bot Create your bot via @BotFather Configure it as the trigger for sending your photo and theme Connect Veed.io Create an account on Veed.io Get your FAL.ai API key (Veed Fabric 1.0 model) Use HTTPS image/audio URLs compatible with Veed Fabric Other APIs Add Perplexity, ElevenLabs, and Blotato TikTok keys Connect your Google Sheet for logging results --- ๐ ๏ธ How to customize this workflow Change your Avatar: Upload a new image through Telegram, and Veed.io will generate a new talking version automatically. Modify the Script Style: Adjust the GPT prompt for tone (educational, funny, storytelling). Adjust Voice Tone: Tweak ElevenLabs stability and similarity settings. Expand Platforms: Add Instagram, YouTube Shorts, or X (Twitter) posting nodes. Track Performance: Customize your Google Sheet to measure your most successful Veed.io-based videos. --- ๐ง Expected Outcome In just a few seconds after sending your photo and theme, this workflow โ powered by Veed.io โ creates a fully automated TikTok video featuring your AI avatar with natural lip-sync and voice. The result is a continuous stream of viral short videos, made without cameras, editing, or effort. --- โ Import the JSON file in n8n, add your API keys (including Veed.io via FAL.ai), and start generating viral TikTok videos starring your AI avatar today! ๐ฅ Watch This Tutorial --- ๐ Documentation: Notion Guide Need help customizing? Contact me for consulting and support : Linkedin / Youtube
Generate song lyrics and music from text prompts using OpenAI and Fal.ai Minimax
Spark your creativity instantly in any chatโturn a simple prompt like "heartbreak ballad" into original, full-length lyrics and a professional AI-generated music track, all without leaving your conversation. ๐ What This Template Does This chat-triggered workflow harnesses AI to generate detailed, genre-matched song lyrics (at least 600 characters) from user messages, then queues them for music synthesis via Fal.ai's minimax-music model. It polls asynchronously until the track is ready, delivering lyrics and audio URL back in chat. Crafts original, structured lyrics with verses, choruses, and bridges using OpenAI Submits to Fal.ai for melody, instrumentation, and vocals aligned to the style Handles long-running generations with smart looping and status checks Returns complete song package (lyrics + audio link) for seamless sharing ๐ง Prerequisites n8n account (self-hosted or cloud with chat integration enabled) OpenAI account with API access for GPT models Fal.ai account for AI music generation ๐ Required Credentials OpenAI API Setup Go to platform.openai.com โ API keys (sidebar) Click "Create new secret key" โ Name it (e.g., "n8n Songwriter") Copy the key and add to n8n as "OpenAI API" credential type Test by sending a simple chat completion request Fal.ai HTTP Header Auth Setup Sign up at fal.ai โ Dashboard โ API Keys Generate a new API key โ Copy it In n8n, create "HTTP Header Auth" credential: Name="Fal.ai", Header Name="Authorization", Header Value="Key [Your API Key]" Test with a simple GET to their queue endpoint (e.g., /status) โ๏ธ Configuration Steps Import the workflow JSON into your n8n instance Assign OpenAI API credentials to the "OpenAI Chat Model" node Assign Fal.ai HTTP Header Auth to the "Generate Music Track", "Check Generation Status", and "Fetch Final Result" nodes Activate the workflowโchat trigger will appear in your n8n chat interface Test by messaging: "Create an upbeat pop song about road trips" ๐ฏ Use Cases Content Creators: YouTubers generating custom jingles for videos on the fly, streamlining production from idea to audio export Educators: Music teachers using chat prompts to create era-specific folk tunes for classroom discussions, fostering interactive learning Gift Personalization: Friends crafting anniversary R&B tracks from shared memories via quick chats, delivering emotional audio surprises Artist Brainstorming: Songwriters prototyping hip-hop beats in real-time during sessions, accelerating collaboration and iteration โ ๏ธ Troubleshooting Invalid JSON from AI Agent: Ensure the system prompt stresses valid JSON; test the agent standalone with a sample query Music Generation Fails (401/403): Verify Fal.ai API key has minimax-music access; check usage quotas in dashboard Status Polling Loops Indefinitely: Bump wait time to 45-60s for complex tracks; inspect fal.ai queue logs for bottlenecks Lyrics Under 600 Characters: Tweak agent prompt to enforce fuller structures like [V1][C][V2][B][C]; verify output length in executions
Automate Dutch Public Procurement Data Collection with TenderNed
TenderNed Public Procurement What This Workflow Does This workflow automates the collection of public procurement data from TenderNed (the official Dutch tender platform). It: Fetches the latest tender publications from the TenderNed API Retrieves detailed information in both XML and JSON formats for each tender Parses and extracts key information like organization names, titles, descriptions, and reference numbers Filters results based on your custom criteria Stores the data in a database for easy querying and analysis Setup Instructions This template comes with sticky notes providing step-by-step instructions in Dutch and various query options you can customize. Prerequisites TenderNed API Access - Register at TenderNed for API credentials Configuration Steps Set up TenderNed credentials: Add HTTP Basic Auth credentials with your TenderNed API username and password Apply these credentials to the three HTTP Request nodes: "Tenderned Publicaties" "Haal XML Details" "Haal JSON Details" Customize filters: Modify the "Filter op ..." node to match your specific requirements Examples: specific organizations, contract values, regions, etc. How It Works Step 1: Trigger The workflow can be triggered either manually for testing or automatically on a daily schedule. Step 2: Fetch Publications Makes an API call to TenderNed to retrieve a list of recent publications (up to 100 per request). Step 3: Process & Split Extracts the tender array from the response and splits it into individual items for processing. Step 4: Fetch Details For each tender, the workflow makes two parallel API calls: XML endpoint - Retrieves the complete tender documentation in XML format JSON endpoint - Fetches metadata including reference numbers and keywords Step 5: Parse & Merge Parses the XML data and merges it with the JSON metadata and batch information into a single data structure. Step 6: Extract Fields Maps the raw API data to clean, structured fields including: Publication ID and date Organization name Tender title and description Reference numbers (kenmerk, TED number) Step 7: Filter Applies your custom filter criteria to focus on relevant tenders only. Step 8: Store Inserts the processed data into your database for storage and future analysis. Customization Tips Modify API Parameters In the "Tenderned Publicaties" node, you can adjust: offset: Starting position for pagination size: Number of results per request (max 100) Add query parameters for date ranges, status filters, etc. Add More Fields Extend the "Splits Alle Velden" node to extract additional fields from the XML/JSON data, such as: Contract value estimates Deadline dates CPV codes (procurement classification) Contact information Integrate Notifications Add a Slack, Email, or Discord node after the filter to get notified about new matching tenders. Incremental Updates Modify the workflow to only fetch new tenders by: Storing the last execution timestamp Adding date filters to the API query Only processing publications newer than the last run Troubleshooting No data returned? Verify your TenderNed API credentials are correct Check that you have setup youre filter proper Need help setting this up or interested in a complete tender analysis solution? Get in touch ๐ LinkedIn โ Wessel Bulte