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.
Download this n8n workflow template and start using it instantly.
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.
Manual Trigger n8n trigger, initiating the text generation process.Set n8n node components.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.Wait 5s) and a quick logging step, the Check Status n8n node begins polling Replicate for the job status using the retrieved prediction ID.Is Complete? decision n8n node checks if the job status is 'succeeded'. If successful, it routes the data to format the final Success Response.Has Failed? n8n node. A failure leads to the Error Response.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.Display Result n8n node aggregates and returns the structured output, containing either the generated content link or the detailed error message.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.Set Text Parameters n8n node to define your input prompt, maxtokens, temperature, and other critical model settings for the IBM Granite model.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. 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.
Build a lightning-fast custom AI cake image generator using this sophisticated n8n workflow template. It combines an n8n trigger, GPT-4 for prompt engineering, and Replicate's Flux Schnell model for high-quality, personalized images.

Use this powerful n8n workflow template to generate custom images via the OpenAI DALL-E API (GPT-Image-1). Learn how to set variables, handle API calls using an n8n node, and convert Base64 output into usable binary files.

Automate custom AI avatar generation using the babysea/babyavatar model on Replicate. This robust n8n workflow handles setup, asynchronous API calls, and status polling efficiently.

Use this robust n8n workflow to generate high-quality images using the Black Forest Labs Flux Dev model on Replicate. Customize prompts, handle status polling, and manage errors automatically in n8n.

Use this comprehensive n8n workflow to generate high-quality images from text prompts using Stability AI SDXL via the Replicate API. Features status tracking and robust error handling.

Automate custom logo generation using this powerful n8n workflow. It uses a webhook n8n trigger, captures website data via screenshot and content scraping, and leverages OpenAI and Google Gemini for sophisticated AI-driven image creation.

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







































