Use this powerful n8n workflow template to automate AI image generation using the Replicate API and the paigedutcher2/paige model. Learn robust status polling using the n8n node structure.
Download this n8n workflow template and start using it instantly.
Handling asynchronous APIs—like those used in complex AI generation—requires robust status checking. This powerful n8n workflow template solves this challenge by implementing a complete status polling loop for the Replicate API.
This specific n8n workflow is designed to interact with the paigedutcher2/paige model, known for stylized image generation. The automation begins by securely setting the Replicate API token and configuring over 20 detailed generation parameters (prompt, seed, dimensions, etc.). It then sends the initial prediction request. Because AI image generation takes time, the n8n node structure includes a dedicated polling mechanism using Wait and If nodes to periodically check the prediction status until it is successfully completed or fails. This comprehensive approach ensures that every request is tracked and results are provided in a structured JSON response, making this an ideal, production-ready n8n template for AI automation.
The automated process starts with the Manual Trigger n8n node, initiating the generation process instantly upon request.
Set n8n node steps: one to securely load the Replicate API token and another to define all necessary AI generation parameters (such as prompt, width, height, and model version) which are later passed to the HTTP Request n8n node.Create Other Prediction HTTP Request n8n node sends a POST request to Replicate’s prediction endpoint. This action is asynchronous, meaning it returns an ID immediately, and the prediction begins in the background.Code n8n node logs the request details, followed by a Wait 5s n8n node to give the service time to start processing.Check Status HTTP Request n8n node uses the prediction ID to GET the current status from Replicate. Is Complete? If n8n node checks if the status equals 'succeeded'. If true, the workflow proceeds to the Success Response n8n node.Has Failed? If n8n node. If failed, it moves to Error Response. If neither succeeded nor failed (meaning it is still processing), it waits 10 seconds via the Wait 10s n8n node and loops back to the Check Status n8n node to re-poll.Display Result n8n node.To implement this powerful n8n workflow, follow these steps:
YOURREPLICATEAPI_TOKEN with your actual token obtained from Replicate (https://replicate.com/account/api-tokens).prompt, image URL (for image-to-image tasks), width, and other detailed settings for the paigedutcher2/paige model.Manual Trigger n8n trigger to execute the workflow manually and confirm that the API connection and polling logic function correctly. This reliable n8n workflow utilizes several key n8n node types for flow control and API interaction:
Manual Trigger (n8n trigger): Serves as the starting point for manual testing and execution of the n8n workflow.
Set API Token (Set n8n node): Essential for security, this node stores the Replicate API Bearer token, which is referenced by subsequent HTTP Request n8n nodes.
Set Other Parameters (Set n8n node): Configures all input parameters (like prompt, seed, aspect_ratio) for the AI model using expressions referencing data passed from previous nodes.
Create Other Prediction (HTTP Request n8n node): This core n8n node sends the asynchronous POST request to the Replicate API to start the image generation. It uses dynamic JSON body data mapped from the 'Set Other Parameters' n8n node.
Log Request (Code n8n node): A utility n8n node that logs generation details to the console for monitoring and debugging purposes, a great feature for production-ready n8n templates.
Wait 5s / Wait 10s (Wait n8n node): Controls the pacing of the polling loop, ensuring the workflow doesn't overwhelm the API with status checks.
Check Status (HTTP Request n8n node): This n8n node continuously polls the API using the prediction ID to retrieve the job's status.
Is Complete? / Has Failed? (If n8n node): These conditional n8n nodes manage the polling logic, routing the flow based on the returned status ('succeeded', 'failed', or 'processing').
Leverage this powerful n8n workflow to build a Spotify chat agent using GPT-4. Create custom playlists, control playback (pause, skip), and search tracks automatically using dedicated n8n templates.

Use this efficient n8n workflow to automatically generate highly personalized sales emails (subject and body) for leads stored in Google Sheets using the power of the Google Gemini AI model. Explore more n8n templates for AI operations.

Automate personalized news digests using GPT-5.1, SerpAPI, and n8n Data Tables. This robust n8n workflow filters novel articles and delivers them via Telegram.

Use this robust n8n workflow template to automate the creation of portrait image series from a single input using the Replicate API. Features resilient polling and error handling.

Build a dynamic product satisfaction survey using this complex n8n workflow. It integrates Telegram, Google Sheets, Redis, and OpenAI/LangChain agents to ask follow-up questions for deeper insights.

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







































