YouTube Engaging Moments Extractor API - n8n Workflow

Use this powerful n8n workflow to identify the most engaging moments in any YouTube video using replay data. Filter intensity peaks and expose results instantly via a custom n8n API endpoint, ideal for developers looking for high-utility n8n templates.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Content creators and video editors who need to quickly locate viral or highly replayed sections of their videos.
Developers building media analytics tools.
Users seeking high-performance n8n templates for data processing.
Anyone needing to implement a custom API using an n8n trigger and complex filtering logic.

Overview

Manually reviewing long YouTube videos to find the most captivating moments is time-consuming. This n8n workflow solves this by creating a simple API interface. When triggered with a YouTube Video ID (ytID), the workflow immediately queries an external service for 'most replayed' data, often visualized as the replay intensity curve.

The core value of this n8n node structure lies in its advanced data filtering. It not only extracts potential engaging moments but also cleans the data by enforcing a minimum intensity score (0.6) and preventing the reporting of moments that occur too close together (within 20 seconds). This sophisticated logic transforms raw intensity data into a curated list of actionable, engaging moments, delivered back to the caller instantly. This is a robust example of a custom API built using n8n.

How it Works

This n8n workflow operates as a streamlined API endpoint:


  1. Trigger (Webhook): The process starts with an activated n8n trigger (Webhook node) listening on a specific path (youtube-engaging-moments-extractor). It expects the YouTube ID via a query parameter (ytID).

  2. Input Variables: An n8n node (Set) extracts and sets the received ytID as the youtubeVideoID variable for subsequent steps.

  3. Data Fetching (HTTP Request): An HTTP Request n8n node calls an external API (yt.lemnoslife.com) to retrieve the 'mostReplayed' data for the specified video ID.

  4. Data Check (If): The has intensity data? If n8n node checks if replay markers exist. If not, the flow is diverted to the 'No results' response path.

  5. Splitting Markers (Split Out): If data is present, the Split Out n8n node separates the array of replay markers into individual items, allowing granular processing.

  6. Intensity Filtering (Filter): The workflow applies the first filter (intensity > 0.6), discarding any markers with a normalized intensity score below this threshold.

  7. Time Conversion (Set): The millisecs to seconds n8n node converts the marker start time from milliseconds to human-readable seconds.

  8. Proximity Filtering (Filter): The Filter out moments close to each other n8n node ensures quality by removing redundant peaks. It compares the current moment's start time with the next moment's start time, keeping only those separated by at least 20 seconds.

  9. Formatting Output (Set): The Create each moment (human readable) n8n node formats the filtered results, generating direct YouTube links that jump to the moment (minus 3 seconds for context).

  10. Aggregation (Aggregate): All individual items are collected and merged into a single array named engagingMoments.

  11. Response (Respond to Webhook): The final n8n node responds to the initial Webhook call with the structured JSON containing the list of engaging moments or the 'no results' payload.

Installation Guide

To use this n8n template, follow these steps:


  1. Import: Copy the entire JSON code provided and import it into your n8n instance via the 'Workflows' section, using the 'New' -> 'Import from JSON' option.

  2. External Credentials: This n8n workflow relies on an external, public YouTube data API and does not require credentials for the HTTP Request node.

  3. Activation and URL: Open the Webhook n8n node and copy the 'Production URL'. Ensure the workflow is set to 'Active'.

  4. Testing: Invoke the API using a tool like Postman, curl, or another n8n HTTP Request node. The required format is: {yourinstanceurl}/webhook/youtube-engaging-moments-extractor?ytID={youtubevideoid}. Replace {youtubevideoid} with the ID of the video you want to analyze.

Node Details

Webhook (n8n trigger): Serves as the API entry point. Configured with a path of youtube-engaging-moments-extractor and expects response to be handled by a later node.
HTTP Request (n8n node): Fetches replay data using a dynamic URL, incorporating the received youtubeVideoID.
If (n8n node): Provides essential core logic flow control, checking for the existence of intensity data ({{ $json.items[0].mostReplayed }}) before proceeding.
Split Out (n8n node): Splits the array of intensity markers (items[0].mostReplayed.markers) into individual items for filtering.
Filter (n8n node): Used twice. First, to ensure intensityScoreNormalized is greater than 0.6. Second, to implement complex data cleaning, ensuring moments are separated by more than 20 seconds, enhancing the quality of this n8n workflow.
Set (n8n node): Used for data manipulation, including converting milliseconds to seconds and creating human-readable direct YouTube links.
Aggregate (n8n node): Re-combines all processed, filtered items back into a single list named engagingMoments.
Respond to Webhook (n8n node): Handles the final API response, returning the success payload or the 'no results' message.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by
Max T
Max T

Featured*