Replicate AI Content Generation and Asynchronous Polling - n8n Workflow

Automate AI content generation using the settyan/flash-v2.0.0-beta.1 Replicate model. This reliable n8n workflow uses intelligent polling logic and flow control for guaranteed results.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • AI developers needing to integrate complex generation models like settyan/flash-v2.0.0-beta.1 into backend processes.

  • Automation engineers looking for a reliable n8n workflow template for asynchronous API handling.

  • Users wanting to generate images or other AI assets using Replicate without custom coding the polling logic.

  • Technical users seeking advanced n8n node flow control examples.

Overview

Integrating high-compute AI models often means dealing with asynchronous APIs—you request a job, and you must periodically check its status. This expert n8n workflow solves this complexity by providing a ready-to-use Replicate integration, specifically targeting the settyan/flash-v2.0.0-beta.1 model. The core value of this n8n template lies in its robust flow control, which initiates the generation, waits, and then implements a smart polling loop using the n8n node structure to monitor the prediction status until completion or failure. This ensures that your overall n8n automation pipeline waits correctly and handles success or error states gracefully, making it a highly reliable n8n solution for production environments.

How it Works

The process begins with the Manual Trigger n8n trigger, allowing for immediate execution. First, the crucial API authentication token is set in an n8n node. Subsequently, the 'Set Other Parameters' n8n node configures all inputs for the AI model, including the core prompt, image dimensions, and advanced settings like guidance_scale.

The 'Create Other Prediction' HTTP Request n8n node sends the generation job to the Replicate API, receiving an immediate prediction ID. The workflow then logs this request details using a Code n8n node.

To handle the asynchronous nature of the prediction, the n8n workflow enters a polling sequence. It first executes a 'Wait 5s' n8n node, followed by the 'Check Status' HTTP Request n8n node, which queries the prediction endpoint using the acquired ID.

The 'Is Complete?' If n8n node determines the flow path:


  1. Success: If the status is 'succeeded', the workflow proceeds to 'Success Response' to return the generated asset URL.

  2. Incomplete/Processing: If the status is neither 'succeeded' nor 'failed', the workflow continues through the 'Has Failed?' n8n node's false path, leading to 'Wait 10s', and then loops back to 'Check Status'.

  3. Failure: If the status is 'failed', the 'Has Failed?' If n8n node routes the execution to 'Error Response'.

Finally, the results are collected and displayed by the 'Display Result' n8n node.

Installation Guide


  1. Import the n8n Workflow: Copy the provided JSON data and import it directly into your n8n instance via the 'New' menu > 'Import from JSON'. This immediately loads the complete n8n workflow template.

  2. Configure Credentials: Locate the 'Set API Token' n8n node. Replace the placeholder value YOURREPLICATEAPI_TOKEN with your actual Replicate API key. This token is required for the HTTP Request n8n nodes to communicate with the Replicate API.

  3. Adjust Parameters: Navigate to the 'Set Other Parameters' n8n node. Review and modify the prompt and other generation parameters (like width, height, or megapixels) to fit your specific AI generation needs.

  4. Execute: Use the 'Manual Trigger' n8n trigger to test the automation. Ensure the workflow is activated when ready for production use.

Node Details

Manual Trigger (n8n trigger): Initiates the n8n workflow execution manually, primarily used for testing and immediate generation requests.
Set API Token (n8n node): Essential configuration step. It assigns the required Replicate API Bearer token, which is dynamically referenced by subsequent HTTP Request n8n nodes for authorization.
Set Other Parameters (n8n node): Defines all input parameters for the settyan/flash-v2.0.0-beta.1 model on Replicate, including the core generation prompt, dimensions, and technical settings. This n8n node centralizes customization.
Create Other Prediction (HTTP Request n8n node): Sends the initial POST request to https://api.replicate.com/v1/predictions. Key configuration includes passing all parameters defined in the previous n8n node within the JSON body and setting the Authorization header using the API token.
Wait 5s and Wait 10s (Wait n8n node): Implements time delays necessary for asynchronous polling. The initial 5-second wait allows the Replicate job to start, while the 10-second wait controls the frequency of checks within the polling loop.
Check Status (HTTP Request n8n node): Queries the Replicate API using the unique prediction ID returned from the 'Create Other Prediction' n8n node to fetch the current status of the AI generation job.


  • Is Complete? & Has Failed? (If n8n node): These flow control n8n node components manage the polling logic. They check the received status ('succeeded' or 'failed') to determine whether to exit the loop and process results, or to wait and retry checking the status.

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*