OctoPrint 管理器
高级
这是一个Engineering, AI, IT Ops领域的自动化工作流,包含 16 个节点。主要使用 Discord, HttpRequest, ManualTrigger, Agent, HttpRequestTool 等节点,结合人工智能技术实现智能自动化。 通过 GPT-4o 和 OctoPrint API 对话控制 3D 打印机
前置要求
- •Discord Bot Token 或 Webhook
- •可能需要目标 API 的认证凭证
- •OpenAI API Key
使用的节点 (16)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "YyMOJKUM7DmZpySf",
"meta": {
"instanceId": "b4fa5e208d17098379f0d875b3ffa037e21f16d6e20850aa3447c9f571e6dce5",
"templateCredsSetupCompleted": true
},
"name": "OctoPrint 管理器",
"tags": [],
"nodes": [
{
"id": "17588807-7232-48f2-9746-9e5ebfb4370f",
"name": "当点击\"测试工作流\"时",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-360,
100
],
"parameters": {},
"typeVersion": 1
},
{
"id": "338329b4-f691-4fac-bdab-ea5cd74add80",
"name": "准备 OctoPrint 任务",
"type": "n8n-nodes-base.httpRequest",
"position": [
-80,
100
],
"parameters": {
"url": "http://OctoPrint-IP/api/job",
"method": "POST",
"options": {},
"jsonBody": "{\n \"command\": \"start\"\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "Content-Type: application/json"
},
{
"name": "X-Api-Key",
"value": "OctoPrint-API-Key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "c909da95-6a3e-4647-9da7-fcc375bcc517",
"name": "AI 代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
372,
460
],
"parameters": {
"options": {}
},
"retryOnFail": true,
"typeVersion": 1.9
},
{
"id": "9579f327-f2ec-456f-96aa-72693a0b2619",
"name": "OpenAI 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-140,
680
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "OPENAI-ID",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "6ce7ede9-b95e-4e6a-ae54-84336956fc53",
"name": "简单记忆",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-20,
680
],
"parameters": {
"sessionKey": "Test",
"sessionIdType": "customKey"
},
"typeVersion": 1.3
},
{
"id": "9cd904a0-90c7-42b6-be12-38d5be921881",
"name": "当收到聊天消息时",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-360,
460
],
"webhookId": "WEBHOOK-ID",
"parameters": {
"public": true,
"options": {}
},
"typeVersion": 1.1
},
{
"id": "99e83e4f-5528-4fa4-9680-3f3126da6d26",
"name": "列出 OctoPrint 任务",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
100,
740
],
"parameters": {
"url": "http://OctoPrint-IP/api/files",
"options": {},
"sendHeaders": true,
"toolDescription": "Makes an HTTP request and returns the list of OctoPrint jobs available for print",
"headerParameters": {
"parameters": [
{
"name": "X-Api-Key",
"value": "OctoPrint-API-Key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "fc7e5787-2045-4fed-888b-9abed6705706",
"name": "获取 OctoPrint 打印机状态",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
220,
680
],
"parameters": {
"url": "http://OctoPrint-IP/api/printer",
"options": {},
"sendHeaders": true,
"toolDescription": "Makes an HTTP request and returns the OctoPrint Printer Status",
"headerParameters": {
"parameters": [
{
"name": "X-Api-Key",
"value": "OctoPrint-API-Key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "f113838d-08db-4f2c-a9da-03abf6274db0",
"name": "暂停 OctoPrint 任务",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
340,
740
],
"parameters": {
"url": "http://OctoPrint-IP/api/job",
"method": "POST",
"options": {},
"jsonBody": "{ \"command\": \"pause\", \"action\": \"pause\" }",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"toolDescription": "Makes an HTTP request and pauses the current print job",
"headerParameters": {
"parameters": [
{
"name": "X-Api-Key",
"value": "OctoPrint-API-Key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "63ffabe8-85df-45a7-a643-8ee73515805c",
"name": "取消 OctoPrint 任务",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
460,
680
],
"parameters": {
"url": "http://OctoPrint-IP/api/job",
"method": "POST",
"options": {},
"jsonBody": "{ \"command\": \"cancel\" }",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"toolDescription": "Makes an HTTP request and cancel the current print job",
"headerParameters": {
"parameters": [
{
"name": "X-Api-Key",
"value": "OctoPrint-API-Key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "7b9c3760-a078-4215-88be-83f66d262aaa",
"name": "恢复 OctoPrint 任务",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
580,
740
],
"parameters": {
"url": "http://OctoPrint-IP/api/job",
"method": "POST",
"options": {},
"jsonBody": "{ \"command\": \"pause\", \"action\": \"resume\" }",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"toolDescription": "Makes an HTTP request and resume the current print job",
"headerParameters": {
"parameters": [
{
"name": "X-Api-Key",
"value": "OctoPrint-API-Key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "a78d26d9-dd3c-4282-9c2b-e09abbbe2a3a",
"name": "连接 OctoPrint 到打印机",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
700,
680
],
"parameters": {
"url": "http://OctoPrint-IP/api/connection",
"method": "POST",
"options": {},
"jsonBody": "{\n \"command\": \"connect\",\n \"port\": \"/dev/ttyUSB0\",\n \"baudrate\": 115200,\n \"printerProfile\": \"_default\"\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"toolDescription": "Makes an HTTP request and returns the OctoPrint Printer Status",
"headerParameters": {
"parameters": [
{
"name": "X-Api-Key",
"value": "OctoPrint-API-Key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "b998d0d3-1263-4ddd-929d-e2c22df66b0e",
"name": "获取 OctoPrint 打印机连接状态",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
820,
760
],
"parameters": {
"url": "http://OctoPrint-IP/api/connection",
"options": {},
"sendHeaders": true,
"toolDescription": "Makes an HTTP request and returns the OctoPrint Printer Status",
"headerParameters": {
"parameters": [
{
"name": "X-Api-Key",
"value": "OctoPrint-API-Key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "26d5c411-efeb-484a-a81a-3139d8d44f54",
"name": "开始 OctoPrint 任务",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
940,
680
],
"parameters": {
"url": "http://OctoPrint-IP/api/job",
"method": "POST",
"options": {},
"jsonBody": "{\n \"command\": \"start\"\n}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"toolDescription": "Makes an HTTP request and start the next print job.",
"headerParameters": {
"parameters": [
{
"name": "X-Api-Key",
"value": "OctoPrint-API-Key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "22aa2ad2-0401-45a5-b718-c33c86825d6a",
"name": "获取当前打印任务详情",
"type": "n8n-nodes-base.httpRequestTool",
"position": [
200,
880
],
"parameters": {
"url": "http://OctoPrint-IP/api/job",
"options": {},
"sendHeaders": true,
"toolDescription": "Makes an HTTP request and returns the current job details from the 3d printer",
"headerParameters": {
"parameters": [
{
"name": "X-Api-Key",
"value": "OctoPrint-API-Key"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "d207658e-eef2-4b17-b886-e80e5d81620f",
"name": "Discord",
"type": "n8n-nodes-base.discord",
"position": [
840,
380
],
"webhookId": "WEBHOOK-ID",
"parameters": {
"content": "={{ $json.output }}",
"options": {},
"authentication": "webhook"
},
"credentials": {
"discordWebhookApi": {
"id": "CuTjcFpLDBJufNt9",
"name": "OctoPrint Manager"
}
},
"typeVersion": 2
}
],
"active": true,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "520b7a27-8a5a-4df1-b21d-f0e8bb36b1fc",
"connections": {
"AI Agent": {
"main": [
[
{
"node": "Discord",
"type": "main",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"List OctoPrint Jobs": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Pause OctoPrint Job": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Start OctoPrint Job": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Cancel OctoPrint Job": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Resume OctoPrint Job": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"Connect OctoPrint to Printer": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get OctoPrint Printer Status": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Get Current Print Job Details": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"When clicking ‘Test workflow’": {
"main": [
[
{
"node": "Stage OctoPrint Job",
"type": "main",
"index": 0
}
]
]
},
"Get OctoPrint Printer Connection Status": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 工程, 人工智能, IT 运维
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
AI智能助手:与Supabase存储和Google Drive文件对话
AI智能助手:与Supabase存储和Google Drive文件对话
If
Set
Wait
+20
62 节点Mark Shcherbakov
工程
数据分析师 Agent v3
用于电子表格的AI数据分析助手,基于NocoDB平台
Set
Noco Db Tool
Http Request
+5
10 节点Derek Cheung
工程
与Supabase存储中文件对话的AI智能体
与Supabase存储中文件对话的AI智能体
If
Merge
Switch
+15
33 节点Mark Shcherbakov
工程
使用OpenAI和Quickchart.io可视化SQL代理查询
使用OpenAI和Quickchart.io可视化SQL代理查询
Set
Http Request
Agent
+7
16 节点Agent Studio
工程
使用RAG(Pinecone和OpenAI)与GitHub OpenAPI规范对话
与GitHub API文档对话:基于RAG的聊天机器人,使用Pinecone和OpenAI
Http Request
Manual Trigger
Agent
+9
17 节点Mihai Farcas
工程
ozki: OpenAI CSV分析
使用OpenAI驱动的数据代理分析Google Sheets数据
Agent
Google Sheets Tool
Chat Trigger
+3
6 节点ozkary
工程