Use this robust n8n workflow template to automate AI content generation via the Replicate API. Features dynamic polling, custom code scripting, and secure API key management.
Download this n8n workflow template and start using it instantly.
This n8n workflow template is ideal for:
Developers needing to integrate asynchronous AI models (like Replicate) into backend processes.
Automation specialists seeking reusable n8n templates for API polling logic.
Users looking to utilize the creativeathive/lemaar-door-wm model directly within an n8n environment.
Engineers requiring a robust n8n workflow example for handling long-running external tasks.
Generating complex AI content, such as images or extended text, often involves asynchronous API calls, meaning the initial request returns immediately while the actual generation happens in the background. This sophisticated n8n workflow solves the complexity of managing this asynchronous process.
It initializes a job on Replicate using the specified AI model (creativeathive/lemaar-door-wm) and then enters a reliable polling loop. This loop, orchestrated using the Wait, HTTP Request, and If n8n node components, continuously checks the job status until completion. This specific n8n workflow ensures that you receive the final output only when the AI generation is successfully done, providing a stable foundation for integrating powerful AI capabilities into any larger n8n automation.
This n8n workflow is initiated by a manual n8n trigger and follows a multi-step execution logic focused on secure authentication and asynchronous API management:
POST request to the Replicate API to start the generation process for the creativeathive/lemaar-door-wm model, passing parameters like prompt, seed, width, and height.predictionId and the specific status URL returned by Replicate. This is vital for the polling sequence.To deploy this n8n workflow template:
replicateapikey assignment with your actual Replicate API key. Ensure this key is available as a bearer token for the subsequent HTTP Request n8n node configurations.prompt and other input parameters (width, height, lora_scale) for the AI model.This n8n workflow uses several critical nodes to achieve reliable asynchronous generation:
On clicking 'execute' (n8n trigger): The manual n8n trigger used to initiate the automation run.
Set API Key (Set n8n node): Essential for secure parameter management. It defines the replicateapikey variable used for authorization headers throughout the n8n workflow.
Create Prediction (HTTP Request n8n node): Submits the initial job to Replicate. Key Configuration: Uses POST method, specifies the creativeathive/lemaar-door-wm model version, and uses generic HTTP Header Authentication (Bearer {{ API Key }}).
Extract Prediction ID (Code n8n node): A custom n8n node that runs JavaScript to extract the id and constructs the polling URL (predictionUrl) for dynamic status checking.
Wait (Wait n8n node): Temporarily halts the n8n workflow execution for 2 seconds, preventing rate limiting during the polling phase.
Check Prediction Status (HTTP Request n8n node): Polls the dynamically created predictionUrl. Key Configuration: Uses GET method and the secure authorization header.
Check If Complete (If n8n node): Determines the flow path. Key Configuration: Checks if $json.status is strictly equal to succeeded.
Process Result (Code n8n node): A final custom n8n node that cleans up and structures the resulting data, making the output URLs readily accessible to subsequent steps in the n8n workflow.
Automate AI image generation using Replicate’s Creativeathive Lemaar Door Blurrred model. This powerful n8n workflow template handles asynchronous generation and status polling.

Use this dynamic n8n workflow to generate images or content using the jhonp4/jhonpiedrahita_ai01 Replicate model. Features a robust polling loop using n8n node logic.

Automate asynchronous AI content generation using the Izzaanel Betia model on Replicate. This n8n workflow template uses an HTTP request n8n node to handle prediction polling.

Use this comprehensive n8n workflow to automate asynchronous AI image or content generation using Replicate's API. This n8n template implements a robust polling loop for status checks.

Use this n8n workflow template to reliably generate high-quality images with the Luma Photon Flash AI model via Replicate. Features asynchronous polling logic for long-running tasks.

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







































