This workflow corresponds to n8n.io template #6250 — we link there as the canonical source.
This workflow follows the Agent → Documentdefaultdataloader 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 →
{
"name": "My workflow",
"tags": [],
"nodes": [
{
"id": "3c701a7e-738e-44d4-af9b-c3629d0e471e",
"name": "Recursive Character Text Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
760,
920
],
"parameters": {
"options": {},
"chunkOverlap": 100
},
"typeVersion": 1
},
{
"id": "51a61f7f-610b-4cda-8405-11983fec7c8a",
"name": "Default Data Loader",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
780,
740
],
"parameters": {
"options": {},
"dataType": "binary",
"binaryMode": "specificField"
},
"typeVersion": 1
},
{
"id": "805a12e8-2d85-4951-929c-76df85ad4e0f",
"name": "Simple Vector Store",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"position": [
700,
540
],
"parameters": {
"mode": "insert",
"memoryKey": {
"__rl": true,
"mode": "list",
"value": "vector_store_key"
}
},
"typeVersion": 1.2
},
{
"id": "c17de454-87ab-4a69-b129-bf77a5afbb66",
"name": "Embeddings OpenAI",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
620,
740
],
"parameters": {
"options": {}
},
"typeVersion": 1.2
},
{
"id": "14c2ff00-618f-4ea3-aeb8-212aa76d28ef",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1400,
680
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "318ca8eb-0e06-4ba9-bcc2-c57b65254794",
"name": "Answer questions with a vector store",
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
"position": [
1700,
640
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "286f2e2b-1a70-48c8-a619-1e01cacf8cee",
"name": "Simple Vector Store2",
"type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
"position": [
1560,
840
],
"parameters": {
"memoryKey": {
"__rl": true,
"mode": "list",
"value": "vector_store_key"
}
},
"typeVersion": 1.2
},
{
"id": "1603e15d-db26-4174-bb32-0d8f429d3fca",
"name": "Embeddings OpenAI1",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
1540,
980
],
"parameters": {
"options": {}
},
"typeVersion": 1.2
},
{
"id": "c6623fd4-2ccc-4a15-9b10-07024c916eeb",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1840,
840
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "e7c3e7a9-5d38-4dd4-983f-1f4a104f4fe9",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
3200,
1020
],
"parameters": {
"color": 4,
"width": 620,
"height": 920,
"content": "## Google Drive Connection\nTo set up Google Drive OAuth2 credentials in n8n (using the recommended OAuth2 method), follow these steps:\n\n1. Create a Google Cloud Project:\n - Go to the Google Cloud Console.\n - Create a new project or select an existing one.\n\n2. Enable the Google Drive API:\n - In your project, navigate to \u201cAPIs & Services\u201d > \u201cLibrary\u201d.\n - Search for \u201cGoogle Drive API\u201d and enable it.\n\n3. Configure OAuth Consent Screen:\n - Go to \u201cAPIs & Services\u201d > \u201cOAuth consent screen\u201d.\n - Fill in the required fields (app name, user support email, etc.).\n - Add the necessary scopes (for Google Drive, typically https://www.googleapis.com/auth/drive).\n\n4. Create OAuth2 Credentials:\n - Go to \u201cAPIs & Services\u201d > \u201cCredentials\u201d.\n - Click \u201cCreate Credentials\u201d > \u201cOAuth client ID\u201d.\n - Choose \u201cWeb application\u201d.\n - Add the following to \u201cAuthorized redirect URIs\u201d:\n - https://<your-n8n-domain>/rest/oauth2-credential/callback\n - If running locally: http://localhost:5678/rest/oauth2-credential/callback\n\n5. Copy the Client ID and Client Secret.\n \n6. In n8n:\n - Go to \u201cCredentials\u201d and create new credentials for \u201cGoogle Drive OAuth2 API\u201d.\n - Enter the Client ID and Client Secret you copied from Google Cloud.\n - Set the appropriate scopes (e.g., https://www.googleapis.com/auth/drive).\n - Save and connect the credentials.\n\nAfter this, your Google Drive OAuth2 credentials should be set up and ready to use in your n8n workflows.\n\nNote: If you get 403:access denied you need to go back to Google cloud.\n - Go to Audience\n - Add your Email in Test users"
},
"typeVersion": 1
},
{
"id": "fac8b33c-f829-4d39-8eee-c773c93980e6",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
3200,
0
],
"parameters": {
"color": 6,
"width": 620,
"height": 980,
"content": "## \ud83d\udee0\ufe0f Configuration Guide After Importing the Template\n\nOnce you download and import the chatbot template into your n8n instance, follow these steps to configure it properly:\n\n---\n\n### \ud83d\udd11 1. **Set Up Google Drive Credentials**\n\n- Go to **Credentials** in n8n.\n- Create new credentials for **Google Drive OAuth2 API**.\n- Add your **Client ID** and **Client Secret** from Google Cloud Console \n(Follow the Google drive connection guide on the next green note).\n- Make sure to add the redirect URL:\n ```\n https://<your-n8n-domain>/rest/oauth2-credential/callback\n ```\n- Use the created credential in all `Google Drive` nodes.\n---\n\n### \ud83d\udcc1 2. **Set the File or Folder to Load from Google Drive**\n\n- All the `Google Drive` node (except Download Files node):\n - Set the file name or folder name to search for.\n- In the `Google Drive Download Files` node:\n - Map the file ID from the search result using expressions like:\n ```\n {{$json[\"id\"]}}\n ```\n---\n\n### \ud83d\udd10 3. **Connect Your OpenAI Credentials**\n\n- Create a new credential in n8n for **OpenAI API**.\n- Paste your OpenAI API key.\n- Use this credential in:\n - `Embeddings OpenAI` node\n - `OpenAI Chat Model` node\n - `Answer questions with a vector store`\n\n---"
},
"typeVersion": 1
},
{
"id": "6bbd55eb-29bb-4322-83a8-ebb46292802b",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
2540,
0
],
"parameters": {
"width": 620,
"height": 520,
"content": "# \ud83e\udd16 Simple AI Chatbot Using Google Drive Knowledge in n8n\n\nThis guide explains how to use an **AI chatbot powered by OpenAI**, where the knowledge comes from files (like PDFs, text, etc.) stored in **Google Drive**. No coding needed!\n\n---\n\n## \ud83d\udccc What This Workflow Does\n\n- Automatic file updates from Google Drive \n- Converts it into a searchable knowledge base (vector store)\n- Allows users to chat and ask questions about that file\n- AI replies based **only** on the content in your file!\n\n---"
},
"typeVersion": 1
},
{
"id": "3a3ff629-4664-4b11-8de0-56eeb236044e",
"name": "Download Files",
"type": "n8n-nodes-base.googleDrive",
"position": [
500,
540
],
"parameters": {
"fileId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.id }}"
},
"options": {},
"operation": "download"
},
"typeVersion": 3
},
{
"id": "79414561-32d3-4d1c-924f-341ce16aeb76",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
0
],
"parameters": {
"color": 3,
"width": 1080,
"height": 1160,
"content": "\n### \ud83e\udde9 PART 1: **File Upload and Knowledge Preparation**\n\n| Node | What It Does |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83d\udcc2 File created in the Folder | Triggered when a new file is uploaded to Google Drive |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83d\udcc2 File updated in the Folder | Triggered when an existing file is updated |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83d\udd0d Search Files in your Google Drive | Finds the new or updated file |\n|----------------------------------------------|--------------------------------------------------------------|\n| \u2b07\ufe0f Download Files | Downloads the actual content of the file |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83e\udde0 Embeddings OpenAI | Converts file into searchable AI vectors |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83d\udcc4 Default Data Loader | Loads document into chunks |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83d\udd01 Recursive Character Text Splitter | Splits large documents into clean text blocks |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83e\uddca Simple Vector Store | Stores the vectors for AI retrieval later |\n"
},
"typeVersion": 1
},
{
"id": "d64086c3-31bb-4876-8652-df1c287f4a53",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1120,
0
],
"parameters": {
"color": 5,
"width": 1380,
"height": 1160,
"content": "### \ud83e\udde0 PART 2: **AI Chatbot for Question Answering**\n\n| Node | What It Does |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83c\udf10 Webhook | Receives incoming question requests from external apps |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83d\udcdd Edit Fields | Maps and formats incoming user data |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83e\udd16 AI Agent | Core logic and decision-making engine |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83d\udd01 Window Buffer Memory | Maintains conversation memory |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83e\uddca Simple Vector Store2 | Retrieves stored file knowledge |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83d\udcda Answer questions with vector store | Searches relevant parts of the uploaded file |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83d\udcac OpenAI Chat Model(s) | Generates AI response |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83d\udd0e Is AI Agent output exist? | Conditional check to ensure a valid reply |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83d\udd10 Token Authentication | Validates that the request is authorized |\n|----------------------------------------------|--------------------------------------------------------------|\n| \ud83d\udce4 Send to Chat App | Sends response back to user via external platform |\n"
},
"typeVersion": 1
},
{
"id": "0eeeddda-95e7-46a2-8c0a-d09b1da5ecf1",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
1160,
440
],
"parameters": {
"path": "bfb0e32d-659b-4fc5-a7a3-695c55137855",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 2
},
{
"id": "6428ae4e-6702-4776-9430-6c808b1588df",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
1340,
440
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "e2a61b06-dc33-4c30-8197-cf6de3dc4a5d",
"name": "chatInput",
"type": "string",
"value": "={{ $json.body.Data.ChatMessage.Content }}"
},
{
"id": "fc96dfe9-cc87-4004-b812-cb1fa84e7f67",
"name": "sessionId",
"type": "string",
"value": "={{ $json.body.Data.ChatMessage.RoomId }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "5bb23164-475f-45ee-a1c7-59ca9600a07a",
"name": "Is AI Agent output exist?",
"type": "n8n-nodes-base.code",
"position": [
1860,
440
],
"parameters": {
"jsCode": "const ai = items.find(i => i.json.output);\nconst fallback = \"Sorry, I didn\u2019t understand your message. Please try again or send a text.\";\n\nreturn [\n {\n json: {\n content: ai?.json.output || fallback\n }\n }\n];"
},
"typeVersion": 2
},
{
"id": "bb54bb65-8bf0-440f-9479-da920e2a8da3",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1520,
440
],
"parameters": {
"options": {
"systemMessage": "You are a friendly and well-informed customer support specialist for Venio, a third-party multichannel messaging platform. Stay factual. You must answer the user's question using only the information provided in the document content below. Do not invent or guess information outside the context. Remember to ensure the answer is correct refer to the file.\n\nYour task is to answer customer questions clearly, patiently, and in a warm, supportive tone.\n\nDo not to say feel free to ask or something like that"
}
},
"typeVersion": 2
},
{
"id": "4b847538-28d1-4e61-ba01-89d46e74fc24",
"name": "Token Authentication",
"type": "n8n-nodes-base.httpRequest",
"position": [
2080,
440
],
"parameters": {
"url": "<Your-Token-Url>",
"method": "POST",
"options": {
"redirect": {
"redirect": {}
}
},
"sendBody": true,
"contentType": "form-urlencoded",
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "grant_type",
"value": "client_credentials"
},
{
"name": "client_id",
"value": "<Your-Client-Id>"
},
{
"name": "client_secret",
"value": "<Your-Client-Secret>"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "Ocp-Apim-Subscription-Key",
"value": "<Your-Subscription-Key>"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "1aa5a0b5-304f-43ac-9119-13938c815010",
"name": "Send to Chat App",
"type": "n8n-nodes-base.httpRequest",
"position": [
2300,
440
],
"parameters": {
"url": "<Your-Chat-Url>",
"method": "POST",
"options": {
"redirect": {
"redirect": {}
}
},
"sendBody": true,
"sendHeaders": true,
"bodyParameters": {
"parameters": [
{
"name": "roomId",
"value": "={{ $('Webhook').item.json.body.Data.ChatMessage.RoomId }}"
},
{
"name": "content",
"value": "={{ $('Is AI Agent output exist?').item.json.content }}"
},
{
"name": "type",
"value": "message"
},
{
"name": "platform",
"value": "={{ $('Webhook').item.json.body.Data.ChatMessage.Platform }}"
},
{
"name": "companyId",
"value": "={{ $('Webhook').item.json.body.Data.ChatMessage.User.CompanyId }}"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "=Bearer {{ $json.access_token }}"
},
{
"name": "Ocp-Apim-Subscription-Key",
"value": "<Your-Subscription-Key>"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "01d71fdf-4979-4478-a480-a0d15de8dab5",
"name": "File created in the Folder",
"type": "n8n-nodes-base.googleDriveTrigger",
"position": [
80,
460
],
"parameters": {
"event": "fileCreated",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"mode": "list",
"value": "<INSERT-YOUR-FOLDER-ID>.",
"cachedResultUrl": "",
"cachedResultName": ""
}
},
"typeVersion": 1
},
{
"id": "a2cf29ab-fa4d-4185-9a0d-eb22e04bf836",
"name": "File updated in the Folder",
"type": "n8n-nodes-base.googleDriveTrigger",
"position": [
80,
660
],
"parameters": {
"event": "fileUpdated",
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "specificFolder",
"folderToWatch": {
"__rl": true,
"mode": "list",
"value": "<INSERT-YOUR-FOLDER-ID>.",
"cachedResultUrl": "",
"cachedResultName": ""
}
},
"typeVersion": 1
},
{
"id": "f8c00b8a-13da-451a-855c-ccc424fd56c1",
"name": "Search Files in your Google Drive Folder",
"type": "n8n-nodes-base.googleDrive",
"position": [
300,
540
],
"parameters": {
"filter": {
"driveId": {
"__rl": true,
"mode": "list",
"value": "My Drive",
"cachedResultUrl": "",
"cachedResultName": ""
},
"folderId": {
"__rl": true,
"mode": "list",
"value": "<INSERT-YOUR-FOLDER-ID>.",
"cachedResultUrl": "",
"cachedResultName": ""
}
},
"options": {},
"resource": "fileFolder"
},
"typeVersion": 3
},
{
"id": "a4f972ff-d5cb-4ac0-ad79-a7a582b2d4c3",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
1560,
680
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "0df89f09-5e2b-4242-a276-10c48df7f1c5",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
2540,
560
],
"parameters": {
"color": 2,
"width": 620,
"height": 1380,
"content": "---\n\n### \ud83c\udf10 Webhook URL Customization (Important)\n\nWhen you create a **Webhook node** in n8n, it automatically generates a unique URL for receiving data.\n\n\u2705 **You do not need to delete or manually change this URL**, but you can customize the **path** if needed.\n\nFor example:\n```\nhttps://your-n8n-domain/webhook/my-ai-chatbot\n```\n\n\ud83d\udccc You can:\n- Click on the **Webhook node**\n- Set a **Custom Path** in the **HTTP Method + Path** section\n- Use this custom URL in external tools, forms, or apps to send questions to the chatbot\n\nThis makes integration more user-friendly and consistent with your platform naming.\n\n> \u2728 Tip: Keep the path short and meaningful, like `/webhook/ask-YOUR_OPENAI_KEY_HERE` or `/webhook/hr-bot`.\n\n---\n---\n\n### \ud83d\udd10 Token Authentication & Send to Chat App \u2013 URL Notes\n\nIn the following nodes, you also have to deal with URLs that should be customized for your system:\n\n---\n#### \u2705 Token Authentication Node\n\n- This node is used to **verify incoming requests** to ensure only authorized apps/users can interact with the chatbot.\n- Typically, you'll compare a token (e.g., from headers or body) against a stored secret or environment variable.\n- You **do not need to hardcode the webhook URL** inside this node, but you can **define expected token values** per integration.\n\n> \u2728 If you're calling the chatbot from external services, make sure they **include the token** in the correct format.\n---\n\n#### \ud83d\udce4 Send to Chat App Node\n\n- This is the final step where the chatbot sends the answer back to your front-end, bot, or chat system.\n- **Make sure to customize the target URL** where the answer should be posted.\n\nFor example:\n```\nhttps://your-frontend.com/api/chat-response\n```\n\n\u2705 Best Practice:\n- Use an environment variable or a `Set` node to define the target base URL.\n- This makes it easy to update without modifying the entire workflow.\n\n> \ud83d\udca1 You can also dynamically route messages using user ID or channel info in the webhook payload.\n\n---\n"
},
"typeVersion": 1
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "",
"connections": {
"Webhook": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Is AI Agent output exist?",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Download Files": {
"main": [
[
{
"node": "Simple Vector Store",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Simple Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Embeddings OpenAI1": {
"ai_embedding": [
[
{
"node": "Simple Vector Store2",
"type": "ai_embedding",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Answer questions with a vector store",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Simple Vector Store",
"type": "ai_document",
"index": 0
}
]
]
},
"Simple Vector Store2": {
"ai_vectorStore": [
[
{
"node": "Answer questions with a vector store",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Token Authentication": {
"main": [
[
{
"node": "Send to Chat App",
"type": "main",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Is AI Agent output exist?": {
"main": [
[
{
"node": "Token Authentication",
"type": "main",
"index": 0
}
]
]
},
"File created in the Folder": {
"main": [
[
{
"node": "Search Files in your Google Drive Folder",
"type": "main",
"index": 0
}
]
]
},
"File updated in the Folder": {
"main": [
[
{
"node": "Search Files in your Google Drive Folder",
"type": "main",
"index": 0
}
]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Answer questions with a vector store": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Search Files in your Google Drive Folder": {
"main": [
[
{
"node": "Download Files",
"type": "main",
"index": 0
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This comprehensive n8n workflow template creates an intelligent AI chatbot that automatically transforms your Google Drive documents into a searchable knowledge base. The chatbot uses OpenAI's GPT models to provide accurate, context-aware responses based exclusively on your…
Source: https://n8n.io/workflows/6250/ — 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.
Camila IA. Uses postgres, crypto, redis, agent. Webhook trigger; 92 nodes.
Hi! I’m Amanda, a creator of intelligent automations using n8n and Make. I’ve been building AI-powered workflows for over 2 years, always focused on usability and innovation. This one here is very spe
This workflow automates customer support across multiple channels (Email, Live Chat, WhatsApp, Slack, Discord) using AI-powered responses enhanced with Retrieval Augmented Generation (RAG) and your pr
YouTube Agent. Uses supabase, agent, lmChatAnthropic, outputParserStructured. Webhook trigger; 56 nodes.
AI Multi-Document Analyzer with Smart Recommendations & Reporting