AI Content Polling Workflow with Replicate API (paigedutcher2) - n8n Workflow

Automate AI content generation using this robust n8n workflow. Integrate the paigedutcher2/paigedutcher model via Replicate API, featuring status polling, error handling, and full customization. Start using these professional n8n templates today.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • AI Developers and ML Engineers needing to integrate the paigedutcher2 model into automated pipelines.

  • Users looking for advanced n8n templates featuring HTTP request polling logic.

  • Digital content creators seeking to mass-generate AI content reliably.

  • n8n automation specialists who need a production-ready template for external asynchronous API calls.

Overview

This powerful n8n workflow template provides a reliable method for executing computationally intensive, asynchronous AI generation tasks using the Replicate platform. The core challenge with such tasks is that the API returns a prediction ID immediately, and the generation process runs in the background. This n8n workflow solves this by implementing a robust polling loop. It initializes the generation request using a specific n8n node (HTTP Request), captures the prediction ID, and then continually checks the status until the job is completed or fails. This design ensures your n8n automation reliably waits for and retrieves the final output URL, making it an excellent example of utilizing an n8n node for advanced API interaction. By using this n8n template, you gain resilience, speed, and clear error reporting for your content generation needs.

How it Works

This n8n workflow begins execution with the Manual Trigger, which acts as the starting n8n trigger for the process.


  1. Setup: The workflow first runs the Set API Token and Set Other Parameters n8n nodes, configuring the necessary Replicate API credentials and input variables (like prompt, width, and height).

  2. Initiate Generation: The Create Other Prediction n8n node sends a POST request to Replicate, initiating the AI content creation and returning a unique prediction ID.

  3. Logging: The Log Request code n8n node records the prediction ID for auditing.

  4. Polling Mechanism: The n8n workflow enters a monitoring loop. It first pauses for 5 seconds (Wait 5s n8n node) and then uses the Check Status n8n node (HTTP Request) to query Replicate using the prediction ID.

  5. Conditional Check: The Is Complete? n8n node checks the returned status.

If the status is succeeded, the workflow branches to the success path and uses the Success Response n8n node to format the output, including the resulting content URL.
If the status is not succeeded, the workflow passes to the Has Failed? n8n node.

  1. Failure/Retry: The Has Failed? n8n node determines if the process stopped due to an error. If it failed, the Error Response n8n node structures the failure details. If it is still running (processing), the Wait 10s n8n node introduces a 10-second delay before looping back to the Check Status n8n node, ensuring efficient resource use while waiting for completion. This polling loop is a core feature of this n8n workflow.

  2. Finalization: Both success and error paths converge at the Display Result n8n node, finalizing the execution of this complex n8n workflow.

Installation Guide

To deploy this powerful n8n workflow template, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and import it into your n8n instance via the Workflows page.

  2. Set Replicate Credentials: Locate the Set API Token n8n node. Replace the placeholder value YOURREPLICATEAPI_TOKEN with your actual Replicate API key. This is essential for the n8n node to authenticate.

  3. Configure Inputs: Navigate to the Set Other Parameters n8n node. Here, you can customize the prompt, image URL, width, height, and other model-specific parameters necessary for the paigedutcher2 model.

  4. Activate and Test: Ensure the n8n workflow is set to 'Active' if you plan to use it via a webhook (though this example uses a manual n8n trigger). Click 'Execute Workflow' or use the Manual Trigger n8n trigger node to test the logic and ensure the HTTP requests are authorized correctly.

Node Details

This n8n workflow utilizes several key nodes to manage the asynchronous generation process:

Manual Trigger: This serves as the initial n8n trigger to start the generation process manually during testing or development.
Set API Token (n8n node): A Set n8n node used purely for securely injecting the required api_token into the workflow data stream, simplifying subsequent authentication calls.
Set Other Parameters (n8n node): Configures all necessary inputs for the AI model, including the core prompt, image masking URLs, and technical specifications like width and height.
Create Other Prediction (HTTP Request n8n node): This is the core action node. It sends a POST request to api.replicate.com to queue the generation job. It utilizes expressions to pass data from the configuration n8n nodes and uses the Bearer token for authorization.
Wait 5s / Wait 10s (n8n node): These Wait n8n nodes are essential for implementing the polling interval, preventing excessive API calls and managing rate limits during the asynchronous execution phase of this n8n workflow.
Check Status (HTTP Request n8n node): Periodically queries Replicate's API using the prediction ID to monitor the job status (starting, processing, succeeded, failed).
Is Complete? / Has Failed? (If n8n node): These critical If n8n nodes control the flow logic, ensuring the n8n workflow branches correctly upon completion or failure, forming a robust loop mechanism necessary for this n8n workflow template.
Success Response / Error Response (Set n8n node): Structures the final output data (URL or error details) into a clean JSON object for the subsequent step or final display.

Related n8n Workflows

Free

Nodes: 7 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*