构建您的第一个对话式AI聊天机器人代理
中级
这是一个自动化工作流,包含 15 个节点。主要使用 Crypto, Telegram, GoogleSheets, GoogleDocsTool, Agent 等节点。 创建您的第一个AI代理
前置要求
- •Telegram Bot Token
- •Google Sheets API 凭证
- •可能需要目标 API 的认证凭证
- •Google Gemini API Key
使用的节点 (15)
分类
-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "xh1yv1lvCFV3sHhH",
"meta": {
"instanceId": "cb9a1e5321767b6316634728341237e564b2587ab15b74ca0a89eb02a53484d6",
"templateCredsSetupCompleted": true
},
"name": "构建您的第一个对话式 AI 聊天机器人代理",
"tags": [],
"nodes": [
{
"id": "c5a03f02-86fa-42d4-83fd-7966b49f56ff",
"name": "AI 代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
0,
0
],
"parameters": {
"options": {}
},
"typeVersion": 2.1
},
{
"id": "5334a310-007f-43a7-9f85-f26c7928f5fd",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1472,
-32
],
"parameters": {
"width": 1072,
"height": 1392,
"content": "# 概述"
},
"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": "加密货币",
"type": "n8n-nodes-base.crypto",
"position": [
384,
80
],
"parameters": {
"value": "={{ $json.output }}"
},
"typeVersion": 1
},
{
"id": "0be1fa1e-e723-42bc-8374-7500f994180e",
"name": "便签2",
"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": "便签3",
"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": "便签4",
"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": "便签 12",
"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": "便利贴13",
"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
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
自动化新闻检索与Telegram广播,使用OpenAI、SerpAPI和LangChain
自动化新闻检索与Telegram广播,使用OpenAI、SerpAPI和LangChain
If
Set
Wait
+15
23 节点DevCode Journey
社交媒体
使用 AI 搜索和 SerpAPI 自动发布新闻到社交媒体
使用 AI 搜索和 SerpAPI 自动发布新闻到 Telegram、Facebook、Twitter 和 WordPress
If
Set
Wait
+14
20 节点DevCode Journey
社交媒体
构建集成Gemini Pro AI和Google Docs的Telegram聊天机器人
构建集成Gemini Pro AI和Google Docs的Telegram聊天机器人
Wait
Telegram
Google Docs Tool
+6
9 节点DevCode Journey
客服机器人
使用AI自动化落地页转化分析与优化
使用GPT、Gemini和多渠道交付的落地页转化率优化分析与优化
Rapiwa
Gmail
Telegram
+10
16 节点DevCode Journey
市场调研
Facebook页面评论管理机器人:回复、删除、封禁和通知
AI驱动的Facebook评论管理:自动回复、删除、封禁和通知
If
Set
Code
+18
59 节点SpaGreen Creative
社交媒体
在可视化参考库中探索n8n节点
在可视化参考库中探索n8n节点
If
Ftp
Set
+93
113 节点I versus AI
其他
工作流信息
难度等级
中级
节点数量15
分类-
节点类型10
作者
DevCode Journey
@devcodejourneyI build intelligent systems that automate tasks, streamline workflows, and enhance user experiences using tools like n8n, AI chatbots, and modern automation platforms. With a passion for solving real-world problems through smart technology, I create custom solutions that help individuals and businesses save time, scale faster, and work smarter. Whether it's integrating APIs, building no-code/low-code automations, or developing conversational AI, I'm always exploring the edge of what's possible.
外部链接
在 n8n.io 查看 →
分享此工作流