Deploy an advanced AI chatbot using this n8n workflow. Connect Google Sheets data via a RAG system to answer schedule questions instantly in Telegram using a custom n8n node.
Download this n8n workflow template and start using it instantly.
Event organizers managing schedules in spreadsheets.
Community managers needing an automated Q&A tool.
Developers looking for advanced Langchain and n8n templates integrating RAG.
Users seeking to deploy an intelligent n8n workflow for live chat support.
This robust n8n workflow solves the problem of providing instant, intelligent answers to frequently asked questions about an event schedule. Instead of manually answering queries, this system automatically retrieves the latest schedule data from a Google Sheet, converts it into structured context using a custom n8n node, and feeds it into an advanced AI Agent (powered by Langchain and OpenRouter). The resulting AI bot is accessible directly through Telegram, offering a seamless user experience. This powerful n8n automation eliminates manual lookup time and ensures that users always receive information based on the most current data available in your source Google Sheets. This is a perfect example of utilizing custom logic within an n8n workflow to create practical, real-world solutions. You can easily adapt this n8n template for any data source.
telegramInput n8n trigger or internally via the n8nInput chat trigger (for testing). For Telegram inputs, the SendTyping n8n node provides immediate feedback to the user.telegramChatSettings or n8nChatSettings nodes standardize the user's message and chat ID, setting a unified context variable, including the mode (telegram or n8n).Schedule) to fetch the entire schedule document referenced in the Settings n8n node.ScheduleToMarkdown n8n node executes custom JavaScript code, converting the spreadsheet rows into a clean Markdown table format. This structured data is optimal for providing accurate context to the Large Language Model (LLM).ScheduleBot Langchain Agent n8n node receives the user query, the context (the Markdown schedule), and leverages the Memory n8n node to recall previous conversation turns. It uses the LLM (configured via OpenRouter) to generate a relevant, informed answer about the schedule.SetResponse n8n node. The Switch n8n node checks the stored mode variable to determine the final destination, routing the n8n workflow appropriately.telegramResponse n8n node sends the AI-generated message back to the user's Telegram chat. If the mode is 'n8n', the response is simply displayed via the n8nResponse n8n node (a NoOp).To install this n8n workflow template and begin utilizing this powerful automation, follow these steps:
telegramInput, SendTyping, and telegramResponse n8n nodes.Schedule n8n node.LLM n8n node to use OpenAI or another supported model) to provide the AI processing power.Settings n8n node, update the scheduleURL variable with the public or private sharing URL of your Google Sheets schedule.n8nInput trigger. Telegram Trigger (telegramInput): The starting point for the live chat, serving as the primary n8n trigger. It listens for incoming messages from Telegram users.
Google Sheets (Schedule): Reads all relevant schedule data from the specific Google Sheets document URL defined upstream. Essential for feeding current data into the n8n workflow.
Code (ScheduleToMarkdown): A custom n8n node that uses JavaScript to transform the raw spreadsheet data items into a structured Markdown table string, perfect for context insertion into the LLM system message.
Agent (ScheduleBot): The core AI engine. This Langchain Agent n8n node integrates the user query, the schedule context, and chat history (via the Memory n8n node) to generate intelligent responses. Its system message is dynamically populated with the Google Sheets data.
Memory (Buffer Window Memory): An n8n node that maintains conversation continuity, using the Telegram chat ID (chatId) as the session identifier.
LM Chat (LLM) (OpenRouter): Specifies the large language model used for processing the queries. Configured here via OpenRouter credentials.
Set (SetResponse): Formats the output from the AI agent into a standardized variable (responseMessage) before routing.
Switch: Determines whether the final response should be sent back to Telegram or kept within the n8n environment for testing, routing the n8n workflow appropriately.
Run your private AI conversations locally. This n8n workflow connects a chat trigger to your self-hosted Ollama LLMs, providing secure and customizable local automation.

Use this advanced n8n workflow to build an AI agent that chats with your Google Sheet data using custom tools. Learn how to combine n8n node tools, OpenAI, and Google Sheets for dynamic data access.

Deploy an expert AI Agent using this n8n workflow to query HubSpot Contacts and Deals instantly. Ideal for sales and ops teams using powerful n8n templates.

Deploy a robust n8n workflow that connects an OpenAI Agent (GPT-4) to PostgreSQL data (P&L, Balance Sheets) for real-time, conversational financial analysis. This advanced n8n templates solution streamlines reporting.









































