Use this powerful n8n workflow to create a Telegram chatbot integrating multiple AI models via AIMLAPI, complete with daily usage limits tracked in Google Sheets.
Download this n8n workflow template and start using it instantly.
Managing AI usage and providing access to various models often requires complex infrastructure. This comprehensive n8n workflow simplifies the entire process. It transforms a standard Telegram bot into a sophisticated AI access point using AIMLAPI, allowing users to select their desired model using a hashtag (e.g., #openai/gpt-4o).
The core value of this specific n8n workflow lies in its built-in governance: it utilizes the Google Sheets node to track daily requests per user and enforces a strict daily limit (default 5). This prevents unexpected costs and ensures fair usage. By analyzing this powerful n8n template, users can customize the daily limits and easily add new functionalities, making it a foundation for many practical AI automation projects.
This n8n workflow initiates every time a user sends a message to the integrated Telegram bot, starting with the n8n trigger.
📩 Receive Telegram Message n8n trigger captures the incoming text.Get Models Or Process Message? switch node routes the flow. If the user sends /models, the workflow fetches the current list of available models from the AIMLAPI via the HTTP Request n8n node, processes them, and sends a formatted list back.📊 Fetch Usage Logs Google Sheets n8n node retrieves all entries for the current user and current date.🔢 Set Daily Limit n8n node, and the 🚦 Check Limit Exceeded? If n8n node determines if processing can continue.#). If a custom model is found, the 🧠 Generate Msg (AI/ML API | Custom Model) n8n node is used. Otherwise, a default model (GPT-4o in this case) is used.📝 Log Successful Generation Google Sheets n8n node logs the user ID, query, and result for future usage tracking, completing the execution of this n8n workflow.To deploy this expert n8n workflow, follow these setup steps:
📩 Receive Telegram Message n8n trigger and all Telegram action nodes.user_id, date, query, and result. Ensure the Google Sheets n8n node has the necessary OAuth or Service Account permissions to read and append data to this spreadsheet.📩 Receive Telegram Message n8n trigger. Ensure the associated webhook is correctly configured in Telegram's settings, linking it to your n8n instance. 📩 Receive Telegram Message (n8n trigger): This is the crucial starting point, acting as the primary n8n trigger. It listens for message updates from the configured Telegram bot, initiating the entire n8n workflow.
Get Models Or Process Message? (Switch n8n node): Directs the flow based on message content. It checks if the user requested the /models list or a standard prompt.
📊 Fetch Usage Logs (Google Sheets n8n node): Queries the usage spreadsheet, filtering rows by the user's ID and the current date to determine their generation history for limit checking.
🚦 Check Limit Exceeded? (If n8n node): Compares the user's request count (aggregated by the preceding n8n node) against the limit set in the workflow. It decides whether to proceed with AI generation or send a notification.
Group Models By Providers (Code n8n node): Parses the incoming Telegram message text, extracting the custom model_id (e.g., openai/gpt-4o) specified after the initial # symbol, and separates it from the actual prompt message.
🧠 Generate Msg (AI/ML API | Custom Model/GPT-4o) (AIMLAPI n8n node): The core AI processing n8n node. It sends the parsed prompt to the AIMLAPI service, utilizing either a default or user-specified model, depending on the flow path.
Deploy a powerful n8n workflow for a Telegram chatbot that handles text, audio, images, and documents. Uses GPT-4, Supabase RAG, and persistent conversation memory.

Build a powerful, context-aware chatbot using this advanced n8n workflow. Integrates Claude (Anthropic), Supabase Vector Store, and Postgres chat memory for RAG capabilities.

Build a powerful RAG chatbot using an n8n workflow combining OpenAI, Notion database tools, and conversational memory. Use this n8n template for fast deployment of AI knowledge agents.

Use this expert n8n workflow template to build an intelligent, multi-tool AI Agent. Integrates Gemini or OpenAI, memory, weather lookup, and RSS web scraping in a public chat interface.

Deploy a powerful Notion AI assistant using this self-hosted n8n workflow template. Connect Google Gemini to Notion for automated task planning and content updates via a conversational chat interface.








































