Simbrams Ri AI Image Generation with Asynchronous Polling - n8n Workflow

Use this efficient n8n workflow to generate high-quality images and handle asynchronous polling using the Simbrams Ri AI model via Replicate. A reliable n8n template for complex AI tasks.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Automation engineers building custom AI services that require reliable status checks in an n8n workflow.

  • Users needing a resilient n8n template for integrating high-latency or GPU-dependent services.

  • Developers exploring advanced image generation n8n nodes and asynchronous pattern handling.

  • Teams leveraging the power of n8n to manage Replicate API interactions.

Overview

Generating large images or running complex AI models like Simbrams Ri often takes time, meaning the initial API call only returns a job ID, not the result. This advanced n8n workflow demonstrates how to efficiently manage these asynchronous tasks.

The n8n workflow implements a crucial polling loop. After initiating the image generation request using an n8n node, the automation pauses and then repeatedly checks the job status until the task is marked 'succeeded'. This pattern ensures that your n8n automation reliably captures the final high-resolution image output, providing a robust and reusable n8n template for any similar AI integration.

How it Works

This n8n workflow is designed to manage the complexity of asynchronous AI processing from start to finish.


  1. Start Execution: The n8n workflow is initiated manually using the 'On clicking 'execute'' n8n trigger.

  2. Authentication: The 'Set API Key' n8n node securely stores the Replicate API key, which is then used as a Bearer token for subsequent HTTP requests.

  3. Create Prediction: The first 'Create Prediction' n8n node sends a POST request to Replicate's API, kicking off the image generation task using the Simbrams Ri model with specific input parameters (image, mask, strength, etc.).

  4. Extract ID: The 'Extract Prediction ID' custom code n8n node parses the initial response to extract the unique prediction ID and constructs the URL required for status checking.

  5. Wait and Poll: The n8n workflow enters the polling loop, starting with a 2-second 'Wait' n8n node to pause execution.

  6. Check Status: The 'Check Prediction Status' n8n node performs a GET request to the prediction URL to retrieve the current status of the job.

  7. Loop Control: The 'Check If Complete' If n8n node checks if the job status equals 'succeeded'.

  8. Completion: If the status is not 'succeeded', the n8n workflow loops back to the 'Wait' n8n node. If 'succeeded', execution proceeds to 'Process Result'.

  9. Final Output: The final 'Process Result' custom code n8n node structures the output data, extracting the resulting image URL and associated metadata, concluding the n8n workflow run.

Installation Guide

To use this n8n template, follow these steps:


  1. Import: Copy the entire JSON code and import it into your n8n instance.

  2. API Key Setup: Locate the 'Set API Key' n8n node.

  3. Credentials: Replace the placeholder value YOURREPLICATEAPI_KEY with your actual key from Replicate.

  4. Input Configuration: Review the 'Create Prediction' HTTP Request n8n node's JSON body. Update the image and mask URLs to point to your desired input files and adjust parameters like steps or strength for the Simbrams Ri model.

  5. Execution: Save the n8n workflow and click 'Execute Workflow' manually to test the full automation loop.

Node Details


  • On clicking 'execute' (Manual Trigger): The starting n8n trigger for the workflow, allowing manual testing and execution.

  • Set API Key (Set n8n node): A utility n8n node used to securely store the replicateapikey as a variable for use in subsequent HTTP requests, essential for the rest of the n8n workflow.

  • Create Prediction (HTTP Request n8n node): Sends the initial request to Replicate to start the AI image generation using the simbrams/ri model version. Key Configuration: Uses Bearer token authorization and specifies the model version and input parameters (image, mask, seed).

  • Extract Prediction ID (Code n8n node): A custom n8n node responsible for parsing the initial response JSON to extract the necessary predictionId and formulate the specific polling URL. This prepares the data for the asynchronous loop.

  • Wait (Wait n8n node): Pauses the n8n workflow for 2 seconds between status checks, preventing excessive API calls during the polling cycle.

  • Check Prediction Status (HTTP Request n8n node): Repeatedly queried within the polling loop. This n8n node uses the extracted prediction ID to check the current status of the Simbrams Ri job.

  • Check If Complete (If n8n node): The core control flow n8n node. It compares the job status to 'succeeded' and routes the execution either to the final processing step or back to the 'Wait' n8n node for another poll.

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*