Flash AI Image Generation Polling Automation via Replicate - n8n Workflow

Use this robust n8n workflow to automate text-to-image generation with the Replicate API and Flash v2.0.0. Features polling logic and detailed error handling using n8n nodes.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  1. Developers needing an automated text-to-image n8n solution.

  2. Users looking for production-ready n8n templates for asynchronous AI tasks.

  3. Engineers who require reliable status tracking within an n8n workflow for generative processes.

  4. Businesses integrating settyan/flash-v2.0.0-beta.7 into their product pipeline using n8n.

Overview

This specialized n8n template provides a complete automation pipeline for initiating, monitoring, and retrieving results from the Replicate API, specifically utilizing the powerful settyan/flash-v2.0.0-beta.7 model. Unlike simple request nodes, this n8n workflow implements crucial asynchronous logic. Because AI generation tasks often require extended processing time, the n8n node sequence handles the initial request, waits, and then implements a robust polling loop to continually check the status until the generation is complete or fails. This makes it a reliable and production-ready n8n automation solution for integrating powerful generative AI capabilities directly into your applications or internal processes. This structure demonstrates best practices for handling long-running operations in n8n.

How it Works


  1. The process is initiated by the Manual Trigger, which serves as the primary n8n trigger for starting the automation.

  2. The Set API Token n8n node configures the necessary Replicate authentication credentials, ensuring secure access to the service.

  3. The Set Other Parameters n8n node defines all required generation inputs, such as the prompt, desired dimensions (width, height), and other model-specific settings.

  4. The Create Other Prediction n8n node (an HTTP Request) sends a POST request to the Replicate API to start the generation task, immediately receiving a prediction ID.

  5. The n8n workflow then performs a brief 5-second wait, followed by internal logging via the Log Request n8n node.

  6. The core polling mechanism begins: the Check Status n8n node (another HTTP Request) uses the prediction ID to repeatedly query the result status.

  7. The Is Complete? n8n node checks if the status is explicitly 'succeeded'. If true, the flow proceeds to the Success Response n8n node.

  8. If not complete, the Has Failed? n8n node checks for a 'failed' status. If failed, it moves to the Error Response node.

  9. If the status is neither 'succeeded' nor 'failed' (meaning it is still processing), the n8n workflow delays for 10 seconds using the Wait 10s n8n node and then loops back to Check Status. This creates a reliable, self-adjusting polling mechanism until the AI task is finished.

Installation Guide


  1. Import the n8n workflow: Copy the provided JSON data. In your n8n instance, navigate to the Workflows section, click "+ New", and select "Import from JSON". Paste the content and save this ready-to-use n8n template.

  2. Configure Credentials: Locate the Set API Token n8n node. You must replace the placeholder YOURREPLICATEAPI_TOKEN with your actual Replicate API token. This step is essential for the n8n workflow to successfully authenticate with the AI service.

  3. Customize Parameters: Navigate to the Set Other Parameters n8n node to adjust core inputs like the desired image prompt, model configuration, and output resolution to meet your specific generation requirements. This n8n node centralizes all input customization.

  4. Activate and Test: Activate the n8n workflow. Click "Execute Workflow" or use the Manual Trigger n8n trigger to initiate a test run and verify that the polling loop correctly handles the asynchronous nature of the AI generation.

Node Details

Manual Trigger (n8n trigger): The starting point used to manually execute this n8n workflow for testing or immediate operation.
Set API Token (Set n8n node): Essential for security, this node stores and makes the Replicate Bearer Token available for subsequent API calls.
Set Other Parameters (Set n8n node): Configures all input parameters for the settyan/flash model, including the core generation prompt, width, height, and other advanced settings like guidance_scale.
Create Other Prediction (HTTP Request n8n node): Sends the initial POST request to the Replicate predictions endpoint, beginning the image generation job and returning a unique prediction ID.
Check Status (HTTP Request n8n node): Crucial for the polling loop, this n8n node repeatedly queries the API using the prediction ID to monitor the job's progress.
Is Complete? / Has Failed? (If n8n node): These flow control nodes manage the branching logic, routing the n8n workflow based on whether the AI job status is 'succeeded', 'failed', or still 'processing'.
Wait 5s / Wait 10s (Wait n8n node): These nodes introduce necessary delays in the n8n workflow, managing the polling frequency to prevent unnecessary rate limiting while waiting for the long-running AI task to finish.
Success Response / Error Response (Set n8n node): These nodes structure the final output, providing a clean JSON response containing either the result URL or detailed error messages from the Replicate API.

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*