YouTube Discord 机器人
中级
这是一个Building Blocks, AI, Marketing领域的自动化工作流,包含 6 个节点。主要使用 Code, Webhook, Agent, RespondToWebhook, LmChatGoogleGemini 等节点,结合人工智能技术实现智能自动化。 使用 Gemini 2.0 Flash 的自动化 Discord 频道聊天交互机器人
前置要求
- •HTTP Webhook 端点(n8n 会自动生成)
- •Google Gemini API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "OqfQNcgTqUK7UvZG",
"meta": {
"instanceId": "5ce52989094be90be3b3bdd9ed9cee1d7ce1fcecaa598afaec4a50646d32e291",
"templateCredsSetupCompleted": true
},
"name": "Youtube Discord Bot",
"tags": [
{
"id": "5eZb3e5PJspoJjVN",
"name": "Discord",
"createdAt": "2025-02-22T09:31:58.972Z",
"updatedAt": "2025-02-22T09:31:58.972Z"
}
],
"nodes": [
{
"id": "39832819-a14b-445c-bf5c-0bd93613b1ca",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
80,
440
],
"webhookId": "b0631bec-9ccc-4eb8-b143-d73609b213c7",
"parameters": {
"path": "b0631bec-9ccc-4eb8-b143-d73609b213c7",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "5e70b649-5678-4718-98a7-302a4c784155",
"name": "Simple Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
460,
680
],
"parameters": {
"sessionKey": "={{ $json.body.userId }}",
"sessionIdType": "customKey",
"contextWindowLength": 50
},
"typeVersion": 1.3
},
{
"id": "7cc849c3-3ed8-4fe2-a378-a213736a9aef",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
180,
700
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.0-flash"
},
"credentials": {
"googlePalmApi": {
"id": "clmB8ZYJMHaHmnsu",
"name": "Stardawn#1"
}
},
"typeVersion": 1
},
{
"id": "4b664f21-6f1c-4894-9196-beecbd865d3e",
"name": "Respond to Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
880,
440
],
"parameters": {
"options": {},
"respondWith": "allIncomingItems"
},
"typeVersion": 1.1
},
{
"id": "c7c779d3-e324-4a3f-a5a1-5218ec61d856",
"name": "correctNaming",
"type": "n8n-nodes-base.code",
"position": [
680,
440
],
"parameters": {
"jsCode": "// Hole alle Items\nconst items = $input.all();\n\n// Nehme das erste Item (falls mehrere vorhanden sind)\nconst item = items[0];\n\n// Extrahiere den output\nconst antwort = item.json.output;\n\n// Formatiere die Antwort im richtigen Format für den Discord-Bot\nreturn {\n json: {\n answer: antwort\n }\n};"
},
"typeVersion": 2
},
{
"id": "9ff7ad77-88ce-467e-91b1-4fc2d13636fd",
"name": "Discord AI Response Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
300,
440
],
"parameters": {
"text": "=Username: {{ $json.body.userName }}\n\nQuestion/Prompt: {{ $json.body.question }}",
"options": {
"systemMessage": "You are a helpful assistant. You answer in the language you receive the question in. Interactions might be all over the place. If there is any questions regarding the Youtube Videos of the channel: Presting Podcasts, you have the transcript of the podcast videos as additional knowledge.\nAlways begin your answer with a @insertusername to mark the guy who asked the question. "
},
"promptType": "define"
},
"typeVersion": 1.8
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "429e2ccd-5a58-4287-9ad8-314efbbecb8f",
"connections": {
"39832819-a14b-445c-bf5c-0bd93613b1ca": {
"main": [
[
{
"node": "9ff7ad77-88ce-467e-91b1-4fc2d13636fd",
"type": "main",
"index": 0
}
]
]
},
"5e70b649-5678-4718-98a7-302a4c784155": {
"ai_memory": [
[
{
"node": "9ff7ad77-88ce-467e-91b1-4fc2d13636fd",
"type": "ai_memory",
"index": 0
}
]
]
},
"c7c779d3-e324-4a3f-a5a1-5218ec61d856": {
"main": [
[
{
"node": "4b664f21-6f1c-4894-9196-beecbd865d3e",
"type": "main",
"index": 0
}
]
]
},
"7cc849c3-3ed8-4fe2-a378-a213736a9aef": {
"ai_languageModel": [
[
{
"node": "9ff7ad77-88ce-467e-91b1-4fc2d13636fd",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"9ff7ad77-88ce-467e-91b1-4fc2d13636fd": {
"main": [
[
{
"node": "c7c779d3-e324-4a3f-a5a1-5218ec61d856",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 构建模块, 人工智能, 营销
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
YouTube 自动化
自动化 YouTube 视频排程和 AI 元数据生成 🎬
If
Set
Code
+
If
Set
Code
33 节点JPres
人工智能
[模板] AI宠物店 v8
🐶 AI宠物店助手 - 集成GPT-4o、Google日历和WhatsApp/Instagram/Facebook
If
N8n
Set
+
If
N8n
Set
244 节点Amanda Benks
销售
使用SQL数据库、RAG和路由代理构建AI驱动的技术雷达顾问
使用SQL数据库、RAG和路由代理构建AI驱动的技术雷达顾问
If
Code
Cron
+
If
Code
Cron
53 节点Sean Lon
工程
Instagram私信/收件箱AI代理 - Manychat与OpenAI集成
Instagram私信/收件箱AI代理 - Manychat与OpenAI集成
Set
Webhook
Agent
+
Set
Webhook
Agent
11 节点Alex Hi no code
人工智能
自适应RAG策略:查询分类与检索(Gemini和Qdrant)
自适应RAG策略:查询分类与检索(Gemini和Qdrant)
Set
Switch
Summarize
+
Set
Switch
Summarize
39 节点dmr
工程
RAG 2.0 - 答案架构
自适应RAG(Google Gemini和Qdrant):上下文感知查询应答
Set
Switch
Summarize
+
Set
Switch
Summarize
40 节点Nisa
构建模块