AI Image Generation with Settyan Flash (Replicate Polling Loop) - n8n Workflow

Learn how to use this n8n workflow to generate AI images using the Settyan Flash model via Replicate's API. Features custom polling logic, HTTP n8n node use, and robust status checking.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers needing reliable n8n templates for integrating long-running, asynchronous AI tasks. Users who want to leverage the powerful Settyan Flash V2.0.1 AI model directly within an n8n workflow. Automation specialists looking for technical examples of creating robust polling loops using the If and Wait n8n node combination. Anyone seeking a functional n8n template to automate generative AI content creation.

Overview

This powerful n8n workflow automates the process of generating content using the cutting-edge Settyan Flash V2.0.1 Beta.10 model hosted on Replicate. Because AI generation is an asynchronous, long-running process, this n8n workflow implements a crucial polling loop structure. It reliably initiates the request, extracts the unique prediction ID, waits a short interval, and continually checks the generation status until completion. This specific n8n template provides a reliable, scalable way to execute demanding AI tasks directly from your n8n environment, demonstrating best practices for integrating external asynchronous APIs using custom HTTP n8n node configurations. This ensures your n8n workflow doesn't timeout while waiting for the AI task to finish.

How it Works

The n8n workflow starts with the Manual n8n trigger, allowing easy execution and testing. First, the Set API Key n8n node securely injects your private Replicate API key into the workflow data. The Create Prediction HTTP Request n8n node then sends a POST request to Replicate, initiating the AI generation process using the Settyan Flash model and specific input parameters like prompt, seed, and dimensions. The API responds immediately with a prediction ID.

Next, the Extract Prediction ID Code n8n node parses this initial response, pulling out the prediction ID and constructing the required polling URL. The flow then enters a polling loop managed by the Wait n8n node (set to 2 seconds). The Check Prediction Status HTTP Request n8n node repeatedly polls the Replicate API using the prediction URL.

Finally, the Check If Complete If n8n node determines the flow's path. If the prediction status is 'succeeded,' the n8n workflow exits the loop and passes the results to the Process Result Code n8n node for final data extraction (the generated images). If the status is anything else, the n8n node directs the flow back to the Wait n8n node to continue polling.

Installation Guide


  1. Import the provided n8n workflow JSON into your n8n instance using the Import Workflow button.

  2. Locate the Set API Key n8n node. You must replace the placeholder value (YOURREPLICATEAPI_KEY) with your actual Replicate API key. This key is used by subsequent HTTP n8n node steps.

  3. Examine the Create Prediction HTTP Request n8n node. Customize the JSON input body, especially the prompt value, to define the image you wish to generate. Adjust technical parameters like seed, width, and height as needed for the Settyan model.

  4. Ensure that all HTTP Request n8n node steps use the Generic Auth method configured to pass the API key (retrieved from the Set API Key n8n node) as a Bearer token in the Authorization header.

  5. Execute the n8n workflow manually using the Manual n8n trigger to test the generation process.

Node Details

On clicking 'execute' (Manual n8n Trigger): Serves as the initiation point for this n8n workflow, ideal for testing and simple deployment. This standard n8n trigger starts the process. Set API Key (Set n8n node): Function: A core n8n node used to define and store the replicateapikey variable securely for dynamic use in subsequent authentication headers. Create Prediction (HTTP Request n8n node): Function: Initiates the AI image generation by sending a POST request to the Replicate API endpoint, specifying the settyan/flash-v2.0.1-beta.10 version ID. Key Configuration: Uses JSON body to pass prompt and generation settings; utilizes Generic Authentication via a Bearer token derived from the Set API Key n8n node output. Extract Prediction ID (Code n8n node): Function: A custom n8n node that processes the API response, extracting the asynchronous task id and calculating the precise URL needed for the polling steps. Wait (Wait n8n node): Function: Creates a 2-second pause in the n8n workflow, controlling the polling rate to avoid hitting API limits while waiting for the AI task completion. Check Prediction Status (HTTP Request n8n node): Function: Repeatedly sends GET requests to the prediction URL to fetch the current status of the AI task, essential for this n8n workflow’s success. Check If Complete (If n8n node): Function: Implements the conditional logic of the polling loop. It checks if the status is succeeded. If false, it loops back to the Wait n8n node. Process Result (Code n8n node): Function: Final data processing n8n node that runs upon success, cleanly extracting the generated image URLs and relevant creation metadata for downstream use.

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*