n8n

How to Automate Telegram DeepSeek Support with Google Docs Memory?

Give your team instant replies on Telegram with an AI helper that remembers past chats. Incoming messages get answered fast, while key details are stored for future conversations. Ideal for support lines, product FAQs, and busy teams that want faster help without extra staff.

Messages arrive through a Telegram webhook and pass a user and chat ID check. A router only sends text to the AI path and returns a clear error for unsupported types. The agent uses DeepSeek models to write helpful replies, keeps short term context with a memory window, and reads long term notes from Google Docs. It can also write new facts back to Google Docs, so future chats feel personal. A merge step combines the user message with retrieved notes before the agent runs. Replies go straight back to Telegram, and an error path handles failures. A chat trigger is also present for n8n chat testing.

You will need a Telegram bot, a Google account, and a DeepSeek API key. Set the Telegram webhook and verify it, connect Google Docs, and select your memory document. Teams can cut manual replies, keep a living memory of customers, and scale support as chat volume grows. Expect faster response times, fewer mistakes, and more consistent service across shifts.

What are the key features?

  • Telegram webhook intake listens for messages and passes clean data to the flow.
  • If node checks user and chat ID to restrict access and reduce spam.
  • Switch router sends only text to the AI and gives a clear error for unsupported types.
  • Google Docs retrieval loads long term memories to personalize replies.
  • Merge node combines the current message with retrieved notes before generation.
  • AI Agent uses DeepSeek V3 or R1 models to craft useful replies.
  • Window buffer memory keeps recent conversation context for better answers.
  • Google Docs tool can save new memories from each chat for future use.
  • Telegram response node sends the final answer and a separate error path handles failures.

What are the benefits?

  • Reduce manual replies from 2 hours per day to 10 minutes
  • Answer common questions in seconds with consistent messages
  • Handle up to 5 times more chats without adding staff
  • Keep customer notes in Google Docs for long term memory
  • Cut copy and paste errors by up to 90 percent
  • Connect Telegram, DeepSeek, and Google Docs in one flow

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Telegram, Google Docs and DeepSeek. See the Tools Required section above for links to create accounts with these services.
  3. Create a Telegram bot with BotFather and copy the bot token.
  4. In the n8n credentials manager, create a Telegram credential. Double click any Telegram node, choose the 'Credential to connect with' dropdown, click 'Create new credential', paste your bot token, and save.
  5. Open the Listen for Telegram Events node, copy the webhook URL shown by n8n, then set the webhook using the Telegram API setWebhook endpoint. Verify the setup with getWebhookInfo to confirm it is active.
  6. Check that the Telegram Response node maps chatId to {{$json.body.message.chat.id}} so replies go back to the right chat.
  7. In the n8n credentials manager, create a Google Docs OAuth2 credential. Double click the Retrieve Long Term Memories and Save Long Term Memories nodes, choose 'Create new credential', sign in to Google, and grant access.
  8. Create or choose a Google Doc to store memory. In the Google Docs nodes, select this document so the agent can read and write notes.
  9. Create a DeepSeek API key from the DeepSeek platform. In n8n, create an OpenAI type credential, set the base URL to https://api.deepseek.com or https://api.deepseek.com/v1, paste your API key, and save. Select this credential in the DeepSeek nodes.
  10. Open the AI Agent node and confirm the selected language model is your DeepSeek node. Ensure the Google Docs Tool is added so the agent can save long term memories.
  11. Set the Window Buffer Memory node to use a stable session key, such as the user or chat ID, to keep short term context.
  12. Adjust the Check User & Chat ID conditions to allow only approved chat IDs or users. Update the Message Router rules if you want to handle audio or other message types differently.
  13. Test by sending a text message to your Telegram bot. If you see no reply, check n8n execution logs, confirm the webhook status in getWebhookInfo, verify Google Docs access, and confirm the DeepSeek API key is valid.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

DeepSeek

Sign up

$0.035/1M input tokens (cache hit), $0.135/1M input tokens (cache miss), $0.550/1M output tokens

Google Docs

Sign up

Free: $0, Google Docs API usage at no additional cost (quota limits apply)

Telegram

Sign up

Free: $0, Telegram Bot API usage is free for developers

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.