LLM Content Generation using IBM Granite 3.3 via Replicate - n8n Workflow

Use this robust n8n workflow to automate text generation with IBM Granite 3.3 8B Instruct via Replicate. Features polling, error handling, and structured output.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • AI Engineers and Developers needing to integrate complex LLM APIs.

  • Content marketers who require bulk, automated text generation.

  • Users looking for production-ready n8n templates featuring asynchronous API polling logic.

Overview

This powerful n8n workflow solves the common complexity of integrating with asynchronous external AI services, specifically Replicate. When dealing with sophisticated large language models like IBM Granite 3.3 8B Instruct, results are often not immediate. This specialized n8n template handles the full lifecycle: from initiating the prediction request to intelligent status polling, waiting, checking for success or failure, and providing a clean, final JSON response.

The entire system leverages several critical n8n node components, including core logic flow control and custom HTTP requests, ensuring a resilient and production-ready text generation pipeline. This specific n8n workflow design is highly reusable for other asynchronous API integrations.

How it Works


  1. The n8n workflow begins with the Manual Trigger n8n trigger, initiating the text generation process.

  2. The workflow first sets up the Replicate API token and defines all necessary generation parameters (prompt, temperature, max tokens, etc.) using two consecutive Set n8n node components.

  3. The Create Text Prediction n8n node sends an HTTP POST request to Replicate to start the generation for the ibm-granite/granite-3.3-8b-instruct model, receiving an immediate prediction ID for tracking.

  4. After a short initial pause (Wait 5s) and a quick logging step, the Check Status n8n node begins polling Replicate for the job status using the retrieved prediction ID.

  5. The Is Complete? decision n8n node checks if the job status is 'succeeded'. If successful, it routes the data to format the final Success Response.

  6. If not yet succeeded, the n8n workflow checks if the job has failed using the Has Failed? n8n node. A failure leads to the Error Response.

  7. If the job is still running (neither succeeded nor failed), the automation enters a crucial polling loop, waiting 10 seconds (Wait 10s) before running the Check Status n8n node again. This robust loop is vital for handling long-running AI tasks within this complex n8n template.

  8. Finally, the Display Result n8n node aggregates and returns the structured output, containing either the generated content link or the detailed error message.

Installation Guide


  1. Import the n8n workflow: Copy the provided JSON data and paste it into your n8n instance using the "New" -> "Import from JSON" function.

  2. API Key Configuration: Locate the Set API Token n8n node. You must replace the placeholder value (YOURREPLICATEAPITOKEN) with your actual Replicate API token, which is essential for this n8n workflow to function.

  3. Customize Parameters: Navigate to the Set Text Parameters n8n node to define your input prompt, maxtokens, temperature, and other critical model settings for the IBM Granite model.

  4. Execution: Click on the Manual Trigger n8n trigger and press "Execute Workflow" to initiate and test the text generation. Ensure all credentials are saved properly before running the n8n template.

Node Details

Manual Trigger (n8n trigger): The starting point of the n8n workflow, allowing manual initiation of the generation job.
Set API Token (Set n8n node): Stores the Replicate API Key securely, which is dynamically used for authentication in subsequent HTTP Request nodes.
Set Text Parameters (Set n8n node): Configures 12 generation parameters (e.g., prompt, temperature, max_tokens) using default values, which users can easily customize for their specific needs.
Create Text Prediction (HTTP Request n8n node): Sends the initial asynchronous request to Replicate's /predictions endpoint. Key configuration includes setting the Authorization header with the Bearer token and specifying the exact model version (ibm-granite/granite-3.3-8b-instruct).
Wait 5s and Wait 10s (Wait n8n node): Introduce controlled delays within the n8n workflow to manage the asynchronous nature of the API call and adhere to best practices for polling external services.
Check Status (HTTP Request n8n node): Polls the specific prediction status endpoint using the ID generated in the previous step. This is a core component of the asynchronous polling logic in this n8n template.
Is Complete? and Has Failed? (If n8n node): Control the flow logic. They route the n8n workflow execution based on the received status ('succeeded', 'failed', or 'processing'), enabling the effective retry loop.
Success Response / Error Response (Set n8n node): Standardize the final output data structure, making the results immediately consumable by the next steps in your larger n8n workflow.

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*