by Kristian Ekachandra
🎬 AI-Powered UGC Video Generator Automatically create consistent, professional UGC (User-Generated Content) videos at scale using cutting-edge AI models. This workflow combines three reference images into hyper-realistic selfie-style photos, then transforms them into engaging 8-second videos perfect for TikTok, Instagram Reels, and social media ads. ✨ What This Workflow Does Part 1: Image Generation Combines 3 reference images (product + character + background) using NanoBanana Pro AI agent generates optimized prompts for realistic UGC selfie photos Analyzes output quality before proceeding to video generation Part 2: Video Creation Transforms static images into dynamic 8-second videos using Google Veo 3.1 AI agent creates natural dialogue and scene descriptions Batch processes multiple tasks automatically via Google Sheets 🎯 Perfect For E-commerce brands** creating product demonstration videos Marketing agencies** producing social media ad content at scale Content creators** generating consistent UGC-style videos A/B testing** multiple video variations quickly Dropshippers** needing authentic product videos without filming 🚀 Key Features ✅ Consistent Characters - Same person, style, and aesthetic across all videos ✅ Batch Processing - Manage multiple tasks via Google Sheets ✅ Multi-Model Support - Primary + fallback AI models for reliability ✅ Smart Error Handling - Automatic retries and status tracking ✅ Dual Workflow - Separate pipelines for image and video generation ✅ Quality Analysis - AI checks image quality before video creation 🛠️ Required APIs Essential: Google Sheets API (free) Atlas Cloud API (for NanoBanana Pro & Veo 3.1) Choose at least ONE: OpenAI API (GPT-5-Mini recommended) Groq API (fast & free tier available) Google Gemini API (alternative) 📋 How It Works Image Generation Pipeline: Reads tasks from Google Sheets (Status: "Ready") AI agent generates optimized image prompt Downloads and uploads 3 reference images to temp storage NanoBanana Pro combines images into realistic UGC selfie Analyzes output image quality Updates sheet with results (Status: "Edited") Video Generation Pipeline: Reads edited tasks from Google Sheets (Status: "Edited") AI agent generates video prompt with natural dialogue Veo 3.1 transforms image into 8-second video Polls generation status every 10 seconds Updates sheet with final video (Status: "Finished") 💡 Pro Tips Use high-quality reference images** (minimum 1024x1024px) Keep character photos consistent** (same person, similar lighting) Write clear scene descriptions** for better results Test with 1 task first** before running large batches Monitor API quotas** to avoid rate limits 📺 Full Tutorial Complete setup walkthrough available on YouTube: Watch Tutorial 🎓 What You'll Learn Setting up multi-step AI automation workflows Integrating multiple AI models (OpenAI, Groq, Gemini) Using NanoBanana Pro for advanced image editing Generating videos with Google Veo 3.1 Managing batch processes via Google Sheets Implementing fallback models for reliability Handling errors and status tracking 📊 Google Sheets Template Structure The workflow includes a pre-built template with these columns: Task ID** - Unique identifier Product Photo** - Product image URL Character** - Person reference image URL Background** - Scene background URL Product Name** - Name of the product Product Description** - Details about the product Target Market** - Audience for the video Video Scene** - Scene description for video Status** - Workflow status (Ready → Edited → Finished) Image Prompt** - Generated prompt for image Image Result** - Output image URL Analyze Image** - Quality analysis results Video Prompt** - Generated prompt for video Video Result** - Final video URL Error Message** - Error details if failed 🔄 Status Flow Ready → Edited → Finished ↓ ↓ ↓ Error Error Error ⚙️ Customization Options Adjust Image Style: Modify the Image Prompt Agent system message Change composition (close-up, medium shot, wide) Adjust lighting (natural, studio, dramatic) Modify Video Output: Edit Video Prompt Agent for different styles Change duration (default: 8 seconds) Customize dialogue language (default: Indonesian) Adjust camera angles and movements Add More AI Models: Connect additional providers as fallbacks Models are tried in order until success Supports OpenAI, Anthropic, Groq, Gemini 🔐 Security Notes Never commit API keys to version control Use environment variables in production Don't share your Google Sheets publicly Rotate API keys regularly Set billing alerts on all platforms 📞 Support & Updates Created by: Kristian Ekachandra Follow for more AI automation workflows: 🎥 YouTube: @aichandre 📸 Instagram: @aichandre 🎵 TikTok: @aichandre 🏷️ Tags ai-video ugc content-creation video-generation batch-processing google-sheets openai groq nanobanana-pro veo-3.1 marketing social-media tiktok instagram-reels automation
by Davide
This workflow automates the full process of generating, creating, and assigning optimized WordPress tags to a specific blog post. It uses a combination of WordPress API actions, AI analysis (Claude Opus 4.5), and internal data cleaning to ensure SEO-friendly, consistent, and properly structured tags. Key Features ✅ 1. Full Tag Automation The workflow removes the need for manual tag selection or creation. It automatically: Reads the article content Chooses relevant existing tags Creates new SEO-optimized ones Assigns them to the article This eliminates human error and saves significant editorial time. ✅ 2. AI-Optimized SEO Thanks to the integrated Claude analysis, tags are: Semantically relevant Optimized for search intent Designed to improve discoverability and CTR Adapted to the specific content structure This allows for a much higher SEO quality compared to manual tagging. ✅ 3. Intelligent Tag Management The system ensures: A maximum of 4 total tags No irrelevant or duplicate tags Tags follow naming conventions (e.g., multi-word or acronyms) This creates a clean, consistent tag taxonomy across the WordPress site. ✅ 4. Automated Tag Creation in WordPress New tags are automatically created directly in WordPress via API, ensuring: Perfect synchronization with your CMS No need to manually add new tags from the WordPress backend Immediate availability for future posts ✅ 5. Clean and Reliable Data Handling Custom code nodes and aggregation steps: Merge tag arrays safely Remove duplicates Produce clean, valid JSON outputs This makes the workflow stable even with large or complex tag lists. ✅ 6. Modular and Scalable Architecture Every step (fetching, AI analysis, creation, merge, update) is separated into independent nodes, making it easy to: Extend the workflow (e.g., add categories, multilingual tags, taxonomy validation) Plug in different AI models Reuse the structure for other WordPress automations ✅ 7. Consistent Output Validation The Structured Output Parser ensures: Correct JSON schema Safe handling of AI output No malformed data sent to WordPress This makes the automation robust and production-ready. How it works This workflow is an intelligent, AI-powered tag suggestion and assignment system for WordPress. It automates the process of analyzing a blog post's content and assigning the most relevant tags, creating new ones if necessary. Data Retrieval & Preparation: The workflow starts by fetching a specific WordPress article using a provided post_id. Simultaneously, it retrieves all existing tags from the WordPress site via the REST API. These two data streams are then merged into a single data structure. AI-Powered Tag Analysis: The merged data (article content and existing tag list) is sent to an LLM (Claude Opus 4.5). The AI acts as an "SEO expert," analyzing the article's title, content, and excerpt. It follows a strict set of instructions to select up to 4 relevant tags from the existing list and, if needed, suggests new tag names to reach a total of 4 tags. Tag Processing & Creation: The workflow splits the AI's output into two paths: Existing Tags: The list of selected tag IDs is prepared for the final update. New Tags: The list of new tag names is processed in a loop. For each new tag, the workflow sends a POST request to the WordPress API to create it. The newly created tag IDs are collected. Final Assignment: The existing tag IDs and the newly created tag IDs are merged into a single list. This final list of tag IDs is then sent back to the original WordPress article via an "Update" operation, effectively tagging the post. Set up steps To configure and run this workflow, follow these steps: Provide Input Data: In the "Set data" node, you must configure the two required assignment fields: post_id: Set this to the numerical ID of the WordPress post you want to analyze and tag. url: Set this to the base URL of your WordPress site (e.g., https://yourwebsite.com/). Configure WordPress Credentials: Ensure that the "Wordpress" and "HTTP Request" nodes are correctly linked to a valid set of WordPress credentials within n8n. These credentials must have the necessary permissions to read and update posts, as well as create new tags. Configure Claude Opus 4.5 Credentials: Verify that the "Claude Chat Model" nodes are linked to a valid Claude API key credential in n8n. Execute: Once the credentials and input data are set, click "Execute Workflow" on the manual trigger node to run the process. The workflow will fetch the article, analyze it with AI, create any new tags, and update the post with the final selection of tags. Need help customizing? Contact me for consulting and support or add me on Linkedin.
by Huzaifa Tahir
🎬 What it does This workflow creates an engaging YouTube Short with a single click — from script to voiceover, to visuals and background music. It combines several AI tools to automate content creation and final video assembly. ⚙️ How it works Accepts an input prompt or topic Generates script using GPT Converts script to voiceover using ElevenLabs Generates b-roll style images via Leonardo.Ai Matches background music Assembles a vertical 1080×1920 MP4 video using JSON render config Optionally uploads to YouTube or saves to Cloudinary 🧰 Setup steps Add your credentials: Leonardo API (image generation) ElevenLabs (voiceover) Cloudinary (upload destination) Any GPT-based text generator Drop your audio/music file in the right node Replace API expressions with your own credentials > 🟨 Full step-by-step instructions are in sticky notes inside the workflow.
by Ludwig
How it works: This workflow automates tagging for WordPress posts using AI: Fetch blog post content and metadata. Generate contextually relevant tags using AI. Verify existing tags in WordPress and create new ones if necessary. Automatically update posts with accurate and optimized tags. Set up steps: Estimated time: ~15 minutes. Configure the workflow with your WordPress API credentials. Connect your content source (e.g., RSS feed or manual input). Adjust tag formatting preferences in the workflow settings. Run the workflow to ensure proper tag creation and assignment. This workflow is perfect for marketers and content managers looking to streamline their content categorization and improve SEO efficiency.
by Ghufran Barcha
UGC Ads Factory — Automated AI Video Pipeline This n8n workflow turns a script and character/setting description from Google Sheets into a complete stitched UGC-style video ad, fully automated from intake to final delivery. --- Overview The workflow runs a full production pipeline in four stages: Image Generation An AI agent creates a photorealistic selfie prompt from the character/setting description. The image is generated with Kie (Nano Banana), then uploaded to Google Drive and shared. Scene Scripting The generated image is analyzed by Claude-4o-mini for visual consistency. Claude Opus then converts the user script into structured 8-second scenes with consistent visuals and environment-aware motion prompts. Video Clip Generation Each scene is sent to Kie VEO3 for video generation. The workflow polls until each clip is complete, then uploads clips to Google Drive and updates status per scene. Video Stitching After all scene clips are completed, clips are sorted and merged into one final video using fal.ai FFmpeg. The stitched output is uploaded to Drive, and the final links are written back to Sheets. --- Google Sheets Structure This workflow uses two tabs in one spreadsheet: Videos (campaign-level tracking) Main input/output tab with script, character description, aspect ratio, and global run status (Create → Processing → Completed / Failed), plus final video links. Video Data (scene-level tracking) One row per scene with scene script JSON, scene number, image URL, clip links, and per-scene status. This tab enables robust scene retries and progress visibility. --- Triggers Every 30 minutes: processes new rows in Videos where LAUNCH CREATION = Create Every 15 minutes: reprocesses rows in Video Data where LAUNCH = Redo Execute Workflow Trigger: allows orchestration from another workflow --- Error Handling API nodes retry on failure with a 5-second delay Failed image or clip generations are written to Sheets with error details Individual failed scenes can be retried by setting LAUNCH = Redo in Video Data Final stitching runs only after verifying all required scenes are completed --- External Services Kie API — image generation (Nano Banana) and video generation (VEO3) OpenRouter (Claude Opus) — prompt engineering and scene script generation OpenAI (Claude-4o-mini) — image analysis for visual continuity fal.ai — FFmpeg-based clip stitching Google Drive — asset storage and share links Google Sheets — input/output control plane and status tracking --- Usage Add a row in Videos with script, character/setting description, and aspect ratio. Set LAUNCH CREATION to Create. Wait for the scheduled run (or trigger from another workflow). Track scene progress in Video Data. Retrieve final video links in Videos once status is Completed. To retry failed scenes, set scene status to Redo in Video Data.
by Fahmi Fahreza
Quick overview This workflow answers Instagram DMs using a Google Gemini RAG agent backed by a Qdrant vector store, while automatically ingesting new PDF files from Google Drive into the knowledge base and refreshing the Instagram access token on a schedule. How it works Triggers when an Instagram message is received and filters out echoes and empty messages. Uses a Google Gemini chat model with chat memory and a Qdrant retriever tool to generate a context-grounded FAQ response. Sends the generated reply back to the sender as an Instagram DM. Runs on a daily schedule to refresh the Instagram access token. Triggers when a new file is created in a specific Google Drive folder and allows only supported MIME types (PDF). Downloads the file, processes items in batches, generates embeddings with Google Gemini, and inserts the document vectors into a Qdrant collection for retrieval. Setup Add Instagram Graph API credentials, set the trigger verify token, and configure the Instagram app/webhook to call the workflow’s Instagram trigger. Add Google Gemini (PaLM) API credentials for both the chat model and embedding generation. Add Qdrant credentials and ensure the target collection (for example, "n8n-rag-template") exists and matches your embedding dimensions. Add Google Drive OAuth2 credentials and set the folder to watch (and ensure it contains the PDFs you want indexed). Adjust the allowed MIME type filters and schedule interval to match your content types and token refresh needs. Additional info Published by Fahmi Fahreza, Indonesia’s first official n8n Brand Ambassador and founder of WithMi Automation, built from real client implementations, not tutorials. → Let us build it for you: withmiautomation.com → Learn to build it yourself: academy.withmiautomation.com → Bring Fahmi to your team (training, workshop, talkshow): fahmiiireza.com
by Marcel Claus-Ahrens
Instructions This automation enables you to just upload any Image (via Form) of a Logo Sheet, containing multiple Images of Product Logos (most likely) which brings them in some context to one another. After submitting an AI-Agent eats that Logo Sheet, turning it into an List of "Productname" and "Attributes", also checks if Tools are kind of similar to another, given the Context of the Image. We utilize AI Vision capabilities for that. NOTE: It might not be able to extract all informations. For a "upload and forget it" Workflow it works for me. You can even run it multiple times, to be sure. But if you need to make sure it extracts everything you might need to think about an Multi-Agent Setup with Validation-Agent Steps. Once the Agent finishes the extraction, it will traditionally and deterministicly add those Attributes to Airtable (Creates those, if not already existing.) and also Upserts the Tool Informations. It uses MD5 Hashes for turning Product Names into.. something fancy really, you could also use it without that, but I wanted to have something that looks atleast like an ID. Setup Set Up the Airtable like shown below. Update and set Credentials for all Airtable Nodes. Check or Adjust the Prompt of the Agent matching your use-case. Activate the Workflow. Open the Form (default: https://your-n8n.io/form/logo-sheet-feeder) Enjoy growing your Airtable. Enjoy the workflow! ❤️ let the work flow — Workflow Automation & Development
by Jimleuk
This n8n workflow takes in a document such as a research paper, marketing or sales deck or company filings, and breaks them down into 3 templates: study guide, briefing doc and timeline. These templates are designed to help a student, associate or clerk quickly summarise, learn and understand the contents to be more productive. Study guide - a short quiz of questions and answered generated by the AI Agent using the contents of the document. Briefing Doc - key information and insights are extracted by the AI into a digestable form. Timeline - key events, durations and people are identified and listed into a simple to understand timeline by the AI How it works A local file trigger watches a local network directory for new documents. New documents are imported into the workflow, its contents extracted and vectorised into a Qdrant vector store to build a mini-knowledgebase. The document then passes through a series of template generating prompts where the AI will perform "research" on the knowledgebase to generate the template contents. Generated study guide, briefing and timeline documents are exported to a designated folder for the user. Requirements Self-hosted version of n8n. Qdrant instance for knowledgebase. Mistral.ai account for embeddings and AI model. Customising your workflow Try adding your own templates or adjusting the existing templates to suit your unique use-case. Anything is quite possible and limited only by your imagination! Want to go fully local? A version of this workflow is available which uses Ollama instead. You can download this template here: https://drive.google.com/file/d/1VV5R2nW-IhVcFP_k8uEks4LsLRZrHSNG/view?usp=sharing
by Incrementors
Quick overview This sub-workflow accepts plain-text invoice details, uses OpenAI to extract and normalize invoice fields, renders a styled HTML invoice to PDF via PDFCrowd, uploads the PDF to Google Drive, and returns a shareable Drive link while clearing working tabs in Google Sheets. How it works Receives invoice details as input from a parent workflow. Uses OpenAI to parse the free text into a fixed set of invoice fields and calculations, with a structured output parser that retries and auto-fixes malformed JSON. Adds company metadata and today’s invoice date, and maps the extracted values into the fields used for the invoice. Builds a styled HTML invoice document from the structured fields. Sends the HTML to the PDFCrowd API to generate an A4 PDF. Uploads the generated PDF to a specified Google Drive folder and returns a view URL. Clears rows in the “Invoice Input” and “Invoice Output” tabs in Google Sheets to prepare for the next run. Setup Add an OpenAI API credential for the chat model used to extract and structure invoice data. Add Google Drive and Google Sheets credentials, then set YOUR_DRIVE_FOLDER_ID and YOUR_GOOGLE_SHEET_ID to your target folder and spreadsheet. Create a PDFCrowd account and replace the Authorization header with your base64-encoded username:apiKey value. Update the invoice template placeholders in the HTML (company name, address, email, TRN, and payment details) and set YOUR_COMPANY_TAX_NUMBER in the invoice fields mapping.
by Davide
The Video Grok Agent is an AI-powered video generation and editing workflow that uses Grok 4.1 Fast (via OpenRouter) and Grok Imagine Video to create and modify videos through natural language. This workflow enables seamless AI-driven video creation and editing through a conversational interface, with built-in validation, async processing, and secure credential management. Key Advantages 1. ✅ Unified Video Creation Pipeline A single workflow supports text-to-video, image-to-video, and video editing, reducing complexity and avoiding duplicated logic across multiple automations. 2. ✅ AI-Guided User Interaction The conversational agent ensures: the correct tool is selected, all mandatory parameters are provided, errors due to missing inputs are minimized. This makes the workflow usable even by non-technical users. 3. ✅ Asynchronous & Scalable Execution The workflow is designed around queued, non-blocking requests: wait nodes + status polling no execution timeouts scalable for multiple concurrent video jobs 4. ✅ Automatic Media Handling Uploaded images are: detected automatically, uploaded to external storage, converted into usable URLs without manual steps. This enables smooth image-to-video generation directly from chat uploads. 5. ✅ Clear Separation of Responsibilities Each step is modular: orchestration (agent), decision routing (switch), media processing (Fal.run APIs), status monitoring (HTTP + wait loops). This makes the workflow easy to maintain, extend, or debug. 6. ✅ Strong Guardrails & Validation The agent enforces: correct tool usage (e.g. video-to-video only for editing), duration limits (1–15 seconds), mandatory URLs before execution. This prevents incorrect API calls and wasted compute. 7. ✅ Extensible Architecture New tools (e.g. different models, resolutions, aspect ratios, or providers) can be added without redesigning the whole system—just plug them into the existing agent + switch logic. How it works User Interaction The workflow starts with a chat trigger (When chat message received), where users can upload images and submit text prompts. If an image is uploaded, it is automatically stored via FTP (BunnyCDN) and its URL is passed to the AI agent. AI Agent Orchestration The Grok Imagine Video Agent processes the user’s request and determines which action to perform: Text-to-Video: Create a new video from a text prompt. See test result Image-to-Video: Animate an existing image. See test result Video-to-Video: Edit an existing video. See test result The agent follows strict rules to ensure all required parameters (e.g., duration, URLs, prompts) are collected before proceeding. Video Processing via Fal.run API Depending on the selected tool, the workflow calls the corresponding Fal.run endpoint: text-to-video image-to-video edit-video Each request returns a request_id used to poll for completion. Asynchronous Processing & Polling After submission, the workflow enters a polling loop: Waits 10–30 seconds. Checks the request status via Fal.run’s status endpoint. Once the status is COMPLETED, it retrieves the final video URL. Result Delivery The final video URL is returned to the user via the chat interface. The agent does not proceed further once the video is ready. Set Up Steps To deploy and use this workflow in n8n: Credentials Configuration Set up the following credentials in n8n: OpenRouter API (for Grok 4.1 Fast) Fal.run API (HTTP Header Auth) FTP/BunnyCDN (for image uploads) Workflow Activation Ensure all nodes are correctly connected as per the connections mapping. Activate the workflow via the Execute Workflow Trigger (Run Text-to-Video1). Chat Interface Setup The workflow is designed to be triggered via a chat message. Configure the When chat message received node to connect to your frontend or chat platform. Parameter Validation The AI agent includes validation rules to ensure: Duration is between 1–15 seconds. Required URLs (image/video) are provided where needed. The correct tool is invoked based on user intent. Testing & Monitoring Test each tool separately (text, image, video) to ensure Fal.run API responses are handled correctly. Monitor the polling loops to avoid timeouts and ensure video URLs are retrieved successfully. 👉 Subscribe to my new YouTube channel. Here I’ll share videos and Shorts with practical tutorials and FREE templates for n8n. Need help customizing? Contact me for consulting and support or add me on Linkedin.
by Trung Tran
Multi-Agent Book Creation Workflow with AI Tool Node and GPT-4, DALL-E Who’s it for This workflow is designed for: Content creators** who want to generate books or structured documents automatically. Educators and trainers** who need quick course materials, eBooks, or study guides. Automation enthusiasts* exploring *multi-agent systems* using the newly released *AI Tool Node** in n8n. Developers* looking for a reference template to understand *orchestration of multiple AI agents** with structured output. How it works / What it does This template demonstrates a multi-agent orchestration system powered by AI Tool Nodes: Trigger: Workflow starts when a chat message is received. Book Brief Agent: Generates the initial book concept (title, subtitle, and outline). Book Writer Agent: Expands the outline into full content by collaborating with two sub-agents: Designer Agent → Provides layout/design suggestions. Content Writer Agent → Drafts and refines chapters. Generate Cover Image: AI generates a custom book cover image. Upload to AWS S3: Stores the cover image securely. Configure Metadata: Adds metadata for title, author, and description. Build Book HTML: Converts markdown-based content into HTML format. Upload to Google Drive: Saves the HTML content for processing. Convert to PDF: Transforms the book into a professional PDF. Archive to Google Drive: Final version is archived for safe storage. This workflow showcases multi-agent coordination, structured parsing, and seamless integration with cloud storage services. How to set up Import the workflow into n8n. Configure the following connections: OpenAI (for Book Brief, Book Writer, Designer, and Content Writer Agents). AWS S3 (for image storage). Google Drive (for document storage & archiving). Add your API keys and credentials in n8n credentials manager. Test the workflow by sending a sample chat message (e.g., “Write a book about AI in education”). Verify outputs in Google Drive (HTML + PDF) and AWS S3 (cover image). Requirements n8n* (latest version with *AI Tool Node** support). OpenAI API key** (to power multi-agent models). AWS account** (with S3 bucket for storing images). Google Drive integration** (for document storage and archiving). Basic familiarity with workflow setup in n8n. How to customize the workflow Switch Models**: Replace gpt-4.1-mini with other models (faster, cheaper, or more powerful). Add More Agents: Introduce agents for **editing, fact-checking, or translation. Change Output Format: Export to **EPUB, DOCX, or Markdown instead of PDF. Branding Options: Modify the **cover generation prompt to include company logos or specific style. Extend Storage: Add **Dropbox, OneDrive, or Notion integration for additional archiving. Trigger Alternatives: Replace chat trigger with **form submission, webhook, or schedule-based runs. ✅ This workflow acts as a free, plug-and-play template to showcase how multi-agents + AI Tool Node can work together to automate complex content creation pipelines.
by Tricore Infotech Pvt Ltd
🧠 AI Chatbot with RAG: Google Gemini & Supabase Vector Store 📌 Summary Build a custom, intelligent knowledge base in minutes. This n8n workflow provides a complete Retrieval-Augmented Generation (RAG) system using Google Gemini and Supabase. It features a seamless dual-flow design: an ingestion pipeline to process and store your uploaded documents, and a conversational AI agent that queries those documents to provide accurate, context-aware answers while remembering past interactions. ✨ Key Features Two-in-One Architecture:** Combines both the document ingestion pipeline and the conversational chat interface into a single, cohesive workflow template. State-of-the-Art AI:** Leverages Google Gemini (models/gemini-embedding-001 and models/gemini-2.5-flash) for high-quality text embeddings and intelligent chat generation. Persistent Conversational Memory:** Uses PostgreSQL to remember chat histories per sessionId, allowing the AI to maintain context across ongoing conversations. The chat trigger automatically generates a unique Session ID per browser window, keeping individual user conversations completely separate. Vector-Powered Accuracy:* Integrates with Supabase (pgvector) to retrieve the top 5 most relevant chunks, ensuring the agent answers based *strictly on your uploaded company documents without hallucinating. Global Error Handling:** Built-in error triggers actively catch API rate limits, parsing failures, and bad requests, formatting them into clear alerts ready to be routed to your team. 🛠️ How It Works Data Ingestion (Knowledge Base Setup): * Documents are uploaded via the Form Trigger and validated for size (<10MB) to prevent parsing timeouts. The text is parsed and split into optimized 1000-character chunks with a 100-character overlap. Gemini generates embeddings for these chunks, which are permanently stored in your Supabase Vector Store. Query Processing (Chat Interface): A user asks a question via the Chat Trigger. The AI Agent accesses the Postgres database to load previous chat context for that specific user's session. The Agent uses the Supabase Retriever tool to pull the top 5 most relevant document chunks based on the user's query. Gemini formulates a concise, factual response citing the retrieved data. 🚀 Setup Instructions 1. Create Database Tables Before running the workflow, ensure your Supabase/Postgres database has the required tables. ⚠️ See the "DATABASE SETUP (SQL)" sticky note on the canvas for the complete SQL script. 2. Connect Credentials Connect your Google Gemini API, Supabase (URL and Service Role Key), and Postgres databases. (Note: Your Postgres memory can be hosted within your Supabase project). Ensure your Supabase database has pgvector enabled. 3. Update Table Names Open the Supabase and Postgres nodes and replace: your_documents_table → your actual table name your_chat_history_table → your actual table name 4. Configure Error Notifications (Important) The workflow catches errors and formats an alert message, but you must manually connect a messaging node (like Slack, Microsoft Teams, or Email) directly after the Format Error Alert node to receive these notifications. 5. Ingest Data Open the Upload Knowledge Base Form node, click "Test step", and upload a sample document to index it into your database. 6. Test the Agent Open the User Chat Trigger node, click "Chat", and ask a question related to the document you just uploaded! 📦 Nodes Used User-Facing Interfaces: Chat Trigger** - The user-facing chat interface for asking questions (includes Pin Data for easy testing). Form Trigger & File Validator** - Provides a simple UI to upload and size-check files, with explicitly stated rules for the end-user. Includes a Webhook Response for success confirmation. Data Processing Pipeline (Ingestion): Document Default Data Loader** - Extracts raw text from uploaded files. Character Text Splitter** - Chunks large texts into digestible pieces (1000 chars) for the AI. Embeddings Google Gemini** - Converts text chunks into mathematical vectors. Supabase Inserter** - Stores vectors in the knowledge base. AI & Memory (Query): Supabase Retriever** - Performs semantic search to find top 5 relevant chunks. Postgres Chat Memory** - Stores and retrieves historical chat context by session ID. Google Gemini Chat Model** - The core LLM powering the conversational responses. Knowledge-Base AI Agent** - Orchestrates the memory, tools, and LLM to answer the user's prompt. Error Handling: Error Trigger & Format Error Alert** - Catches global execution failures. Connect an output to route these formatted alerts to your team. ⚠️ Limitations & Guidelines File Size & Type:** The workflow limits files to 10MB to prevent memory exhaustion, and currently supports .pdf, .txt, .docx, .pptx. Highly complex PDFs with nested tables or un-OCR'd images may fail parsing. Context Window Limits:** While the Agent tracks sessions, very long ongoing conversations (e.g., hundreds of messages) will eventually hit the LLM's token limit. It is recommended to implement a cron job or separate workflow to prune the chat_history table periodically or clear old sessions. API Costs:** Each document ingestion and chat query uses Gemini API calls (embeddings + chat). Monitor your API usage.