From 08825111bdf90a0375fe3f3669c8297152794cf1 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Thu, 19 Mar 2026 15:24:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Chat=20Confirm=20=EB=85=B8=EB=93=9C=20un?= =?UTF-8?q?defined=20=EB=B2=84=EA=B7=B8=20=E2=80=94=20Qwen=20Classify=20?= =?UTF-8?q?=EC=B6=9C=EB=A0=A5=20=EC=A7=81=EC=A0=91=20=EC=B0=B8=EC=A1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PostgreSQL INSERT 출력에는 domain/tags가 없어서 undefined 표시됨. $input.first().json → $('Qwen Classify').first().json으로 변경. Co-Authored-By: Claude Opus 4.6 (1M context) --- n8n/workflows/retrospect-capture-pipeline.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/n8n/workflows/retrospect-capture-pipeline.json b/n8n/workflows/retrospect-capture-pipeline.json index 122a181..172b5ec 100644 --- a/n8n/workflows/retrospect-capture-pipeline.json +++ b/n8n/workflows/retrospect-capture-pipeline.json @@ -100,7 +100,7 @@ }, { "parameters": { - "jsCode": "function httpPostForm(url, formBody, { timeout = 10000 } = {}) {\n return new Promise((resolve, reject) => {\n const u = require('url').parse(url);\n const mod = require(u.protocol === 'https:' ? 'https' : 'http');\n const options = {\n hostname: u.hostname, port: u.port, path: u.path,\n method: 'POST',\n headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': Buffer.byteLength(formBody) },\n rejectUnauthorized: false\n };\n const req = mod.request(options, (res) => {\n let body = '';\n res.on('data', c => body += c);\n res.on('end', () => resolve({ statusCode: res.statusCode, body }));\n });\n req.on('error', reject);\n req.setTimeout(timeout, () => { req.destroy(); reject(new Error('timeout')); });\n req.write(formBody);\n req.end();\n });\n}\n\nconst item = $input.first().json;\nconst webhookUrl = $env.RETROSPECT_CHAT_WEBHOOK_URL || '';\n\nif (webhookUrl) {\n const tagsStr = (item.tags || []).map(t => '#' + t).join(' ');\n const msg = `\\u2713 [${item.domain}] ${tagsStr}`;\n try {\n const payload = JSON.stringify({ text: msg });\n const formBody = 'payload=' + encodeURIComponent(payload);\n await httpPostForm(webhookUrl, formBody, { timeout: 10000 });\n } catch(e) {\n console.log('Chat ack failed: ' + e.message);\n }\n}\n\nreturn [{ json: { ...item, ack_sent: true } }];" + "jsCode": "function httpPostForm(url, formBody, { timeout = 10000 } = {}) {\n return new Promise((resolve, reject) => {\n const u = require('url').parse(url);\n const mod = require(u.protocol === 'https:' ? 'https' : 'http');\n const options = {\n hostname: u.hostname, port: u.port, path: u.path,\n method: 'POST',\n headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': Buffer.byteLength(formBody) },\n rejectUnauthorized: false\n };\n const req = mod.request(options, (res) => {\n let body = '';\n res.on('data', c => body += c);\n res.on('end', () => resolve({ statusCode: res.statusCode, body }));\n });\n req.on('error', reject);\n req.setTimeout(timeout, () => { req.destroy(); reject(new Error('timeout')); });\n req.write(formBody);\n req.end();\n });\n}\n\nconst item = $('Qwen Classify').first().json;\nconst webhookUrl = $env.RETROSPECT_CHAT_WEBHOOK_URL || '';\n\nif (webhookUrl) {\n const tagsStr = (item.tags || []).map(t => '#' + t).join(' ');\n const msg = `\\u2713 [${item.domain}] ${tagsStr}`;\n try {\n const payload = JSON.stringify({ text: msg });\n const formBody = 'payload=' + encodeURIComponent(payload);\n await httpPostForm(webhookUrl, formBody, { timeout: 10000 });\n } catch(e) {\n console.log('Chat ack failed: ' + e.message);\n }\n}\n\nreturn [{ json: { ...item, ack_sent: true } }];" }, "id": "r1000001-0000-0000-0000-000000000006", "name": "Chat Confirm",