Image Generation with Settyan Flash AI and Replicate - n8n Workflow

Use this robust n8n workflow to generate images asynchronously via the Settyan Flash V2.0.0 Beta.9 model on Replicate, complete with built-in polling.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Developers building applications that require programmatic AI image generation.
Technical users looking for advanced n8n templates integrating external AI APIs.
Automation specialists who need a reliable n8n workflow pattern for long-running tasks like image creation.
Anyone leveraging the Replicate API for creative AI outputs.

Overview

Generating complex AI content often involves long processing times, requiring an asynchronous pattern where the automation starts a task and periodically checks for completion. This specialized n8n workflow solves this by implementing a robust polling mechanism for the Replicate API, specifically utilizing the Settyan Flash V2.0.0 Beta.9 model.

The core value provided by this n8n template is reliable generation. Instead of waiting indefinitely or timing out, the n8n node configuration systematically initiates the image generation process, extracts the job ID, pauses briefly, and enters a loop until the prediction status reports 'succeeded'. This ensures that your automation reliably captures the final generated image URL and output metadata, making this a powerful example of what a custom n8n workflow can achieve for AI automation.

How it Works

This automation follows a clear five-step process, starting with an n8n trigger and concluding with the generated output:


  1. Trigger and Setup: The workflow starts manually using the 'On clicking execute' n8n trigger. Immediately after, the 'Set API Key' n8n node securely stores your Replicate API key, preparing it for authorization.

  2. Start Prediction: The 'Create Prediction' n8n node sends an authenticated POST request to the Replicate API, specifying the required model (settyan/flash-v2.0.0-beta.9) and input parameters (prompt, seed, dimensions).

  3. Initialize Polling: The 'Extract Prediction ID' n8n node processes the API response to capture the unique prediction ID and construct the URL necessary for status checking.

  4. Polling Loop: The workflow enters a loop starting with the 'Wait' n8n node (2-second delay). The 'Check Prediction Status' n8n node then polls the Replicate API using the prediction URL.

  5. Status Check and Completion: The 'Check If Complete' n8n node evaluates the status. If the status is 'succeeded', the workflow proceeds to 'Process Result' to finalize the data. If the status is anything else (e.g., 'processing'), the n8n workflow loops back to the 'Wait' n8n node to pause and recheck, ensuring eventual completion.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Download the provided JSON file and import it directly into your n8n instance using the 'Workflows' tab > 'New' > 'Import from JSON'.

  2. Replicate API Key: Open the 'Set API Key' n8n node. Replace the placeholder value YOURREPLICATEAPI_KEY with your actual token from the Replicate platform.

  3. Configure Credentials: Ensure your Create Prediction and Check Prediction Status n8n node settings utilize a Generic HTTP Header Auth credential type if needed, passing the API key correctly in the Authorization header as 'Bearer [Key]'. The current n8n templates configuration uses an expression pulling the key from the previous 'Set' node.

  4. Customize Input: Open the 'Create Prediction' n8n node to customize the jsonBody parameters, specifically the prompt, width, and height, tailoring the AI generation to your specific needs.

  5. Activation: Set the n8n workflow to 'Active' or click 'Execute Workflow' manually to test the generation process.

Node Details

On clicking 'execute' (Manual Trigger): Serves as the initial n8n trigger for starting the image generation process on demand.
Set API Key (Set n8n node): A crucial setup step. It defines and stores the replicateapikey securely, which is then dynamically accessed by subsequent HTTP Request n8n node instances.
Create Prediction (HTTP Request n8n node): Initiates the long-running task. It sends the AI generation parameters (prompt, seed, model version: 3053b0f8f3cff9282f18eb7782feb7b8d8b2e8dffb256d316cab1225a2cf3dad) to the Replicate API endpoint.
Extract Prediction ID (Code n8n node): Custom code that handles the asynchronous nature of the task. It extracts the unique id returned by the Replicate API and prepares the necessary polling URL for the subsequent status checks.
Wait (Wait n8n node): Controls the polling frequency, pausing the n8n workflow for 2 seconds to manage API usage and resource consumption.
Check Prediction Status (HTTP Request n8n node): This node is key to the polling loop. It repeatedly checks the status of the generated job until completion.
Check If Complete (IF n8n node): The flow control mechanism. It checks if the status payload from Replicate is equal to 'succeeded'. If true, the n8n workflow moves to the result processing; otherwise, it returns to the 'Wait' node.
Process Result (Code n8n node): The final step of this n8n workflow. It formats and returns the key output data, including the resulting image URL (output) and timing metrics, signaling the successful completion of the AI task.

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*