by Cleverton Ruppenthal
🤖 Generate images via Telegram using an AI bot with a credit system and S3 storage A complete, production-ready Telegram bot for AI-powered image generation and editing, featuring a built-in credit system, payment integration, and cloud storage. ✨ Features 🎨 AI Image Generation Text-to-Image: Generate stunning images from text prompts using the **Nano Banana Pro Ultra model via WaveSpeed API Image-to-Image Editing**: Edit existing images by sending a photo with a caption describing the desired changes Multiple Resolutions: Support for both **4K and 8K output quality Flexible Aspect Ratios**: Choose from 10 different aspect ratios (1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9) 💳 Credit Management System Per-generation billing**: Different costs for 4K vs 8K resolution Balance tracking**: Real-time credit balance displayed to users Initial credits**: New users receive starter credits automatically Insufficient balance handling**: Graceful messages when credits run out Here's the adjusted payment section: 💰 Payment Integration (Mercado Pago PIX) > About PIX: PIX is Brazil's instant payment system, launched by the Central Bank of Brazil in 2020. It allows instant money transfers 24/7, 365 days a year, using QR codes or copy-paste codes. It has become the most popular payment method in Brazil due to its speed and zero fees for individuals. This workflow includes a fully integrated PIX payment flow as a reference implementation. You can adapt it to your local payment provider. Features: Multiple deposit options**: Pre-configured credit packages (R$ 3, R$ 6, R$ 10) QR Code generation**: Automatic PIX QR code sent directly to users via Telegram Copy-paste code**: PIX code provided for manual payment Webhook confirmation**: Real-time payment status updates via Mercado Pago webhooks Auto credit top-up**: Credits added automatically upon payment approval Payment status handling**: Supports approved, pending, and rejected states > 💡 Tip: To adapt this for other regions, replace the Mercado Pago nodes with your preferred payment gateway (Stripe, PayPal, etc.) while keeping the same credit update logic. ⚙️ User Configuration Resolution settings**: Users can set their preferred default resolution Aspect ratio preferences**: Save preferred aspect ratio for future generations Custom default prompts**: Set a default prompt that's automatically appended to all generations Persistent settings**: All preferences stored in n8n Data Tables 📦 Cloud Storage (S3/MinIO) Automatic upload**: Generated images are automatically uploaded to S3-compatible storage Persistent URLs**: Images remain accessible via permanent links Edit from storage**: Reference previously uploaded images for editing 🛠️ Tech Stack | Component | Technology | |-----------|------------| | Bot Platform | Telegram Bot API | | AI Generation | WaveSpeed API (Nano Banana Pro) | | Storage | S3-compatible (MinIO/AWS S3) | | Database | n8n Data Tables | | Payments | Mercado Pago PIX | | Automation | n8n | 📋 Prerequisites Before using this workflow, you'll need: Telegram Bot Token - Create a bot via @BotFather WaveSpeed API Key - Sign up at WaveSpeed S3-compatible Storage - MinIO, AWS S3, or any S3-compatible service Mercado Pago Account (optional) - For payment integration n8n Data Table - Create a table with the required schema 📊 Data Table Schema Create a Data Table with the following columns: | Column | Type | Description | |--------|------|-------------| | chat_id | String | Telegram chat ID (primary key) | | username | String | Telegram username | | status | String | Current user state in the flow | | credits | String | User's credit balance | | resolution | String | Preferred resolution (4k/8k) | | aspect_ratio | String | Preferred aspect ratio | | user_default_prompt | String | Custom default prompt | | number_images | Number | Total images generated | | number_videos | Number | Total videos generated | | demo_sended | Boolean | Welcome demo sent flag | ⚡ Quick Setup Import the workflow into your n8n instance Configure the Global Environment node with your settings: botName: Your bot's display name botToken: Your Telegram bot token dataTableId: Your n8n Data Table ID bucketName: Your S3 bucket name initialCredits: Credits given to new users generateImageCost4k: Cost per 4K image generateImageCost8k: Cost per 8K image Set up credentials: Telegram API credentials WaveSpeed API credentials S3 credentials Mercado Pago credentials (if using payments) Activate the workflow 🎮 Bot Commands | Command | Description | |---------|-------------| | /start | Initialize bot and receive welcome message | | menu | Return to main menu | | config | Open settings menu | | Any text | Generate image from prompt (when in generation mode) | | Photo + caption | Edit the photo based on the caption | 🔄 Workflow Flow User Message → Telegram Trigger → Route by Status ↓ ┌───────────────────┼───────────────────┐ ↓ ↓ ↓ New User Generate Image Edit Image ↓ ↓ ↓ Welcome Flow Check Credits Check Credits ↓ ↓ ↓ Create User Submit to WaveSpeed Upload to S3 ↓ ↓ ↓ Show Menu Poll for Result Submit Edit ↓ ↓ Download Image Poll for Result ↓ ↓ Send to User ←←←←←←←←←←←←←┘ 📝 Notes The workflow uses polling to check generation status - WaveSpeed processes may take up to 1 minute Credits are deducted when the task is submitted and refunded if generation fails All user states are managed through the Data Table for persistence across restarts 📄 License Free to use and modify. Attribution appreciated but not required.
by Omer Fayyaz
An automated PDF download and management system that collects PDFs from URLs, uploads them to Google Drive, extracts metadata, and maintains a searchable library with comprehensive error handling and status tracking. What Makes This Different: Intelligent URL Validation** - Validates PDF URLs before attempting download, extracting filenames from URLs and generating fallback names when needed, preventing wasted processing time Binary File Handling** - Properly handles PDF downloads as binary files with appropriate headers (User-Agent, Accept), ensuring compatibility with various PDF hosting services Comprehensive Error Handling** - Three-tier error handling: invalid URLs are marked immediately, failed downloads are logged with error messages, and all errors are tracked in a dedicated Error Log sheet Metadata Extraction** - Automatically extracts file ID, size, MIME type, Drive view links, and download URLs from Google Drive responses, creating a complete file record Multiple Trigger Options** - Supports manual execution, scheduled runs (every 12 hours), and workflow-to-workflow calls, making it flexible for different automation scenarios Status Tracking** - Updates source spreadsheet with processing status (Downloaded, Failed, Invalid), enabling easy monitoring and retry logic for failed downloads Key Benefits of Automated PDF Management: Centralized Storage** - All PDFs are automatically organized in a Google Drive folder, making them easy to find and share across your organization Searchable Library** - Metadata is stored in Google Sheets with file links, titles, sources, and download dates, enabling quick searches and filtering Error Recovery** - Failed downloads are logged with error messages, allowing you to identify and fix issues (broken links, access permissions, etc.) and retry Automated Processing** - Schedule-based execution keeps your PDF library updated without manual intervention, perfect for monitoring research sources Integration Ready** - Can be called by other workflows, enabling complex automation chains (e.g., scrape URLs → download PDFs → process content) Bulk Processing** - Processes multiple PDFs in sequence from a spreadsheet, handling large batches efficiently with proper error isolation Who's it for This template is designed for researchers, academic institutions, market research teams, legal professionals, compliance officers, and anyone who needs to systematically collect and organize PDF documents from multiple sources. It's perfect for organizations that need to build research libraries, archive regulatory documents, collect industry reports, maintain compliance documentation, or aggregate academic papers without manually downloading and organizing each file. How it works / What it does This workflow creates a PDF collection and management system that reads PDF URLs from Google Sheets, downloads the files, uploads them to Google Drive, extracts metadata, and maintains a searchable library. The system: Reads Pending PDF URLs - Fetches PDF URLs from Google Sheets "PDF URLs" sheet, processing entries that need to be downloaded Loops Through PDFs - Processes PDFs one at a time using Split in Batches, ensuring proper error isolation and preventing batch failures Prepares Download Info - Extracts filename from URL, decodes URL-encoded characters, validates PDF URL format, and generates fallback filenames with timestamps if needed Validates URL - Checks if URL is valid before attempting download, skipping invalid entries immediately Downloads PDF - Makes HTTP request with proper browser headers, downloads PDF as binary file with 60-second timeout, handles download errors gracefully Verifies Download - Checks if binary data was successfully received, routing to error handling if download failed Uploads to Google Drive - Uploads PDF file to specified Google Drive folder, preserving original filename or using generated name Extracts File Metadata - Extracts file ID, name, MIME type, file size, Drive view link, and download link from Google Drive API response Saves to PDF Library - Appends file metadata to Google Sheets "PDF Library" sheet with title, source, file links, and download timestamp Updates Source Status - Marks processed URLs as "Downloaded", "Failed", or "Invalid" in source sheet for tracking Logs Errors - Records failed downloads and invalid URLs in "Error Log" sheet with error messages for troubleshooting Tracks Completion - Generates completion summary with processing statistics and timestamp Key Innovation: Error-Resilient Processing - Unlike simple download scripts that fail on the first error, this workflow isolates failures, continues processing remaining PDFs, and provides detailed error logging. This ensures maximum success rate and makes troubleshooting straightforward. How to set up 1. Prepare Google Sheets Create a Google Sheet with three tabs: "PDF URLs", "PDF Library", and "Error Log" In "PDF URLs" sheet, create columns: PDF_URL (or pdf_url), Title (optional), Source (optional), Status (optional - will be updated by workflow) Add sample PDF URLs in the PDF_URL column (e.g., direct links to PDF files) The "PDF Library" sheet will be automatically populated with columns: pdfUrl, title, source, fileName, fileId, mimeType, fileSize, driveUrl, downloadUrl, downloadedAt, status The "Error Log" sheet will record: status, errorMessage, pdfUrl, title (for failed downloads) Verify your Google Sheets credentials are set up in n8n (OAuth2 recommended) 2. Configure Google Sheets Nodes Open the "Read Pending PDF URLs" node and select your spreadsheet from the document dropdown Set sheet name to "PDF URLs" Configure the "Save to PDF Library" node: select same spreadsheet, set sheet name to "PDF Library", operation should be "Append or Update" Configure the "Update Source Status" node: same spreadsheet, "PDF URLs" sheet, operation "Update" Configure the "Log Error" node: same spreadsheet, "Error Log" sheet, operation "Append or Update" Test connection by running the "Read Pending PDF URLs" node manually to verify it can access your sheet 3. Set Up Google Drive Folder Create a folder in Google Drive where you want PDFs stored (e.g., "PDF Reports" or "Research Library") Open the "Upload to Google Drive" node Select your Google Drive account (OAuth2 credentials) Choose the drive (usually "My Drive") Select the folder you created from the folder dropdown The filename will be automatically extracted from the URL or generated with timestamp Verify folder permissions allow the service account to upload files Test by manually uploading a file to ensure access works 4. Configure Download Settings The "Download PDF" node is pre-configured with appropriate headers and 60-second timeout If you encounter timeout issues with large PDFs, increase timeout in the node options The User-Agent header is set to mimic a browser to avoid blocking Accept header is set to application/pdf,application/octet-stream,/ for maximum compatibility For sites requiring authentication, you may need to add additional headers or use cookies Test with a sample PDF URL to verify download works correctly 5. Set Up Scheduling & Test The workflow includes Manual Trigger (for testing), Schedule Trigger (runs every 12 hours), and Execute Workflow Trigger (for calling from other workflows) To customize schedule: Open "Schedule (Every 12 Hours)" node and adjust interval (e.g., daily, weekly) For initial testing: Use Manual Trigger, add 2-3 test PDF URLs to your "PDF URLs" sheet Verify execution: Check that PDFs are downloaded, uploaded to Drive, and metadata saved to "PDF Library" Monitor execution logs: Check for any download failures, timeout issues, or Drive upload errors Review Error Log sheet: Verify failed downloads are properly logged with error messages Common issues: Invalid URLs (check URL format), access denied (check file permissions), timeout (increase timeout for large files), Drive quota (check Google Drive storage) Requirements Google Sheets Account** - Active Google account with OAuth2 credentials configured in n8n for reading and writing spreadsheet data Google Drive Account** - Same Google account with OAuth2 credentials and sufficient storage space for PDF files Source Spreadsheet** - Google Sheet with "PDF URLs", "PDF Library", and "Error Log" tabs, properly formatted with required columns Valid PDF URLs** - Direct links to PDF files (not HTML pages that link to PDFs) - URLs should end in .pdf or point directly to PDF content n8n Instance** - Self-hosted or cloud n8n instance with access to external websites (HTTP Request node needs internet connectivity to download PDFs)
by Parag Javale
The AI Blog Creator with Gemini, Replicate Image, Supabase Publishing & Slack is a fully automated content generation and publishing workflow designed for modern marketing and SaaS teams. It automatically fetches the latest industry trends, generates SEO-optimized blogs using AI, creates a relevant featured image, publishes the post to your CMS (e.g., Supabase or custom API), and notifies your team via Slack all on a daily schedule. This workflow connects multiple services NewsAPI, Google Gemini, Replicate, Supabase, and Slack into one intelligent content pipeline that runs hands-free once set up. ✨ Features 📰 Fetch Trending Topics — pulls the latest news or updates from your selected industry (via NewsAPI). 🤖 AI Topic Generation — Gemini suggests trending blog topics relevant to AI, SaaS, and Automation. 📝 AI Blog Authoring — Gemini then writes a full 1200-1500 word SEO-optimized article in Markdown. 🧹 Smart JSON Cleaner — A resilient code node parses Gemini’s output and ensures clean, structured data. 🖼️ Auto-Generated Image — Replicate’s Ideogram model creates a blog cover image based on the content prompt. 🌐 Automatic Publishing — Posts are automatically published to your Supabase or custom backend. 💬 Slack Notification — Notifies your team with blog details and live URL. ⏰ Fully Scheduled — Runs automatically every day at your preferred time (default 10 AM IST). ⚙️ Workflow Structure | Step | Node | Purpose | | ---- | ----------------------------------- | ----------------------------------------------- | | 1 | Schedule Trigger | Runs daily at 10 AM | | 2 | Fetch Industry Trends (NewsAPI) | Retrieves trending articles | | 3 | Message a model (Gemini) | Generates trending topic ideas | | 4 | Message a model1 (Gemini) | Writes full SEO blog content | | 5 | Code in JavaScript | Cleans, validates, and normalizes Gemini output | | 6 | HTTP Request (Replicate) | Generates an image using Ideogram | | 7 | HTTP Request1 | Retrieves generated image URL | | 8 | Wait + If | Polls until image generation succeeds | | 9 | Edit Fields | Assembles blog fields into final JSON | | 10 | Publish to Supabase | Posts to your CMS | | 11 | Slack Notification | Sends message to your Slack channel | 🔧 Setup Instructions Import the Workflow in n8n and enable it. Create the following credentials: NewsAPI (Query Auth) — from https://newsapi.org Google Gemini (PaLM API) — use your Gemini API key Replicate (Bearer Auth) — API key from https://replicate.com/account Supabase (Header Auth) — endpoint to your /functions/v1/blog-api (set your key in header) Slack API — create a Slack App token with chat:write permission Edit the NewsAPI URL query parameter to match your industry (e.g., q=AI automation SaaS). Update the Supabase publish URL to your project endpoint if needed. Adjust the Slack Channel name under “Slack Notification”. (Optional) Change the Schedule Trigger time as per your timezone. 💡 Notes & Tips The Code in JavaScript node is robust against malformed or extra text in Gemini output — it sanitizes Markdown and reconstructs clean JSON safely. You can replace Supabase with any CMS or Webhook endpoint by editing the “Publish to Supabase” node. The Replicate model used is ideogram-ai/ideogram-v3-turbo — you can swap it with Stable Diffusion or another model for different aesthetics. Use the slug field in your blog URLs for SEO-friendly links. Test with one manual execution before activating scheduled runs. If Slack notification fails, verify the token scopes and channel permissions. 🧩 Tags #AI #Automation #ContentMarketing #BlogGenerator #n8n #Supabase #Gemini #Replicate #Slack #WorkflowAutomation
by Jaruphat J.
⚠️ Note: This template requires a community node and works only on self-hosted n8n installations. It uses the Typhoon OCR Python package, pdfseparate from poppler-utils, and custom command execution. Make sure to install all required dependencies locally. Who is this for? This template is designed for developers, back-office teams, and automation builders (especially in Thailand or Thai-speaking environments) who need to process multi-file, multi-page Thai PDFs and automatically export structured results to Google Sheets. It is ideal for: Government and enterprise document processing Thai-language invoices, memos, and official letters AI-powered automation pipelines that require Thai OCR What problem does this solve? Typhoon OCR is one of the most accurate OCR tools for Thai text, but integrating it into an end-to-end workflow usually requires manual scripting and handling multi-page PDFs. This template solves that by: Splitting PDFs into individual pages Running Typhoon OCR on each page Aggregating text back into a single file Using AI to extract structured fields Automatically saving structured data into Google Sheets What this workflow does Trigger:** Manual execution or any n8n trigger node Load Files:** Read PDFs from a local doc/multipage folder Split PDF Pages:** Use pdfinfo and pdfseparate to break PDFs into pages Typhoon OCR:** Run OCR on each page via Execute Command Aggregate:** Combine per-page OCR text LLM Extraction:** Use AI (e.g., GPT-4, OpenRouter) to extract fields into JSON Parse JSON:** Convert structured JSON into a tabular format Google Sheets:** Append one row per file into a Google Sheet Cleanup:** Delete temp split pages and move processed PDFs into a Completed folder Setup Install Requirements Python 3.10+ typhoon-ocr: pip install typhoon-ocr poppler-utils: provides pdfinfo, pdfseparate qpdf: backup page counting Create folders /doc/multipage for incoming files /doc/tmp for split pages /doc/multipage/Completed for processed files Google Sheet Create a Google Sheet with column headers like: book_id | date | subject | to | attach | detail | signed_by | signed_by2 | contact_phone | contact_email | contact_fax | download_url API Keys Export your TYPHOON_OCR_API_KEY and OPENAI_API_KEY (or use credentials in n8n) How to customize this workflow Replace the LLM provider in the “Structure Text to JSON with LLM” node (supports OpenRouter, OpenAI, etc.) Adjust the JSON schema and parsing logic to match your documents Update Google Sheets mapping to fit your desired fields Add trigger nodes (Dropbox, Google Drive, Webhook) to automate file ingestion About Typhoon OCR Typhoon is a multilingual LLM and NLP toolkit optimized for Thai. It includes typhoon-ocr, a Python OCR package designed for Thai-centric documents. It is open-source, highly accurate, and works well in automation pipelines. Perfect for government paperwork, PDF reports, and multi-language documents in Southeast Asia. Deployment Option You can also deploy this workflow easily using the Docker image provided in my GitHub repository: https://github.com/Jaruphat/n8n-ffmpeg-typhoon-ollama This Docker setup already includes n8n, ffmpeg, Typhoon OCR, and Ollama combined together, so you can run the whole environment without installing each dependency manually.
by Gegenfeld
AI Background Removal Workflow This workflow automatically removes backgrounds from images stored in Airtable using the APImage API 🡥, then downloads and saves the processed images to Google Drive. Perfect for batch processing product photos, portraits, or any images that need clean, transparent backgrounds. The source (Airtable) and the storage (Google Drive) can be changed to any service or database you want/use. 🧩 Nodes Overview 1. Remove Background (Manual Trigger) This manual trigger starts the background removal process when clicked. Customization Options: Replace with Schedule Trigger for automatic daily/weekly processing Replace with Webhook Trigger to start via API calls Replace with File Trigger to process when new files are added 2. Get a Record (Airtable) Retrieves media files from your Airtable "Creatives Library" database. Connects to the "Media Files" table in your Airtable base Fetches records containing image thumbnails for processing Returns all matching records with their thumbnail URLs and metadata Required Airtable Structure: Table with image/attachment field (currently expects "Thumbnail" field) Optional fields: File Name, Media Type, Upload Date, File Size Customization Options: Replace with Google Sheets, Notion, or any database node Add filters to process only specific records Change to different tables with image URLs 3. Code (JavaScript Processing) Processes Airtable records and prepares thumbnail data for background removal. Extracts thumbnail URLs from each record Chooses best quality thumbnail (large > full > original) Creates clean filenames by removing special characters Adds processing metadata and timestamps Key Features: // Selects best thumbnail quality if (thumbnail.thumbnails?.large?.url) { thumbnailUrl = thumbnail.thumbnails.large.url; } // Creates clean filename cleanFileName: (record.fields['File Name'] || 'unknown') .replace(//g, '_') .toLowerCase() Easy Customization for Different Databases: Product Database**: Change field mappings to 'Product Name', 'SKU', 'Category' Portfolio Database**: Use 'Project Name', 'Client', 'Tags' Employee Database**: Use 'Full Name', 'Department', 'Position' 4. Split Out Converts the array of thumbnails into individual items for parallel processing. Enables processing multiple images simultaneously Each item contains all thumbnail metadata for downstream nodes 5. APImage API (HTTP Request) Calls the APImage service to remove backgrounds from images. API Endpoint: POST https://apimage.org/api/ai-remove-background Request Configuration: Header**: Authorization: Bearer YOUR_API_KEY Body**: image_url: {{ $json.originalThumbnailUrl }} ✅ Setup Required: Replace YOUR_API_KEY with your actual API key Get your key from APImage Dashboard 🡥 6. Download (HTTP Request) Downloads the processed image from APImage's servers using the returned URL. Fetches the background-removed image file Prepares image data for upload to storage 7. Upload File (Google Drive) Saves processed images to your Google Drive in a "bg_removal" folder. Customization Options: Replace with Dropbox, OneDrive, AWS S3, or FTP upload Create date-based folder structures Use dynamic filenames with metadata Upload to multiple destinations simultaneously ✨ How To Get Started Set up APImage API: Double-click the APImage API node Replace YOUR_API_KEY with your actual API key Keep the Bearer prefix Configure Airtable: Ensure your Airtable has a table with image attachments Update field names in the Code node if different from defaults Test the workflow: Click the Remove Background trigger node Verify images are processed and uploaded successfully 🔗 Get your API Key 🡥 🔧 How to Customize Input Customization (Left Section) Replace the Airtable integration with any data source containing image URLs: Google Sheets** with product catalogs Notion** databases with image galleries Webhooks** from external systems File system** monitoring for new uploads Database** queries for image records Output Customization (Right Section) Modify where processed images are stored: Multiple Storage**: Upload to Google Drive + Dropbox simultaneously Database Updates**: Update original records with processed image URLs Email/Slack**: Send processed images via communication tools Website Integration**: Upload directly to WordPress, Shopify, etc. Processing Customization Batch Processing**: Limit concurrent API calls Quality Control**: Add image validation before/after processing Format Conversion**: Use Sharp node for resizing or format changes Metadata Preservation**: Extract and maintain EXIF data 📋 Workflow Connections Remove Background → Get a Record → Code → Split Out → APImage API → Download → Upload File 🎯 Perfect For E-commerce**: Batch process product photos for clean, professional listings Marketing Teams**: Remove backgrounds from brand assets and imagery Photographers**: Automate background removal for portrait sessions Content Creators**: Prepare images for presentations and social media Design Agencies**: Streamline asset preparation workflows 📚 Resources APImage API Documentation 🡥 Airtable API Reference 🡥 n8n Documentation 🡥 ⚡ Processing Speed: Handles multiple images in parallel for fast batch processing 🔒 Secure: API keys stored safely in n8n credentials 🔄 Reliable: Built-in error handling and retry mechanisms
by Nguyen Thieu Toan
🤖 Facebook Messenger Smart Chatbot – Batch, Format & Notify with n8n Data Table by Nguyen Thieu Toan 🌟 What Is This Workflow? This is a smart chatbot solution built with n8n, designed to integrate seamlessly with Facebook Messenger. It batches incoming messages, formats them for clarity, tracks conversation history, and sends natural replies using AI. Perfect for businesses, customer support, or personal AI agents. ⚙️ Key Features 🔄 Smart batching: Groups consecutive user messages to process them in one go, avoiding fragmented replies. 🧠 Context formatting: Automatically formats messages to fit Messenger’s structure and length limits. 📋 Conversation history tracking: Stores and retrieves chat logs between user and bot using n8n Data Table. 👀 Seen & Typing effects: Adds human-like responsiveness with Messenger’s sender actions. 🧩 AI Agent integration: Easily connects to GPT, Gemini, or any LLM for natural replies, scheduling, or business logic. 🚀 How It Works Connects to your Facebook Page via webhook to receive and send messages. Stores incoming messages in a Data Table called Batch_messages, including fields like user_text, bot_rep, processed, etc. Collects unprocessed messages, sorts them by id, and creates a merged_message and full history. Sends the history to an AI Agent for contextual response generation. Sends the AI reply back to Messenger with Seen/Typing effects. Updates the message status to processed = true to prevent duplicate handling. 🛠️ Setup Guide Create a Facebook App and Messenger webhook, link it to your Page. Set up the Batch_messages Data Table in n8n with required columns. Import the workflow or build nodes manually using the tutorial. Configure your API tokens, webhook URLs, and AI Agent endpoint. Deploy the workflow on a public n8n server. 📘 Full tutorial available at: 👉 Smart Chatbot Workflow Guide by Nguyen Thieu Toan 💡 Pro Tips Customize the AI prompt and persona to match your business tone. Add scheduling, lead capture, or CRM integration using n8n’s flexible nodes. Monitor your Data Table regularly to ensure clean message flow and batching. 👤 About the Creator Nguyen Thieu Toan (Nguyễn Thiệu Toàn/Jay Nguyen) is an expert in AI automation, business optimization, and chatbot development. With a background in marketing and deep knowledge of n8n workflows, Jay helps businesses harness AI to save time, boost performance, and deliver smarter customer experiences. Website: https://nguyenthieutoan.com
by Toshiki Hirao
Managing invoices manually can be time-consuming and error-prone. This workflow automates the process by extracting key invoice details from PDFs shared in Slack, structuring the information with AI, saving it to Google Sheets, and sending a confirmation back to Slack. It’s a seamless way to keep your financial records organized without manual data entry. How it works Receive invoice in Slack – When a PDF invoice is uploaded to a designated Slack channel, the workflow is triggered. Fetch the PDF – The file is downloaded automatically for processing. Extract data from PDF – Basic text extraction is performed to capture invoice content. AI-powered invoice parsing – An AI model interprets the extracted text and structures essential fields such as company name, invoice number, total amount, invoice date, and due date. Save to Google Sheets – The structured invoice data is appended as a new row in a Google Sheet for easy tracking and reporting. Slack confirmation – A summary of the saved invoice details is sent back to Slack to notify the team. How to use Import the workflow into your n8n instance. Connect Slack – Authenticate your Slack account and set up the trigger channel where invoices will be uploaded. Connect Google Sheets – Authenticate with Google Sheets and specify the target spreadsheet and sheet name. Configure the AI extraction – Adjust the parsing prompt or output structure to fit your preferred data fields (e.g., vendor name, invoice ID, amount, dates). Test the workflow – Upload a sample invoice PDF in Slack and verify that the data is correctly extracted and saved to Google Sheets. Requirements An n8n instance (cloud) Slack account with permission to read uploaded files and post messages Google account with access to the spreadsheet you want to update AI integration (e.g., OpenAI GPT or another LLM with PDF parsing capabilities) A designated Slack channel for receiving invoice PDFs
by Jadai kongolo
🚀 n8n Local AI Agentic RAG Template Author: Jadai kongolo What is this? This template provides an entirely local implementation of an Agentic RAG (Retrieval Augmented Generation) system in n8n that can be extended easily for your specific use case and knowledge base. Unlike standard RAG which only performs simple lookups, this agent can reason about your knowledge base, self-improve retrieval, and dynamically switch between different tools based on the specific question. Why Agentic RAG? Standard RAG has significant limitations: Poor analysis of numerical/tabular data Missing context due to document chunking Inability to connect information across documents No dynamic tool selection based on question type What makes this template powerful: Intelligent tool selection**: Switches between RAG lookups, SQL queries, or full document retrieval based on the question Complete document context**: Accesses entire documents when needed instead of just chunks Accurate numerical analysis**: Uses SQL for precise calculations on spreadsheet/tabular data Cross-document insights**: Connects information across your entire knowledge base Multi-file processing**: Handles multiple documents in a single workflow loop Efficient storage**: Uses JSONB in Supabase to store tabular data without creating new tables for each CSV Getting Started Run the table creation nodes first to set up your database tables in Supabase Upload your documents to the folder on your computer that is mounted to /data/shared in the n8n container. This folder by default is the "shared" folder in the local AI package. The agent will process them automatically (chunking text, storing tabular data in Supabase) Start asking questions that leverage the agent's multiple reasoning approaches Customization This template provides a solid foundation that you can extend by: Tuning the system prompt for your specific use case Adding document metadata like summaries Implementing more advanced RAG techniques Optimizing for larger knowledge bases The non-local ("cloud") version of this Agentic RAG agent can be found here.
by Fujii Ryota
Discover and save niche web content to Google Sheets with Kagi and AI How it works A webhook trigger receives a request. The Kagi API token is set and a request is made to Kagi’s enrich endpoint. Raw search results are extracted and split into individual items. Each item is sent to an AI agent for categorisation and scoring, then merged with metadata. The combined data is appended to a Google Sheet and a response is sent back to the webhook caller. Setup steps - [ ] Add your webhook URL to the service that will call this workflow. - [ ] Store your Kagi API token in the workflow’s credentials or set it in the “Set Kagi Token” node. - [ ] Configure the OpenRouter chat model credentials inside the AI Agent sub‑node. - [ ] Connect a Google Sheets credential and specify the target spreadsheet and worksheet in the “Append Row to Sheet” node. Customization Adjust the prompt in the AI Agent node to change how content is categorized or scored, and modify the sheet columns in the Merge Data code if additional fields are needed.
by Shashwat Singh
Overview Stop guessing your agency's actual margins. This workflow acts as a centralized financial brain for digital marketing agencies. It aggregates real-time data from your time-tracking, ad platforms, and payment processors to calculate precise profitability metrics (Gross Profit, Net Margin, ROAS, and Efficiency). It doesn't just crunch numbers; it uses Google Gemini to act as a virtual CFO, analyzing the data and sending an executive summary to Slack with actionable insights, while simultaneously archiving the data to Google Sheets for historical trending. Key Features Multi-Source Aggregation: Pulls data from Facebook Ads, Google Ads, Shopify, Stripe, and Clockify. Smart Cost Allocation: Automatically calculates overhead (default 30%) and software costs against your gross revenue. AI Analysis: Uses Google Gemini to review the calculated metrics and draft a "Human-readable" executive summary for Slack. Dual Output: Sends instant alerts to Slack and logs granular data to Google Sheets. How to Setup 1. Configure Credentials Ensure you have authenticated credentials for: Clockify Stripe & Shopify Facebook Marketing API & Google Ads Google Sheets & Google Gemini (PaLM) Slack 2. Prepare Google Sheet Create a new Google Sheet with the following headers in Row 1: timestamp, date, totalRevenue, totalAdSpend, facebookAdSpend, googleAdSpend, totalTimeCost, grossProfit, profitMargin, roas. 3. Adjust Logic Configuration Open the "Code in JavaScript" node. At the very top, you will see a CONFIG object. Edit these values to match your agency's model: const CONFIG = { platformFeeRate: 0.029, // Stripe/Shopify fees monthlySoftwareCosts: 500, // Fixed monthly SaaS costs overheadRate: 0.30, // Overhead % (rent, admin, etc) minProfitMargin: 20 // Target margin % }; 4. Remove Mock Data The template includes "Set" nodes with mock data for testing purposes. Simply bypass these nodes and connect the API nodes directly to the "Merge" node when you are ready to go live.
by Takuya Ojima
Who’s it for Teams that monitor multiple news sources and want an automated, tagged, and prioritized briefing—PMM, PR/Comms, Sales/CS, founders, and research ops. What it does / How it works Each morning the workflow reads your RSS feeds, summarizes articles with an LLM, assigns tags from a maintained dictionary, saves structured records to Notion, and posts a concise Slack digest of top items. Core steps: Daily Morning Trigger → Workflow Configuration (Set) → Read RSS Feeds → Get Tag Dictionary → AI Summarizer and Tagger → Parse AI Output → Write to Notion Database → Sort by Priority → Top 3 Headlines → Format Slack Message → Post to Slack. How to set up Open Workflow Configuration (Set) and edit: rssFeeds (array of URLs), notionDatabaseId, slackChannel. Connect your own credentials in n8n for Notion, Slack, Google Sheets (if used for the tag dictionary), and your LLM provider. Adjust the trigger time in Daily Morning Trigger (e.g., weekdays at 09:00). Requirements n8n (Cloud or self-hosted) Slack app with chat:write to the target channel Notion database with properties: summary (rich_text), tags (multi_select), priority (number), url (url), publishedDate (date) Optional Google Sheet for the tag dictionary (or replace with another source) How to customize the workflow Scoring & selection: Change priority rules, increase “Top N” items, or sort by recency. Taxonomy: Extend the tag dictionary; refine the AI prompt for stricter tagging. Outputs: Post per-tag Slack threads, send DMs, or create Notion relations to initiatives. Sources: Add more feeds or mix in APIs/newsletters. Security: Do not hardcode API keys in HTTP nodes; keep credentials in n8n.
by Avkash Kakdiya
How it works This workflow starts whenever a new domain is added to a Google Sheet. It cleans the domain, fetches traffic insights from SimilarWeb, extracts the most relevant metrics, and updates the sheet with enriched data. Optionally, it can also send this information to Airtable for further tracking or analysis. Step-by-step Trigger on New Domain Workflow starts when a new row is added in the Google Sheet. Captures the raw URL/domain entered by the user. Clean Domain URL Strips unnecessary parts like http://, https://, www., and trailing slashes. Stores a clean domain format (e.g., example.com) along with the row number. Fetch Website Analysis Uses the SimilarWeb API to pull traffic and engagement insights for the domain. Data includes global rank, country rank, category rank, total visits, bounce rate, and more. Extract Key Metrics Processes raw SimilarWeb data into a simplified structure. Extracted insights include: Ranks: Global, Country, and Category. Traffic Overview: Total Visits, Bounce Rate, Pages per Visit, Avg Visit Duration. Top Traffic Sources: Direct, Search, Social. Top Countries (Top 3): With traffic share percentages. Device Split: Mobile vs Desktop. Update Google Sheet Writes the cleaned and enriched domain data back into the same (or another) Google Sheet. Ensures each row is updated with the new traffic insights. Export to Airtable (Optional) Creates a new record in Airtable with the enriched traffic metrics. Useful if you want to manage or visualize company/domain data outside of Google Sheets. Why use this? Automatically enriches domain lists with live traffic data from SimilarWeb. Cleans messy URLs into a standard format. Saves hours of manual research on company traffic insights. Provides structured, comparable metrics for better decision-making. Flexible: update sheets, export to Airtable, or both.