Text Content Generation using IBM Granite 3.3 8B Instruct via Replicate - n8n Workflow

Use this robust n8n workflow to generate high-quality text content automatically using the IBM Granite 3.3 8B Instruct model accessed through the Replicate API. This n8n template includes asynchronous polling logic.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Technical content marketers who need automated, high-volume text generation.

  • Developers or automators looking for a reliable n8n template for interacting with asynchronous LLMs via HTTP requests.

  • Users who require robust polling logic built into their n8n workflow to handle AI model latency.

  • Teams integrating IBM's AI capabilities into their existing business processes using n8n.

Overview

Integrating large language models (LLMs) often requires handling asynchronous requests, especially when the generation time exceeds standard timeouts. This powerful n8n workflow template solves this challenge by implementing a dedicated polling mechanism.

Instead of waiting for a single response that might time out, this n8n automation initiates the text generation task with the ibm-granite/granite-3.3-8b-instruct model on Replicate, extracts the prediction ID, and then continually checks the status until the job is complete. This ensures the execution of the n8n workflow is reliable, even for long-running AI tasks. Every component, from the initial n8n trigger to the final processing n8n node, is designed for maximum efficiency when generating custom text content.

How it Works

The entire process of this n8n workflow begins when the 'On clicking execute' n8n trigger is manually activated.


  1. API Key Setup: The Set API Key n8n node securely defines the replicateapikey. This key is dynamically passed as an Authorization bearer token in subsequent HTTP requests.

  2. Initiate Prediction: The Create Prediction n8n node (an HTTP Request POST) sends the request to the Replicate API, specifying the model version (ibm-granite/granite-3.3-8b-instruct) and input parameters like temperature and maxtokens. Since this is an asynchronous call, it returns an immediate prediction ID.

  3. Extract ID: The Extract Prediction ID n8n node (a Code n8n node) parses the initial response to grab the unique predictionId and constructs the polling URL.

  4. Polling Loop Initiation: The workflow then enters a loop, starting with the Wait n8n node, which pauses the n8n workflow execution for 2 seconds to avoid overwhelming the API.

  5. Check Status: The Check Prediction Status n8n node (an HTTP Request GET) uses the prediction URL to fetch the current status of the AI task.

  6. Conditional Check: The Check If Complete n8n node (an If n8n node) evaluates the returned status. If the status equals 'succeeded', the n8n workflow exits the loop and proceeds. If the status is still 'processing' or 'starting', the workflow loops back to the Wait n8n node.

  7. Final Processing: Once successful, the Process Result n8n node (a final Code n8n node) extracts the generated text content (output) and essential metrics (e.g., completedat) for the final result.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the entire JSON code provided and paste it into your n8n instance using the 'New' menu and selecting 'Import from JSON'. This imports the complete n8n template structure.

  2. API Key Configuration: Locate the Set API Key n8n node. Edit the node and replace the placeholder value YOURREPLICATEAPIKEY with your actual Replicate API key.

  3. Model Input: Review the Create Prediction n8n node. This is where you configure the input prompt and generation parameters (e.g., maxtokens, temperature). Adjust the JSON body payload to suit your content generation needs.

  4. Execution: After configuration, you can activate the n8n workflow and run it using the manual n8n trigger.

Node Details


  • On clicking 'execute' (Manual Trigger): Serves as the starting n8n trigger for the automation. It allows for easy testing and execution of the n8n workflow.

  • Set API Key (Set n8n node): A crucial step for security and dynamic data handling. It stores the Replicate API key as an item, which is then referenced by expressions in the HTTP Request n8n nodes for authentication.

  • Create Prediction (HTTP Request n8n node): Sends the asynchronous POST request to Replicate, containing the specific model version ID and generation parameters. Authentication is handled via Generic HTTP Header Auth, referencing the variable set in the previous n8n node.

  • Extract Prediction ID (Code n8n node): A custom n8n node responsible for parsing the initial response JSON. It extracts the essential id and initial status needed to construct the URL for the subsequent polling requests in the n8n workflow.

  • Wait (Wait n8n node): Manages the polling interval, pausing the n8n workflow for 2 seconds before checking the status again, preventing rate limit issues.

  • Check Prediction Status (HTTP Request n8n node): Executes a GET request to the specific prediction URL (dynamically created) to check if the AI processing is complete.

  • Check If Complete (If n8n node): The core control flow n8n node for the polling loop. It checks if status equals 'succeeded'. If not, the flow is routed back to the Wait n8n node to re-check after the delay.

  • Process Result (Code n8n node): The final transformation n8n node. It structures the successful output, cleaning up the JSON data to present the generated text and completion metrics clearly.

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*