AI-Powered YouTube Metadata Generation using Mistral and Apify - n8n Workflow

Use this powerful n8n workflow to automatically generate optimized YouTube video metadata, including timestamps, tags, and descriptions, using LLM models like Mistral.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • YouTube content creators needing instant, high-quality metadata.

  • Developers looking for advanced n8n templates integrating scraping and AI.

  • Users who want to automate SEO tasks for video publishing.

  • Anyone utilizing n8n nodes for complex data manipulation and LLM interactions.

Overview

Manually crafting detailed video descriptions, precise timestamps, and optimized tags is time-consuming. This specific n8n workflow eliminates that manual effort. By acting as an advanced automation pipeline, it leverages an initial n8n trigger (new video RSS feed) to kick off a sequence that scrapes the video script using Apify. The core strength lies in using a Mistral Cloud LLM via a dedicated n8n node to analyze the full script and output perfectly formatted metadata (timestamps starting at 00:00, concise tags, and engaging preview text). This robust n8n automation ensures every new video is instantly equipped with high-quality SEO elements, boosting discoverability and viewer retention.

How it Works

This comprehensive n8n workflow follows a multi-step process from video publication to metadata update.


  1. Video Detection (n8n trigger): The process begins with the Trigger New Video Posted n8n trigger (RSS Feed Read Trigger), constantly monitoring a specified YouTube channel ID for new uploads.

  2. Recency Check: The If Recent n8n node ensures the workflow only processes videos published within the last 10 minutes, preventing unnecessary re-runs on old content.

  3. Script Scraping: The Scrape Video n8n node sends an HTTP request to Apify's YouTube scraper, initiating a run to download the video subtitles and script.

  4. Polling and Waiting: The Check IF Finished n8n node continuously polls the Apify run status. The If Finished n8n node checks if the status is SUCCEEDED. If not, the Wait n8n node enforces a pause before checking again, creating a resilient polling loop.

  5. Data Retrieval: Once scraping is complete, the Get DataSet n8n node retrieves the full script data from Apify.

  6. Metadata Generation Check: The If Not Generated n8n node verifies if the subtitles already contain metadata markers (like '00:00'). If they do not, the generation phase proceeds.

  7. AI Generation: The Generate Description n8n node, powered by the Mistral Cloud Chat Model and the Structured Output Parser n8n node, processes the video script. It strictly adheres to prompts to generate a structured JSON object containing the short preview, precise YouTube-style timestamps, and SEO tags.

  8. Output Formatting: The Format Code n8n node uses custom JavaScript to combine the generated description parts (preview, timestamps, plus hardcoded links) into the final description block.

  9. Final Update: The Update YTB Video YouTube n8n node uses the generated description and tags to update the newly posted video's metadata on YouTube, completing the n8n automation cycle.

Installation Guide

To use this powerful n8n workflow, follow these setup steps:


  1. Import: Copy the provided n8n workflow JSON and paste it into your n8n instance using the 'New' menu -> 'Import from JSON'.

  2. Apify Credentials: You must replace [YOURAPITOKEN] in the Scrape Video, Check IF Finished, and Get DataSet HTTP Request n8n nodes with your actual Apify API token.

  3. YouTube Channel ID: In the Trigger New Video Posted n8n trigger, replace [YOURCHANNELID] in the feed URL with the target YouTube Channel ID.

  4. Mistral Cloud Credential: Ensure the Mistral Cloud Chat Model n8n node is connected to a valid Mistral Cloud API credential.

  5. YouTube Credentials: Connect the Update YTB Video YouTube n8n node to your YouTube account via OAuth2, configuring the necessary API access (Google Cloud Console setup is required).

  6. Activate: Save and activate the n8n workflow to begin monitoring the channel for new videos.

Node Details

Trigger New Video Posted (RSS Feed Read Trigger n8n trigger): Monitors the YouTube RSS feed URL for new video entries based on the Channel ID. Key configuration: feedUrl targeting videos.xml?channelid=[YOURCHANNEL_ID].
Scrape Video (HTTP Request n8n node): Initiates the Apify scraper. Key configuration: method: POST, sending the video link dynamically using {{ $('Trigger New Video Posted').item.json.link }}.
If Finished (IF n8n node): Checks the Apify run status. Key configuration: Condition ={{ $json.data.status }} equals SUCCEEDED.
Get DataSet (HTTP Request n8n node): Retrieves the results (including the script/subtitles) from the successful Apify run.
If Not Generated (IF n8n node): Prevents reprocessing. Key configuration: Checks if the retrieved text content {{ $json.text }} does notContains '00:00'.
Mistral Cloud Chat Model & Structured Output Parser (LangChain n8n nodes): These n8n nodes configure the LLM behavior. The Structured Output Parser enforces the output schema for preview, timestamps, and tags.
Generate Description (Chain LLM n8n node): The core AI processing n8n node. It sends the video script ($json.subtitles[0].srt) to Mistral with strict formatting instructions for generating metadata.
Format (Code n8n node): Customizes the final description string by concatenating the AI-generated elements with predefined links.


  • Update YTB Video (YouTube n8n node): Final action. Updates the YouTube video metadata using dynamic data for tags (from AI output) and description (from the custom Code n8n node).

Related n8n Workflows

Free

Nodes: 11 Nodes
Updated: December 26 2025
View all
Created by

Data Engineer, now automating processes mostly with n8n, Make and code

Featured*