Enhance Your Workflow with 2Ndmoises_Generator AI
Enhance Your Workflow with 2Ndmoises_Generator AI
This n8n workflow integrates with Replicate’s moicarmonas/2ndmoises_generator model to generate custom outputs based on your prompt. It handles authentication, triggers the prediction, monitors progress, and processes the final result automatically.
📌 Section 1: Trigger & Authentication
⚡ On Clicking ‘Execute’ (Manual Trigger)
Purpose: Start the workflow manually whenever you want to run it. Benefit: Great for testing or running on-demand without needing automation.
🔑 Set API Key (Set Node)
Purpose: Stores your Replicate API key in the workflow. How it works: Adds your API key as a variable that other nodes can reference. Benefit: Keeps credentials secure and reusable.
📌 Section 2: Sending the AI Request
📤 Create Prediction (HTTP Request Node)
Purpose: Sends a request to the Replicate API to start generating output with the model. Input Parameters:
prompt (text you provide) seed (for reproducibility) width / height / lora_scale (generation settings) Benefit: Allows full customization of the AI’s generation process.
🆔 Extract Prediction ID (Code Node)
Purpose: Pulls out the Prediction ID and status from the API response. Why important: The ID is required to check the job’s progress later. Benefit: Automates polling without manual tracking.
📌 Section 3: Polling & Waiting
⏳ Wait (Wait Node)
Purpose: Adds a short pause (2 seconds) between checks. Benefit: Prevents hitting the API too quickly and avoids errors.
🔄 Check Prediction Status (HTTP Request Node)
Purpose: Calls Replicate again to ask if the prediction is finished. Benefit: Automates progress monitoring without manual refresh.
✅ Check If Complete (If Node)
Purpose: Decides whether the model has finished generating. Paths:
True → Move on to processing the result. False → Go back to Wait and recheck. Benefit: Ensures the workflow loops until a final output is ready.
📌 Section 4: Handling the Result
📦 Process Result (Code Node)
Purpose: Cleans up the final API response and extracts:
Status Output (generated result) Metrics Timestamps (created_at / completed_at) Model info Benefit: Provides a structured, ready-to-use output for other workflows or integrations.
📊 Workflow Overview Table
| Section | Node Name | Purpose | | ----------------- | ----------------------- | ---------------------------- | | 1. Trigger & Auth | On Clicking ‘Execute’ | Starts the workflow manually | | | Set API Key | Stores API credentials | | 2. AI Request | Create Prediction | Sends request to Replicate | | | Extract Prediction ID | Gets prediction ID + status | | 3. Polling | Wait | Adds delay before recheck | | | Check Prediction Status | Monitors progress | | | Check If Complete | Routes based on completion | | 4. Result | Process Result | Extracts and cleans output | | Notes | Sticky Note | Explains setup + model info |
🎯 Key Benefits
🔐 Secure authentication using Set node for API key storage. 🤖 Hands-free generation — just provide a prompt, the workflow handles everything else. 🔄 Automated polling ensures you always get the final result without manual checking. 📦 Clean structured output ready for downstream use in apps, dashboards, or notifications.
Related Templates
Track OpenAI Token Usage and AI Agent Metrics with Google Sheets Dashboard
What it does Captures token usage and cost from your AI Agent/LLM. Logs model, tokens, cost, tool use, and conversation ...
Lookup IP Geolocation Details with IP-API.com via Webhook
This n8n template enables you to instantly retrieve detailed geolocation information for any given IP address by simply ...
Send Hourly Crypto Market Analysis from Binance to Telegram
📈 Daily Crypto Market Summary Bot (Binance to Telegram) This workflow fetches 24h price change data from Binance for s...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments