Skip to main content

Youtube outlier detector (find trending content based on your competitors)

Workflow preview

Workflow preview
100%
Youtube outlier detector (find trending content based on your competitors) preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Video explanation This n8n workflow helps you identify trending videos within your niche by detecting outlier videos that significantly outperform a c...

Best for

  • Market Research automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.splitinbatches, n8n-nodes-base.httprequest, n8n-nodes-base.manualtrigger, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.postgres, n8n-nodes-base.youtube, n8n-nodes-base.if, n8n-nodes-base.code

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Leonardo Grigorio.

Original n8n.io source

1.1 Workflow description

Title
Youtube outlier detector (find trending content based on your competitors)
Workflow name
Youtube outlier detector (find trending content based on your competitors)

Video explanation

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.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 2 - find_video_data1

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 4 - Execute Workflow Trigger

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1

Block 5 - fetch_last_registered

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 6 - get_videos

Type / Role
n8n-nodes-base.youTube - youTube
Config choices
Version 1

Block 7 - if_is_empty

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 8 - Postgres

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 9 - insert_items

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 10 - create_table

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 11 - remove_shorts

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - create_query

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 13 - structure_data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 14 - if_empty

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 15 - already_populated

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 16 - map_data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 17 - sanitize_data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 18 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - see table

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

Block 21 - drop table

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.5

3. Summary Table

Workflow Youtube outlier detector (find trending content based on your competitors)
Complexity advanced
Nodes 21
Categories Market Research
Author Leonardo Grigorio
Published 14 Feb 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2903/2903.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Youtube outlier detector (find trending content based on your competitors) do?

Video explanation This n8n workflow helps you identify trending videos within your niche by detecting outlier videos that significantly outperform a c...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Market Research use case.