This workflow corresponds to n8n.io template #6017 β we link there as the canonical source.
This workflow follows the Agent β Googledocstool recipe pattern β see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide β
{
"id": "",
"name": "Grok-4 Customer Support Agent [RAG]",
"tags": [],
"nodes": [
{
"id": "c459cd5e-837e-4f32-aef0-af8fd0e2a1e8",
"name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-100,
0
],
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "b1ce2d6d-766c-44be-ba05-15af7ad25826",
"name": "xAI Grok Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok",
"position": [
140,
220
],
"parameters": {
"options": {}
},
"credentials": {
"xAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "034b4be6-f8a0-449f-b4df-6624c0d5419d",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
340,
220
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "a9f303d6-f341-4237-ba4a-b871fd98d0e8",
"name": "Google Docs",
"type": "n8n-nodes-base.googleDocsTool",
"position": [
500,
220
],
"parameters": {
"operation": "get",
"documentURL": "https://docs.google.com/document/d/YOUR_DOC_ID/edit"
},
"credentials": {
"googleDocsOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2
},
{
"id": "4ed55e57-7143-4882-bad7-428e56018d54",
"name": "Grok 4 Customer Support Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
220,
0
],
"parameters": {
"options": {}
},
"typeVersion": 2
},
{
"id": "dc23ec70-fb68-4be0-b9ea-cf84209a607a",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
720,
0
],
"parameters": {
"text": "YOUR_RESPONSE_TEXT",
"chatId": "YOUR_CHAT_ID",
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "e225dc2b-60fb-4892-a752-cd967af3c87d",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-200,
-140
],
"parameters": {
"color": 2,
"height": 540,
"content": "Telegram Trigger"
},
"typeVersion": 1
},
{
"id": "5f23ab98-e24c-4298-90ab-066a1510fea0",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
60,
-140
],
"parameters": {
"color": 3,
"width": 580,
"height": 540,
"content": "Grok-4 Customer Support Agent with Preloaded Doc"
},
"typeVersion": 1
},
{
"id": "febe1849-3b12-4470-b9a0-78ee90b661c3",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
660,
-140
],
"parameters": {
"color": 5,
"width": 280,
"height": 540,
"content": "Telegram Output"
},
"typeVersion": 1
},
{
"id": "9700b7cd-f63e-4573-97de-97f396caa67e",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-800,
-140
],
"parameters": {
"width": 580,
"height": 880,
"content": "\ud83e\udd16 Grok-4 Customer Support Agent with Document-Based Intelligence\nTemplate Description:\nThis workflow creates a smart, AI-powered customer support agent using Grok-4 that can answer questions based on a preloaded Google Doc knowledge base. It listens for incoming customer queries via Telegram, then uses Grok-4\u2019s language reasoning + memory features to generate helpful responses pulled directly from the doc.\n\nWatch the Step-by-Step Tutorial of this Workflow: https://www.youtube.com/watch?v=OXzsh-Ba-8Y&t=2s\n\nIt\u2019s perfect for solopreneurs, startups, or businesses that want to:\nAutomate first-level support\nBuild a Telegram-based knowledge agent\nAnswer FAQs using internal docs (like manuals, policies, product details)\n\n\ud83d\udd0d How It Works:\nTelegram Trigger \u2013 Listens for incoming messages from users\n\nGoogle Docs Tool \u2013 Retrieves a specified doc to serve as the knowledge base\n\nGrok-4 AI Agent \u2013 Uses xAI\u2019s latest LLM with built-in memory and the document as a tool\n\nMemory Buffer \u2013 Keeps track of ongoing context in the conversation\n\nTelegram Reply \u2013 Sends the final response back to the customer\n\n\ud83e\udde0 Tools & Integrations Used:\nxAI Grok-4 Model (via Langchain-compatible node)\n\nGoogle Docs Tool (as a reference knowledge base)\n\nTelegram Bot API (chat interface)\n\nn8n Agent Framework (for chaining memory, model, and tools)\n\n\ud83d\udca1 Use Cases:\nAI-powered FAQ assistant for your product\n\nInternal HR bot answering company policy questions\n\nSupport assistant trained on onboarding documents or technical manuals\n\nPrivate support bot for VIP groups on Telegram\n\n"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "",
"connections": {
"Google Docs": {
"ai_tool": [
[
{
"node": "Grok 4 Customer Support Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "Grok 4 Customer Support Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "Grok 4 Customer Support Agent",
"type": "main",
"index": 0
}
]
]
},
"xAI Grok Chat Model": {
"ai_languageModel": [
[
{
"node": "Grok 4 Customer Support Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Grok 4 Customer Support Agent": {
"main": [
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing β you'll add your own.
googleDocsOAuth2ApitelegramApixAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
π€ Grok-4 Customer Support Agent with Document-Based Intelligence Template [RAG]
Source: https://n8n.io/workflows/6017/ β original creator credit. Request a take-down β
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Chat with your AI agent in Telegram. It remembers important facts about you in Airtable, can transcribe your voice messages, search the web, read and manage Google Calendar, fetch Gmail, and query Not
π€ AI Customer Support Agent with Google Docs Knowledge (Telegram + OpenAI)
ZEP Memory. Uses agent, telegramTrigger, telegram, httpRequest. Event-driven trigger; 29 nodes.
This n8n workflow creates a conversational AI video agent accessible through Telegram. Users chat with a bot to request AI-generated talking-head videos using VEED's MCP tools, then optionally publish
Content Ai Agent. Uses agent, telegramTrigger, memoryBufferWindow, telegram. Event-driven trigger; 28 nodes.