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.
Download this n8n workflow template and start using it instantly.
Generating complex AI images often involves long processing times, requiring an asynchronous approach (polling) rather than a simple single request. This powerful n8n workflow addresses this challenge by meticulously setting up the API call to Replicate, extracting the job ID, and continuously polling the status until the image generation is complete (status: 'succeeded'). This reliable n8n workflow ensures you capture the final image output, making it an essential n8n templates example for handling demanding AI tasks. The setup is simple: provide your prompt and API key, and the rest of the automation handles the complex polling logic using several standard n8n node elements.
This n8n workflow starts with the 'On clicking 'execute'' n8n trigger, designed for quick testing and manual runs.
POST request to the Replicate predictions API, initiating the Luma Photon Flash generation task. It passes the prompt and desired configuration settings.GET request to the extracted prediction URL, checking the current status of the job.To use this n8n workflow template, follow these steps:
YOURREPLICATEAPI_KEY with your actual Replicate API token.jsonBody to update the prompt value with your desired image description, and adjust parameters like seed or weight as needed. On clicking 'execute' (Manual Trigger): The starting n8n trigger for immediate execution, primarily used for testing and manual initiation of this n8n workflow.
Set API Key (Set Node): Used to securely define the replicateapikey variable, making it accessible as a bearer token in subsequent HTTP Request n8n node configurations.
Create Prediction (HTTP Request Node): Sends the initial POST request to Replicate, specifying the luma/photon-flash model and the input parameters (prompt, seed, weights).
Extract Prediction ID (Code Node): Crucial step that extracts the unique ID and constructs the necessary polling URL (predictionUrl) from the initial response body, enabling the asynchronous part of the n8n workflow.
Wait (Wait Node): Implements a 2-second delay between status checks, which is vital for preventing rate limiting during the polling phase of the n8n workflow.
Check Prediction Status (HTTP Request Node): The polling n8n node; it repeatedly calls the Replicate API using the prediction ID to fetch the current job status.
Check If Complete (IF Node): The core control flow n8n node, determining whether the workflow should proceed to 'Process Result' or loop back to 'Wait' based on whether the job status equals 'succeeded'.
Process Result (Code Node): Final processing n8n node that formats and extracts the generated image URL and cleanup metrics from the successful API response.
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 robust n8n workflow template to automate AI content generation via the Replicate API. Features dynamic polling, custom code scripting, and secure API key management.

Automate AI image generation using Replicate’s Creativeathive Lemaar Door Blurrred model. This powerful n8n workflow template handles asynchronous generation and status polling.

Automate AI content generation using the monexia/nietgoed model via Replicate. This n8n workflow template includes crucial polling logic and error handling for asynchronous tasks.

Deploy this powerful n8n workflow to automate DALL-E image generation via Telegram prompts, instantly logging results to Google Sheets. Learn how this n8n template streamlines AI resource management.

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







































