Answer Telegram support questions using Google Docs and Claude Sonnet

Go to Workflow
0 views
Built by thealiilhan thealiilhan
Created on September 05, 2026

Description

Quick overview
This workflow turns a Google Docs knowledge base into a Telegram customer support chatbot using Anthropic Claude, logs each Q&A to Google Sheets, and replies back to the user in Telegram.

How it works
Triggers when a new Telegram message is received by your bot.
Fetches the latest content from a specified Google Docs document to use as the knowledge source.
Combines today’s date, the Google Docs text, and the user’s Telegram question into a single prompt.
Sends the prompt to an Anthropic Claude chat model via an AI Agent with conversation memory keyed by Telegram chat ID.
Generates a timestamp, then records the date, question, answer, chat ID, and username to a Google Sheets spreadsheet.
Cleans the AI response text (for example, flattening Markdown links) and sends the final answer back to the user in Telegram.

Setup
Create a Telegram bot with BotFather, add your Telegram credentials in n8n, and start a chat with the bot so it can receive messages.
Add Google Docs OAuth2 credentials and replace the document URL with your own knowledge base document.
Add an Anthropic API credential and confirm the selected Claude model is available for your account.
Add Google Sheets OAuth2 credentials, set the target spreadsheet, and ensure it has columns for the logged fields (date/question/answer/chatid/username) as mapped in the workflow.

Nodes Used (7)

AI Agent
@n8n/n8n-nodes-langchain.agent
Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic
Code
n8n-nodes-base.code
Google Docs
n8n-nodes-base.googleDocs
Google Sheets
n8n-nodes-base.googleSheets
Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow
Telegram
n8n-nodes-base.telegram