mirror of
https://github.com/khoaliber/n8nworkflows.xyz.git
synced 2026-04-20 09:05:59 +00:00
1 line
8.8 KiB
JSON
1 line
8.8 KiB
JSON
{"id":"xh1yv1lvCFV3sHhH","meta":{"instanceId":"cb9a1e5321767b6316634728341237e564b2587ab15b74ca0a89eb02a53484d6","templateCredsSetupCompleted":true},"name":"Build Your First Conversational AI Chatbot Agent","tags":[],"nodes":[{"id":"c5a03f02-86fa-42d4-83fd-7966b49f56ff","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[0,0],"parameters":{"options":{}},"typeVersion":2.1},{"id":"5334a310-007f-43a7-9f85-f26c7928f5fd","name":"Sticky Note","type":"n8n-nodes-base.stickyNote","position":[-1472,-32],"parameters":{"width":1072,"height":1392,"content":"# Overview\n\nThis **n8n** workflow listens for incoming chat messages, uses **Google Gemini (PaLM)** via **LangChain** to process or reply, optionally reads a **Google Docs** file if mentioned, and logs both the user input and the AI-generated response into a **Google Sheet**.\n\n## Features\n- Triggered when a chat message is received\n- Uses Google Gemini (PaLM/Gemini Pro) via LangChain Agent\n- Optionally processes a Google Docs document\n- Logs both user and AI messages in a Google Sheet\n- Modular design – easy to customize\n\n## ✅ Requirements\n\n### Tools & Services Needed\n- `n8n` instance (self-hosted or n8n.cloud)\n- Google Gemini API (PaLM or Gemini Pro)\n- Google Sheets and Google Docs access\n- OAuth2 credentials for Google APIs configured in n8n\n\n\n## 🚀 How to Use This Workflow\n### 1. Configure Webhook Chat Trigger\n**Node:** `When chat message received`\n- Connect your chat system (e.g., Telegram, Slack)\n- This node captures the user input message\n\n### 2. (Optional) Handle Google Docs Input\n\n**Node:** `Get a document in Google Docs`\n- If the user's message includes a link or ID of a Google Doc, this node retrieves and simplifies it\n- The LangChain Agent can call this automatically when it detects a document reference\n\n### 3. Generate AI Response\n\n**Node:** `Google Gemini Chat Model`\n- LangChain routes message through the Gemini model\n- It generates a smart, contextual response, optionally using tools (e.g., Docs reader)\n\n\n### 4. Log Conversation in Google Sheet\n\n**Node:** `Append row in sheet`\n- Automatically appends:\n- Timestamp\n- User's message\n- AI's response\n\n## 🙋 For Help & Community\n\n- 🌐 Website: [devcodejourney.com](https://devcodejourney.com)\n- 🔗 LinkedIn: [Connect with Shakil](https://www.linkedin.com/in/shakilpg/)\n- 📱 WhatsApp Channel: [Join Now](https://whatsapp.com/channel/0029Vb5l6JuDTkK5BRORNn0B)\n- 💬 Direct Chat: [Message Now](https://wa.me/8801316320957)\n\n\n> Happy Building with 🛠️ **n8n + Gemini + Google Sheets**! 🚀"},"typeVersion":1},{"id":"092b6a15-91e6-4ee9-8be7-fc45d3fd7d0c","name":"Gemini","type":"@n8n/n8n-nodes-langchain.googleGeminiTool","position":[144,272],"parameters":{"modelId":{"__rl":true,"mode":"list","value":"models/gemini-2.5-flash","cachedResultName":"models/gemini-2.5-flash"},"options":{},"messages":{"values":[{"role":"model","content":"Give me user user-friendly reply. Don't give me a robotic type relay."}]}},"credentials":{"googlePalmApi":{"id":"jwzRcxc2F7GPOYnY","name":"Google Gemini(PaLM) Api account"}},"typeVersion":1},{"id":"ffb50b58-3388-4504-b711-bf1b5c12bdbf","name":"Docs","type":"n8n-nodes-base.googleDocsTool","position":[272,272],"parameters":{"simple":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Simplify', ``, 'boolean') }}","operation":"get","documentURL":"={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Doc_ID_or_URL', ``, 'string') }}"},"credentials":{"googleDocsOAuth2Api":{"id":"upoYuIvIHPZfgxay","name":"Google Docs account"}},"typeVersion":2},{"id":"b0f6e69c-c23b-4a6d-add0-5f7f181c0174","name":"Request","type":"n8n-nodes-base.httpRequestTool","position":[32,272],"parameters":{"url":"https://google.cm/","options":{}},"typeVersion":4.2},{"id":"32a851d3-2e78-4be9-907d-81a6303399b0","name":"Gemini Chat","type":"@n8n/n8n-nodes-langchain.lmChatGoogleGemini","position":[-160,272],"parameters":{"options":{}},"credentials":{"googlePalmApi":{"id":"jwzRcxc2F7GPOYnY","name":"Google Gemini(PaLM) Api account"}},"typeVersion":1},{"id":"87a16b40-ae21-48b1-b1a5-1017c67f9a10","name":"Store in sheet","type":"n8n-nodes-base.googleSheets","position":[608,80],"parameters":{"columns":{"value":{"replay message":"={{ $json.output }}","output data (Crypto)":"={{ $json.data }}"},"schema":[{"id":"replay message","type":"string","display":true,"removed":false,"required":false,"displayName":"replay message","defaultMatch":false,"canBeUsedToMatch":true},{"id":"output data (Crypto)","type":"string","display":true,"removed":false,"required":false,"displayName":"output data (Crypto)","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1IPjHgpBYSOeEgdfDk3DQxRrHPb1jUNNV9yIhkf7tWnQ/edit#gid=0","cachedResultName":"Sheet1"},"documentId":{"__rl":true,"mode":"list","value":"1IPjHgpBYSOeEgdfDk3DQxRrHPb1jUNNV9yIhkf7tWnQ","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1IPjHgpBYSOeEgdfDk3DQxRrHPb1jUNNV9yIhkf7tWnQ/edit?usp=drivesdk","cachedResultName":"Build a Personal Chatbot with Google Gemini & Auto Store Chats in Google Sheets"}},"credentials":{"googleSheetsOAuth2Api":{"id":"gFH3Wjq6yYqSEAei","name":"Google Sheets"}},"typeVersion":4.6},{"id":"315446fa-9dbe-474e-870f-719e616f1d15","name":"Chat message","type":"@n8n/n8n-nodes-langchain.chatTrigger","position":[-304,0],"webhookId":"956b525c-f9ae-4eac-8a2e-bd8d3d3d6946","parameters":{"public":true,"options":{},"initialMessages":"Hi Nani! 👋"},"typeVersion":1.1},{"id":"e0562f97-1298-4f0c-b953-4fed0b102e98","name":"Store in Your Chat","type":"n8n-nodes-base.telegram","position":[384,-96],"webhookId":"643e6dfc-0cdd-4a1f-bf6e-e162f2ec8cbc","parameters":{"text":"=Your Qustion:\n{{ $('Chat message').item.json.chatInput }}\n\nReplay:\n{{ $json.output }}","chatId":"your chat ID","additionalFields":{}},"credentials":{"telegramApi":{"id":"awgkor9T3i1erkVJ","name":"Telegram account"}},"typeVersion":1.2},{"id":"6ed87099-bffc-47cf-9c5a-b7439daf4978","name":"Crypto","type":"n8n-nodes-base.crypto","position":[384,80],"parameters":{"value":"={{ $json.output }}"},"typeVersion":1},{"id":"0be1fa1e-e723-42bc-8374-7500f994180e","name":"Sticky Note2","type":"n8n-nodes-base.stickyNote","position":[0,256],"parameters":{"color":7,"width":448,"height":336,"content":"\n\n\n\n\n\n\n\n\n\n\n\n---\n### Tools you can change/add another tool as your wish but need this modal API key and give some data what you want to give replay type"},"typeVersion":1},{"id":"6691a7df-166f-4061-9409-6c2fe2d6d3c2","name":"Sticky Note3","type":"n8n-nodes-base.stickyNote","position":[-240,256],"parameters":{"color":7,"width":224,"height":336,"content":"\n\n\n\n\n\n\n\n\n\n\n---\n### chat modal you can change/add another modal as your wish but need this modal API key"},"typeVersion":1},{"id":"bd570bf8-0627-4ef6-9d6c-18d98af57bd1","name":"Sticky Note4","type":"n8n-nodes-base.stickyNote","position":[336,-240],"parameters":{"color":7,"width":480,"height":464,"content":"## optional \nuser can get notification message on telegram\nand store in google sheet"},"typeVersion":1},{"id":"35dfef59-06e5-4542-87cd-83ad6b60fcb7","cid":"Ikx1Y2FzIFBleXJpbiI","name":"Sticky Note12","type":"n8n-nodes-base.stickyNote","notes":"© 2025 Lucas Peyrin","creator":"Lucas Peyrin","position":[-368,-96],"parameters":{"color":7,"width":268,"height":236,"content":"Activate this workflow and share the public chat URL to let others talk to your AI Agent!"},"typeVersion":1},{"id":"499298ba-6976-4e30-b045-7cce8d20c4ee","cid":"Ikx1Y2FzIFBleXJpbiI","name":"Sticky Note13","type":"n8n-nodes-base.stickyNote","notes":"© 2025 Lucas Peyrin","creator":"Lucas Peyrin","position":[-80,-208],"parameters":{"color":7,"width":380,"height":348,"content":"## Your AI agent can:\n1. **Receive** messages from the chat\n2. **Select** the right tools (e.g., weather, news, email)\n3. **Respond** with live, helpful answers\n\n\nAdjust your agent’s **System Message** thinking, behavior, and replies.\n\n\n\n\n\n\n\n\n\n\n"},"typeVersion":1}],"active":false,"pinData":{},"settings":{"callerPolicy":"workflowsFromSameOwner","availableInMCP":false,"executionOrder":"v1"},"versionId":"77ed68ae-0d01-4c5a-8ae4-03298eefb4c4","connections":{"Docs":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Crypto":{"main":[[{"node":"Store in sheet","type":"main","index":0}]]},"Gemini":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"Request":{"ai_tool":[[{"node":"AI Agent","type":"ai_tool","index":0}]]},"AI Agent":{"main":[[{"node":"Store in Your Chat","type":"main","index":0},{"node":"Crypto","type":"main","index":0}]]},"Gemini Chat":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Chat message":{"main":[[{"node":"AI Agent","type":"main","index":0}]]}}} |