Use this powerful n8n workflow to automate text-to-image generation via the Replicate API (izzaanel/betia model). Features robust status checking and error handling.
Download this n8n workflow template and start using it instantly.
Creative professionals needing automated batch image generation.
Developers integrating AI image generation into applications.
Technical users looking for advanced n8n templates utilizing polling logic.
Automation specialists seeking a production-ready Replicate integration within an n8n environment.
This production-ready n8n workflow provides a comprehensive solution for interacting with complex, asynchronous AI generation APIs like Replicate. The challenge with such APIs is that generation takes time, often requiring manual polling to retrieve the final result. This specific n8n workflow solves this by implementing an intelligent polling loop. It handles authentication, sets detailed generation parameters (prompt, dimensions, quality), initiates the prediction request, and then enters a loop using the Wait n8n node and If n8n node logic to constantly check the prediction status until it succeeds or fails. This complete automation guarantees reliability when running resource-intensive AI tasks, making it a valuable addition to your collection of n8n templates.
The process begins with the Manual Trigger n8n trigger, initiating the generation sequence.
Set API Token n8n node to securely define the necessary Replicate API key, followed by the Set Other Parameters n8n node, which configures inputs like the prompt, width, height, and other model specifics for the Betia model.Create Other Prediction HTTP Request n8n node sends a POST request to the Replicate API to start the AI generation process, returning an immediate Prediction ID.Log Request) records the request details, followed by a brief Wait 5s n8n node.Check Status HTTP Request n8n node repeatedly queries the Replicate API using the Prediction ID to fetch the current status.Is Complete? If n8n node determines the next step. If the status is 'succeeded', the flow moves to the Success Response n8n node.Has Failed?. If it hasn't failed (i.e., it's still processing), the workflow executes a Wait 10s n8n node and loops back to the Check Status n8n node to retry, creating a reliable polling mechanism. Success Response or Error Response n8n node, structuring the final result before displaying it in the Display Result n8n node.To deploy this powerful n8n workflow, follow these steps:
Set API Token n8n node. Update the value field, replacing YOURREPLICATEAPI_TOKEN with your actual token.Set Other Parameters n8n node. Adjust the prompt, width, height, and other optional inputs to customize the AI generation according to your needs. This n8n node is crucial for setting up the image generation request.Manual Trigger n8n trigger to run a test execution. Monitor the execution steps to confirm successful completion and retrieval of the generated image URL. Manual Trigger (n8n trigger):
Function: Initiates the entire n8n workflow execution, typically used for testing or manually starting processes.
Key Configuration: None (Standard manual execution).
Set API Token (n8n node):
Function: Safely stores the Replicate API Bearer Token for use in subsequent HTTP requests.
Key Configuration: Sets a string assignment named apitoken to the placeholder value.
Set Other Parameters (n8n node):
Function: Defines all necessary input variables (prompt, dimensions, image links) for the izzaanel/betia model.
Key Configuration: Assigns over 20 parameters, including prompt (default: 'Create something amazing'), width (512), and height (512).
Create Other Prediction (HTTP Request n8n node):
Function: Sends the initial request to the Replicate API to start the asynchronous AI generation task.
Key Configuration: Method POST, URL https://api.replicate.com/v1/predictions. Uses expressions to inject all parameters into the JSON body and sets the Authorization header using the previously stored API token (Bearer {{ $json.apitoken }}).
Wait 5s / Wait 10s (Wait n8n node):
Function: Used to introduce necessary delays in the polling loop, preventing excessive API calls and managing rate limits.
Key Configuration: Configured for 5 seconds and 10 seconds, respectively.
Check Status (HTTP Request n8n node):
Function: Repeatedly checks the status of the ongoing prediction using the ID returned from the creation step.
Key Configuration: Method GET, URL dynamically built using ={{ $json.id }}.
Is Complete? / Has Failed? (If n8n node):
Function: Core flow control logic. Checks the status field of the API response to route the flow based on whether the generation 'succeeded' or 'failed'.
Key Configuration: Conditions check if $json.status equals 'succeeded' or 'failed'.
Success Response / Error Response (Set n8n node):
Function: Structures the final output data (containing the result URL or error details) for easy consumption by the next steps in this n8n workflow.
Key Configuration: Creates a standardized JSON response object for successful (result_url) or failed (error) generations.
Use this robust n8n workflow to automate text-to-image generation via the Replicate API (Alitas2 model). Includes status polling, error handling, and fully customizable parameters.

Automate AI image generation using the Replicate API and powerful n8n workflow polling logic. This detailed guide covers setup, status checks, error handling, and customization for n8n templates.

Use this robust n8n workflow to automate AI content generation via the Replicate API's moicarmonas/2ndmoises_generator model, including asynchronous status polling and comprehensive error handling. This n8n template simplifies complex AI tasks.

Use this powerful n8n workflow template to automate AI image generation using the settyan/flash-v2.0.0-beta.10 model on Replicate. Features error handling and status polling.

Automate AI image and content generation using the powerful Flash V2.0.0 model via Replicate. This robust n8n workflow template includes intelligent status checking and error handling.

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







































