← All N8N workflows
AI & researchAgentChat TriggerGoogle DocsGoogle Docs ToolIf

πŸ‹πŸ€– DeepSeek AI Agent + Telegram + LONG TERM Memory 🧠

Configured with Agent, Chat Trigger, Google Docs, Google Docs Tool, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
RoutingCheck User & Chat IDIfMessagingError messageTelegramTriggerListen for TelegramEventsWebhookTransformValidationEdit FieldsRoutingMessage RouterSwitchAI & modelsAI AgentAgentTransformMergeMergeData storeWindow Buffer MemoryMemory Buffer WindowTriggerWhen chat messagereceivedChat TriggerMessagingTelegram ResponseTelegramFiles / mediaSave Long Term MemoriesGoogle Docs ToolFiles / mediaRetrieve Long TermMemoriesGoogle DocsMessagingResponse Error messageTelegramAI & modelsDeepSeek-R1 ReasoningOpenAI Chat ModelAI & modelsDeepSeek-V3 ChatOpenAI Chat Model

Node categories in this workflow

  • Routing
  • Messaging
  • Trigger
  • Transform
  • AI & models
  • Data store
  • Files / media

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and βˆ’ to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Check User & Chat IDRoutingIfSee node parameters
Error messageMessagingTelegramSee node parameters
Listen for Telegram EventsTriggerWebhookSee node parameters
ValidationTransformEdit FieldsSee node parameters
Message RouterRoutingSwitchSee node parameters
AI AgentAI & modelsAgentSee node parameters
MergeTransformMergeSee node parameters
Window Buffer MemoryData storeMemory Buffer WindowSee node parameters
When chat message receivedTriggerChat TriggerSee node parameters
Telegram ResponseMessagingTelegramSee node parameters
Save Long Term MemoriesFiles / mediaGoogle Docs Toolupdate
Retrieve Long Term MemoriesFiles / mediaGoogle Docsget
Response Error messageMessagingTelegramSee node parameters
DeepSeek-R1 ReasoningAI & modelsOpenAI Chat ModelSee node parameters
DeepSeek-V3 ChatAI & modelsOpenAI Chat ModelSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • googleDocsOAuth2Api
  • openAiApi
  • telegramApi

Workflow notes

How to set up a Telegram Bot WebHook

How to set up a Telegram Bot WebHook

WebHook Setup Process

Basic Concept A WebHook allows your Telegram bot to automatically receive updates instead of manually polling the Bot API.

Setup Method To set a WebHook, make a GET request using this URL format:

https://api.telegram.org/bot{my_bot_token}/setWebhook?url={url_to_send_updates_to}

Where:

  • my_bot_token: Your bot token from BotFather
  • url_to_send_updates_to: Your HTTPS endpoint that handles bot updates

Verification To verify the WebHook setup, use:

https://api.telegram.org/bot{my_bot_token}/getWebhookInfo

A successful response looks like:

{
 "ok": true,
 "result": {
 "url": "https://www.example.com/my-telegram-bot/",
 "has_custom_certificate": false,
 "pending_update_count": 0,
 "max_connections": 40
 }
}

This method provides a simple and efficient way to handle Telegram bot updates automatically through webhooks rather than manual polling.

Retrieve Long Term Memories

Retrieve Long Term Memories

Google Docs

Save Long Term Memories

Save Long Term Memories

Google Docs

DeepSeek API Call

DeepSeek API Call

The DeepSeek API uses an API format compatible with OpenAI. By modifying the configuration, you can use the OpenAI SDK or softwares compatible with the OpenAI API to access the DeepSeek API.

https://api-docs.deepseek.com/

Configuration Parameters

| Parameter | Value | |-----------|--------| | base_url | https://api.deepseek.com | | api_key | https://platform.deepseek.com/api_keys |

Important Notes

  • To be compatible with OpenAI, you can also use https://api.deepseek.com/v1 as the base_url. Note that the v1 here has NO relationship with the model's version.

  • The deepseek-chat model has been upgraded to DeepSeek-V3. The API remains unchanged. You can invoke DeepSeek-V3 by specifying model='deepseek-chat'.

  • deepseek-reasoner is the latest reasoning model, DeepSeek-R1, released by DeepSeek. You can invoke DeepSeek-R1 by specifying model='deepseek-reasoner'.

πŸ‹πŸ€– DeepSeek AI Agent + Telegram + LONG TERM Memory 🧠

πŸ‹πŸ€– DeepSeek AI Agent + Telegram + LONG TERM Memory 🧠

Purpose and structure

This folder contains the πŸ‹πŸ€– DeepSeek AI Agent + Telegram + LONG TERM Memory 🧠 workflow. Its executable nodes use agent, chatTrigger, googleDocs, googleDocsTool, if, lmChatOpenAi, memoryBufferWindow, merge, set, switch, telegram, webhook. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

Listen for Telegram Events, When chat message received

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Telegram/2044_Telegram_Googledocs_Automation_Webhook.json MIT; preserve source notices.

Canvas section labels

These name areas of the original canvas; they do not include explanatory instructions.

  • Receive Telegram Message with Webhook
  • Validate Telegram User
  • Process Text Message
  • Save To Current Chat Memory (Optional)

More in AI & research