Deploy a powerful n8n workflow that connects Telegram to a DeepSeek AI Agent, featuring long-term memory storage via Google Docs using specialized n8n templates and custom n8n nodes.
Download this n8n workflow template and start using it instantly.
Developers and power users looking to implement sophisticated AI chat agents.
Anyone needing an n8n solution for persistent memory in conversational AI.
Users deploying Telegram bots that require customized, multi-turn context retention.
Organizations utilizing DeepSeek models via OpenAI-compatible API setups.
This complex n8n workflow addresses the challenge of creating a conversational AI that remembers past interactions over time—a key limitation of standard LLM calls. By leveraging a specific n8n trigger (Telegram Webhook) and integrating Google Docs as a long-term knowledge base, this n8n template empowers a DeepSeek Agent to retrieve and store personalized user data. The custom system prompt guides the AI to use the Save Memory tool when important information is shared, ensuring a personalized and contextually aware user experience within Telegram. This specialized n8n node setup is ideal for building highly reliable and stateful chatbots.
Listen for Telegram Events n8n trigger, capturing incoming messages via a webhook on the /wbot path.Validation set n8n node is followed by the Check User & Chat ID if n8n node, restricting access only to a predefined user based on name and ID for security.Message Router switch n8n node, while non-text inputs result in an error response.Retrieve Long Term Memories Google Docs n8n node fetches the current long-term context associated with the user from the specified document.Merge n8n node.AI Agent n8n node. This agent operates under a detailed system prompt, utilizing the memory context to decide its response and whether to employ the Save Long Term Memories tool. The agent uses a DeepSeek Language Model (DeepSeek-V3 Chat).Save Long Term Memories Google Docs Tool n8n node inserts a new, summarized memory entry into the dedicated document, thus updating the long-term memory for this n8n workflow.Telegram Response n8n node, completing the automation cycle.https://api.deepseek.com/v1) as noted in the sticky note.Validation set n8n node to include the exact firstname, lastname, and numerical id of the authorized Telegram user.documentURL parameter in both the Retrieve Long Term Memories and Save Long Term Memories n8n nodes with the actual ID or URL of your dedicated Google Doc memory file.Listen for Telegram Events n8n trigger (Path: /wbot). Listen for Telegram Events (Webhook n8n trigger): The initial n8n node that acts as the webhook listener for incoming messages from the Telegram Bot API.
Validation (Set n8n node): Hardcodes the authorized user's personal details (firstname, lastname, and id) to ensure only authorized individuals can interact with the bot.
Check User & Chat ID (If n8n node): Compares the incoming Telegram sender details against the hardcoded validation data. It stops the n8n workflow if the user is unauthorized, directing them to an error message.
Retrieve Long Term Memories (Google Docs n8n node): Reads the entire contents of the specified Google Doc. This content is injected directly into the AI agent's system prompt as historical context.
AI Agent (LangChain Agent n8n node): The core intelligence of the n8n workflow. It is configured with a complex system prompt defining its persona and rules, receives context from retrieved memory, and has the ability to use the Google Docs Tool to save new memories.
DeepSeek-V3 Chat (LM Chat OpenAI n8n node): Configured as the underlying large language model for the agent (using the deepseek-chat model name), leveraging the OpenAI-compatible n8n node for execution.
Save Long Term Memories (Google Docs Tool n8n node): An agent tool accessible to the AI. When the AI determines information is noteworthy, it uses this tool to insert a new, timestamped memory entry into the Google Doc, facilitating long-term recall.
Telegram Response (Telegram n8n node): Sends the final, contextually aware response generated by the AI agent back to the originating Telegram chat, completing the n8n workflow execution.
Learn how to integrate DeepSeek V3 Chat and R1 Reasoner models using this advanced n8n workflow. Includes examples for Ollama, LangChain nodes, and raw HTTP requests for high-performance AI automation.

Automate European Union event data collection using this powerful n8n workflow. Scrape website content, handle pagination, and store only unique records in Google Sheets daily. Use this n8n template for reliable data extraction.

Build an expert AI Real Estate Agent using a sophisticated n8n workflow. This automation integrates Langchain nodes with Bright Data to perform real-time property searches and data extraction based on conversational input. Deploy powerful n8n templates for advanced agent functionality.

An advanced n8n workflow template for automating fish feeding based on BMKG (weather agency) forecasts. This n8n node solution adjusts feed quantity via an ESP8266 microcontroller and sends real-time Telegram alerts.

Use this advanced n8n workflow to deploy an AI Agent that handles pet shop appointments, RAG knowledge retrieval, and payment confirmations seamlessly through WhatsApp using the Evolution API.

A robust n8n workflow for a Pet Shop AI assistant automating multi-channel customer service (WhatsApp, Instagram, Facebook), lead management, payment processing, delivery calculation, and RAG knowledge base updates using GPT-4o.


As an AI Automation consultant based in Canada, I partner with forward-thinking organizations to implement AI solutions that streamline operations and drive growth.







































