DOCS/workflow/01_conversation/slack_thread_summary_request.json
2026-03-18 23:49:20 +09:00

109 lines
3.7 KiB
JSON

{
"name": "robeing-slack-thread-summary-request",
"nodes": [
{
"parameters": {
"channelId": {
"__rl": true,
"mode": "list",
"value": ""
},
"options": {}
},
"id": "conv-sum-001",
"name": "Slack Trigger",
"type": "n8n-nodes-base.slackTrigger",
"typeVersion": 1,
"position": [220, 220]
},
{
"parameters": {
"jsCode": "const event = $json.event || {};\nconst text = (event.text || '').replace(/<@[^>]+>/g, '').trim();\nconst wantsSummary = /요약|정리|digest|summary/i.test(text);\nreturn {\n should_process: wantsSummary && Boolean(event.channel) && Boolean(event.user),\n channel_id: event.channel || '',\n thread_ts: event.thread_ts || event.ts || '',\n text,\n company_id: event.team || event.team_id || '',\n user_id: event.user || ''\n};"
},
"id": "conv-sum-002",
"name": "Detect Summary Intent",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [460, 220]
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{ $json.should_process }}",
"value2": true
}
]
}
},
"id": "conv-sum-003",
"name": "Summary Request?",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [700, 220]
},
{
"parameters": {
"method": "POST",
"url": "=http://192.168.219.52:8502/api/v1/summarize",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\"company_id\":\"{{$json.company_id}}\",\"user_id\":\"{{$json.user_id}}\",\"skill_level\":1,\"channel_id\":\"{{$json.channel_id}}\",\"thread_ts\":\"{{$json.thread_ts}}\",\"time_range\":\"24h\",\"options\":{\"include_files\":true,\"include_reactions\":false}}",
"options": {
"response": {
"response": {
"fullResponse": true
}
}
}
},
"id": "conv-sum-004",
"name": "Call skill-slack Summarize",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [960, 160]
},
{
"parameters": {
"jsCode": "const body = $json.body || {};\nconst req = $('Detect Summary Intent').item.json;\nreturn {\n channel: req.channel_id,\n thread_ts: req.thread_ts,\n text: body.summary || '요약 결과를 가져오지 못했습니다.'\n};"
},
"id": "conv-sum-005",
"name": "Build Summary Reply",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [1210, 160]
},
{
"parameters": {
"resource": "message",
"operation": "post",
"channel": "={{ $json.channel }}",
"text": "={{ $json.text }}",
"otherOptions": {
"threadTs": "={{ $json.thread_ts }}"
}
},
"id": "conv-sum-006",
"name": "Reply to Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2,
"position": [1450, 160]
}
],
"connections": {
"Slack Trigger": { "main": [[{ "node": "Detect Summary Intent", "type": "main", "index": 0 }]] },
"Detect Summary Intent": { "main": [[{ "node": "Summary Request?", "type": "main", "index": 0 }]] },
"Summary Request?": {
"main": [
[{ "node": "Call skill-slack Summarize", "type": "main", "index": 0 }],
[]
]
},
"Call skill-slack Summarize": { "main": [[{ "node": "Build Summary Reply", "type": "main", "index": 0 }]] },
"Build Summary Reply": { "main": [[{ "node": "Reply to Slack", "type": "main", "index": 0 }]] }
},
"pinData": {},
"meta": { "templateCredsSetupCompleted": true, "instanceId": "robeing-conversation" }
}