WhatsApp RAG chatbot with Supabase, Gemini 2.5 Flash, and OpenAI embeddings
WhatsApp RAG Chatbot with Supabase, Gemini 2.5 Flash, and OpenAI Embeddings This n8n template demonstrates how to build a WhatsApp-based AI chatbot that answers user questions using document retrieval (RAG) powered by Supabase for storage, OpenAI embeddings for semantic search, and Gemini 2.5 Flash LLM for generating high-quality responses. Use cases are many: Turn your WhatsApp into a knowledge assistant for FAQs, customer support, or internal company documents — all without coding. --- Good to know The workflow uses OpenAI embeddings for both document embeddings and query embeddings, ensuring accurate semantic search. Gemini 2.5 Flash LLM is used to generate user-friendly answers from the retrieved context. Messages are processed in real-time and sent back directly to WhatsApp. Workflow is modular — you can split document ingestion and query handling for large-scale setups. Supabase and WhatsApp API credentials must be configured before running. --- How it works Trigger: A new WhatsApp message triggers the workflow via webhook. Message Check: Determines if the message is a query or a document upload. Document Handling: Fetch file URL from WhatsApp. Convert binary to text. Generate embeddings with OpenAI and store them in Supabase. Query Handling: Generate query embeddings with OpenAI. Retrieve relevant context from Supabase. Pass context to Gemini 2.5 Flash LLM to compose a response. Response: Send the answer back to the user on WhatsApp. Optional: Add Gmail node to forward chat logs or daily summaries. --- How to use Configure WhatsApp Business API webhook for incoming messages. Add your Supabase and OpenAI credentials in n8n’s credentials manager. Upload documents via WhatsApp to populate the Supabase vector store. Ask queries — the bot retrieves context and answers using Gemini 2.5 Flash. --- Requirements WhatsApp Business API (or Twilio WhatsApp Sandbox) Supabase account (vector storage for embeddings) OpenAI API key (for generating embeddings) Gemini API access (for LLM responses) --- Customising this workflow Swap WhatsApp with Telegram, Slack, or email for different chat channels. Extend ingestion to other sources like Google Drive or Notion. Adjust the number of retrieved documents or prompt style in Gemini for tone control. Add a Gmail output node to send logs or alerts automatically.
Chat with your event schedule from Google Sheets in Telegram
What it is Chat with your event schedule from Google Sheets in Telegram: "When is the next meetup?" "How many events are there next month?" "Who presented most often?" "Which future meetups have no presenters yet?" This workflow lets you chat with a telegram bot about past, present and future events that are scheduled in a Google Spreadsheet. (Info: This proof-of-concept was created as a demo for a hackathon of an AI & Developer Meetup in Da Nang (Vietnam) that uses a telegram group to organize) Who it is for If you want an easy way for your audience to get information about your events, you can us this workflow for the same purpose, or easily adapt it to your needs and different use-cases where you want to query smaller amounts of tabular data in natural language. How it works Upon getting triggered by a chat message to a telegram bot, the schedule of meetups is retrieved from Google Spreadsheets, converted into a markdown table syntax and fed into the system prompt of an LLM (we're using OpenRouter in this example), whose output is posted back as answer into the same telegram chat. Setup steps TO REVIEWING IN ACTION As the reviewer of this workflow, you can temporarily use it via an existing telegram bot, simply point your telegram client to https://t.me/AiDaNangBot and start to ask questions like: "When is the next meetup?" "What future meetings do not have presenters?" "Who presented on Future of Human Relationships?" To build upon this workflow: Import the workflow Customize the Google Docs credentials for your individual access Create a telegram bot and connect it to the workflow by entering its API token into the credentials used in the telegram trigger node In the "Settings" node, replace the "scheduleURL" with the URL of your own copy of the Google Spreadsheet or a copy of the Event Schedule Template Sheet to spin off your own – whereby the structure of the spreadsheet doesn't matter, it's just important that you semantically structure your information in dedicated columns clearly labeled in the header row.
Daily weather reports with OpenWeatherMap and Telegram Bot
Get automated weather updates delivered directly to your Telegram chat at scheduled intervals. This workflow fetches current weather data from OpenWeatherMap and sends formatted weather reports via a Telegram bot. Use Cases Daily morning weather briefings Regular weather monitoring for outdoor activities Automated weather alerts for specific locations Personal weather assistant for travel planning Prerequisites Before setting up this workflow, ensure you have: An OpenWeatherMap API account (free tier available) A Telegram bot token Your Telegram chat ID n8n instance (cloud or self-hosted) Setup Instructions Step 1: Create OpenWeatherMap Account Go to OpenWeatherMap and sign up for a free account Navigate to the API keys section in your account Copy your API key (you'll need this for the workflow configuration) Step 2: Create Telegram Bot Open Telegram and search for @BotFather Start a chat and use the /newbot command Follow the prompts to create your bot and get the bot token Save the bot token securely Step 3: Get Your Telegram Chat ID Start a conversation with your newly created bot Send any message to the bot Visit https://api.telegram.org/bot<YourBOTToken>/getUpdates in your browser Look for your chat ID in the response (it will be a number like 123456789) Step 4: Configure the Workflow Import this workflow into your n8n instance Configure each node with your credentials: Schedule Trigger Node Set your preferred schedule (default: daily at 8:00 AM) Use cron expression format (e.g., 0 8 * for 8 AM daily) Get Weather Node Add your OpenWeatherMap credentials Update the cityName parameter to your desired location Format: "CityName,CountryCode" (e.g., "London,UK") Send a text message Node Add your Telegram bot credentials (bot token) Replace XXXXXXX in the chatId field with your actual chat ID Customization Options Location Settings In the "Get Weather" node, modify the cityName parameter to change the location. You can specify: City name only: "Paris" City with country: "Paris,FR" City with state and country: "Miami,FL,US" Schedule Frequency In the "Schedule Trigger" node, adjust the cron expression: Every 6 hours: 0 /6 Twice daily (8 AM & 6 PM): 0 8,18 * Weekly on Mondays at 9 AM: 0 9 1 Message Format In the "Format Weather" node, you can customize the message template by modifying the message variable in the function code. Current format includes: Current temperature with "feels like" temperature Min/max temperatures for the day Weather description and precipitation Wind speed and direction Cloud coverage percentage Sunrise and sunset times Language Support In the "Get Weather" node, change the language parameter to get weather descriptions in different languages: English: "en" Spanish: "es" French: "fr" German: "de" Polish: "pl" Troubleshooting Common Issues Weather data not updating: Verify your OpenWeatherMap API key is valid and active Check if you've exceeded your API rate limits Ensure the city name format is correct Messages not being sent: Confirm your Telegram bot token is correct Verify the chat ID is accurate (should be a number, not username) Make sure you've started a conversation with your bot Workflow not triggering: Check if the workflow is activated (toggle switch should be ON) Verify the cron expression syntax is correct Ensure your n8n instance is running continuously Testing the Workflow Use the "Test workflow" button to run manually Check each node's output for errors Verify the final message format in Telegram Node Descriptions Schedule Trigger Automatically starts the workflow based on a cron schedule. Runs at specified intervals to fetch fresh weather data. Get Weather Connects to OpenWeatherMap API to retrieve current weather conditions for the specified location. Format Weather Processes the raw weather data and creates a user-friendly message with emojis and organized information. Send a text message Delivers the formatted weather report to your Telegram chat using the configured bot. Additional Features You can extend this workflow by: Adding weather alerts for specific conditions (temperature thresholds, rain warnings) Including weather forecasts for multiple days Sending reports to multiple chat recipients Adding location-based emoji selection Integrating with other notification channels (email, Slack, Discord) Security Notes Keep your API keys and bot tokens secure Don't share your chat ID publicly Consider using n8n's credential system for storing sensitive information Regularly rotate your API keys for better security Special thanks to Arkadiusz, the only person who supports me in n8n mission to make automation great again.