Trend-Based Marketing Video Generation Agent - n8n Workflow

Generate short-form marketing videos instantly using current viral trends. This automated n8n workflow combines Perplexity, GPT-4o, and Seedance AI for zero-touch content creation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Marketing Managers and Content Creators needing rapid, trend-aligned video content.
Founders and Small Business Owners looking to scale creative output without a design team.


  • Users looking for advanced AI agents within an n8n workflow environment.

Overview

This powerful n8n workflow transforms a simple text request into a ready-to-use marketing video by leveraging multiple AI services. It solves the critical challenge of generating timely, trend-relevant video content that performs well on platforms like TikTok and Instagram. The automation integrates a Telegram n8n trigger for simple input, an AI trend research agent (Perplexity) to ensure relevance, an AI prompt engineer (GPT-4o) for optimization, and the Seedance video generation API (via Wavespeed). This is a sophisticated n8n template demonstrating how complex multi-step processes, including conditional status checking and polling, can be seamlessly automated using n8n.

How it Works

This n8n workflow is designed as a fully autonomous AI agent pipeline:


  1. Start via n8n Trigger: The process begins when the user sends a request (e.g., “Create a 5-second IG ad for my new product”) to the Telegram n8n trigger.

  2. Trend Research Agent: The Telegram message is passed to the Perplexity n8n node, which acts as a Trend Research Agent. It scans the latest 14-day data to identify the most compelling, recent marketing trend relevant to the user's input.

  3. Video Prompt Engineering: The trend findings, along with the original user brief, flow into the OpenAI n8n node (Video Prompt Engineer), utilizing GPT-4o. This dedicated AI agent crafts a concise, visually descriptive prompt specifically optimized for the Seedance text-to-video model, ensuring the current trend is incorporated as the core concept.

  4. Video Generation Request: An HTTP Request n8n node (Post Request - Wavespeed) sends the AI-engineered prompt to the Seedance API, initiating the 5-second video creation process.

  5. Status Monitoring Loop: Due to the asynchronous nature of external video generation, the n8n workflow pauses for 30 seconds (Wait 30 Sec). It then begins a monitoring loop, repeatedly using a GET Request Wavespeed n8n node to check the processing status using the prediction ID.

  6. Conditional Flow Control: The If n8n node checks if the status is still 'processing'. If true, the workflow routes to another Wait 30 sec n8n node and loops back to check the status again. This is a crucial piece of core logic flow control within this n8n workflow.

  7. Final Delivery: Once the status is complete, the final video URL, extracted from the API response, is sent back to the user via a Telegram n8n node, completing the execution of this complex n8n template.

Installation Guide

To deploy this comprehensive n8n template, follow these steps:


  1. Import the Workflow: Import the provided n8n workflow JSON into your n8n instance.

  2. Credentials Setup: Configure the necessary credentials for each service used by the n8n node components:

Telegram API: Set up credentials for both the Telegram Trigger and the final Send a text message n8n node.
Perplexity API: Add your API key for the Trend Research Agent n8n node.
OpenAI API: Add your API key for the Video Prompt Engineer n8n node, allowing access to GPT-4o.
HTTP Header Auth: Configure the authentication for the Wavespeed/Seedance API, typically involving an API key passed in the Authorization header for both the POST and GET request n8n nodes.

  1. Activate: Ensure the Telegram n8n trigger webhook is properly set up and the entire n8n workflow is activated to begin accepting incoming requests.

Node Details

Telegram Trigger: Function: Initiates the entire n8n workflow. It acts as the primary user input mechanism for the automation. Key Configuration: Listens for incoming messages to trigger the automation.
Trend Research Agent (Perplexity): Function: Serves as an AI agent using the Sonar Pro model to search for highly relevant, recent marketing trends based on the input prompt. Key Configuration: Uses a strict system prompt to ensure trend insights are actionable for video concepts.
Video Prompt Engineer (OpenAI): Function: Utilizes the ChatGPT-4o model to engineer a concise and visually compelling video generation prompt by fusing the user's goal with the discovered trend. Key Configuration: System instructions strictly limit output to the raw video prompt itself, optimized for the Seedance API.
Post Request - Wavespeed (HTTP Request): Function: Sends the generated prompt to the Seedance API endpoint to start video rendering. Key Configuration: POST method, specifies a 5-second video duration, and dynamically injects the prompt from the previous n8n node.
Wait 30 Sec / Wait 30 sec (Wait): Function: Essential flow control n8n node used to pause the execution during the asynchronous video generation process.
GET Request Wavespeed (HTTP Request): Function: Polls the API to check the status of the generated video job. Key Configuration: Dynamic URL includes the job ID received in the previous POST request.
If: Function: Determines if the video is ready or still 'processing', managing the retry loop. This is a critical core logic flow control n8n node.
Send a text message (Telegram): Function: Final delivery mechanism, sending the completed video output URL back to the original user chat ID. Key Configuration: Dynamic reference to the chat ID captured by the Telegram n8n trigger.

Related n8n Workflows

Free

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

Automating Start-Up and Business processes. Helping non-techies understand and leverage Agentic AI with easy to understand step-by-step tutorials. Check out my educational content: https://www.youtube.com/@Automatewithmarc

Featured*