UGC Video Generation via Replicate API Polling - n8n Workflow

Use this comprehensive n8n workflow to automate high-quality image-to-video generation using the Wan 2.5 model on Replicate. Features smart polling logic and robust error handling.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Marketing agencies and content creators needing to scale video content production quickly.

  • Developers looking for a reliable n8n template for asynchronous API polling.

  • Businesses seeking to turn static product images into dynamic, user-generated content (UGC)-style videos.

  • Users familiar with n8n and external AI services like Replicate.

Overview

Generating high-fidelity videos using AI models like Wan 2.5 is often an asynchronous process, requiring status checks (polling) until the output is ready. This efficient n8n workflow solves this complexity entirely. It manages the entire process: taking a seed image and detailed prompt, initiating the video creation via the Replicate API, and implementing a robust checking loop. By using this n8n template, you eliminate the need to manually monitor API calls. The workflow handles success, failure, and the necessary waiting periods, returning a clean JSON object containing the final video URL or detailed error messages. This is an essential n8n workflow for scaling AI-driven media creation.

How it Works

This powerful n8n workflow begins when the 'Manual Trigger' n8n trigger is activated.


  1. Configuration: The workflow first runs the 'Set API Token' n8n node to securely define the Replicate API key. Next, the 'Add Seed Image and Prompt' n8n node sets the critical inputs—the input image URL and the motion prompt—required for the AI model.

  2. Request Initiation: The 'Create Video' HTTP Request n8n node sends a POST request to the Replicate wan-video/wan-2.5-i2v model endpoint. This initial request starts the video generation and returns a unique prediction ID.

  3. Logging: The 'Log Request' n8n node records the prediction ID for monitoring and debugging purposes.

  4. Polling Loop Initialization: The workflow immediately executes a short 'Wait 5s' n8n node, followed by the 'Check Status' HTTP Request n8n node, which uses the received prediction ID to check the status on the Replicate platform.

  5. Status Check: The 'Is Complete?' IF n8n node evaluates the API response status. If the status is 'succeeded', the workflow proceeds to 'Success Response'.

  6. Failure and Polling: If not successful, the 'Has Failed?' IF n8n node checks for a 'failed' status. If failed, it routes to 'Error Response'. If neither succeeded nor failed (meaning it's still running, like 'processing' or 'starting'), the workflow routes to 'Wait 90s' before looping back to 'Check Status', implementing a sophisticated polling mechanism.

  7. Final Output: Both 'Success Response' and 'Error Response' n8n nodes format the final result into a clean, structured JSON object, which is then passed to the 'Display Result' n8n node for the user to consume.

Installation Guide

To use this video generation n8n workflow, follow these setup steps:


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

  2. Acquire Replicate API Key: Sign up or log in to Replicate and obtain your API token from your account settings.

  3. Configure API Credentials:

Locate the 'Set API Token' n8n node.
Replace the placeholder YOURREPLICATEAPI value with your actual Replicate API token.

  1. Define Inputs:

Navigate to the 'Add Seed Image and Prompt' n8n node.
Update the Seed_image value with the publicly accessible URL of the image you wish to animate.
* Customize the Prompt value with detailed instructions for the video's motion and action (avoiding double quotes to prevent JSON parsing issues).

  1. Execution: Click on the 'Manual Trigger' n8n trigger and execute the full n8n workflow to initiate video generation.

Node Details

Manual Trigger (n8n trigger): Starts the execution of this specific n8n workflow, ideal for testing and single-run generations.
Set API Token (n8n node): Essential configuration node for storing the Replicate API key, used dynamically by subsequent HTTP Request nodes.
Add Seed Image and Prompt (n8n node): A Set node used to define the core inputs (Seed_image URL and detailed Prompt) that drive the AI video generation.
Create Video (HTTP Request n8n node): Sends the initial generation request to wan-video/wan-2.5-i2v. Key configuration includes setting the Authorization header using the API token and specifying the input image and prompt in the JSON body.
Check Status (HTTP Request n8n node): Polls the Replicate API using prediction ID interpolation: https://api.replicate.com/v1/predictions/{{ $('Create Video').item.json.id }}. It is crucial for retrieving the video output status.
Is Complete? (IF n8n node): Core flow control logic. Checks if $json.status equals 'succeeded' to determine if the video is ready.
Has Failed? (IF n8n node): Checks if $json.status equals 'failed', directing the n8n workflow to error handling if the generation failed.
Wait 90s (n8n node): Implements the necessary delay in the polling loop when the video is still processing, preventing excessive API calls.


  • Success Response / Error Response (Set n8n nodes): Formats the final results. The 'Success Response' n8n node specifically extracts the final video URL from the $json.output field.

Related n8n Workflows

Free

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

Building AI Agents and Automations | Growth Marketer | Entrepreneur | Book Author & Podcast Host If you need any help with Automations, feel free to reach out via linkedin: https://www.linkedin.com/in/yaronbeen/ And check out my Youtube channel: https://www.youtube.com/@YaronBeen/videos

Featured*