ππ€ 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.
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.
| Node | Category | Type | Operation |
|---|---|---|---|
| Check User & Chat ID | Routing | If | See node parameters |
| Error message | Messaging | Telegram | See node parameters |
| Listen for Telegram Events | Trigger | Webhook | See node parameters |
| Validation | Transform | Edit Fields | See node parameters |
| Message Router | Routing | Switch | See node parameters |
| AI Agent | AI & models | Agent | See node parameters |
| Merge | Transform | Merge | See node parameters |
| Window Buffer Memory | Data store | Memory Buffer Window | See node parameters |
| When chat message received | Trigger | Chat Trigger | See node parameters |
| Telegram Response | Messaging | Telegram | See node parameters |
| Save Long Term Memories | Files / media | Google Docs Tool | update |
| Retrieve Long Term Memories | Files / media | Google Docs | get |
| Response Error message | Messaging | Telegram | See node parameters |
| DeepSeek-R1 Reasoning | AI & models | OpenAI Chat Model | See node parameters |
| DeepSeek-V3 Chat | AI & models | OpenAI Chat Model | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8nβs credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- 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
googleDocsOAuth2ApiopenAiApitelegramApi
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 BotFatherurl_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/v1as 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)