DOCS/workflow/05_admin/diary_reflection_pipeline.json
2026-03-19 00:05:26 +09:00

105 lines
3.3 KiB
JSON

{
"name": "robeing-admin-diary-reflection-pipeline",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 2 * * *"
}
]
}
},
"id": "diary-001",
"name": "Daily at 2AM",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.1,
"position": [200, 240]
},
{
"parameters": {
"httpMethod": "POST",
"path": "admin/diary/trigger",
"options": {}
},
"id": "diary-002",
"name": "Manual Trigger",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [200, 440]
},
{
"parameters": {
"jsCode": "const now = new Date();\nconst yesterday = new Date(now);\nyesterday.setDate(yesterday.getDate() - 1);\nconst dateStr = yesterday.toISOString().split('T')[0];\nreturn {\n date: dateStr,\n robeing_id: 'rb8001'\n};"
},
"id": "diary-003",
"name": "Set Yesterday Date",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [460, 340]
},
{
"parameters": {
"method": "POST",
"url": "=http://192.168.219.52:8001/api/diary/generate",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"date\": \"{{ $json.date }}\",\n \"robeing_id\": \"{{ $json.robeing_id }}\"\n}",
"options": {
"timeout": 300000
}
},
"id": "diary-004",
"name": "Generate Diary (rb8001)",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [700, 340]
},
{
"parameters": {
"method": "GET",
"url": "=http://192.168.219.52:8001/api/diary/{{ $json.date }}",
"qs": {
"parameters": [
{
"name": "robeing_id",
"value": "rb8001"
}
]
},
"options": {}
},
"id": "diary-005",
"name": "Get Diary Content",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [940, 340]
},
{
"parameters": {
"resource": "message",
"operation": "post",
"channel": "C07...",
"text": "=📜 *로빙 일기 ({{ $json.date }})*\\n\\n{{ $json.summary }}\\n\\n지배적 감정: {{ $json.dominant_emotion }}\\n\\n[대시보드에서 자세히 보기](http://192.168.219.45:3000/diary)",
"otherOptions": {}
},
"id": "diary-006",
"name": "Post to Slack",
"type": "n8n-nodes-base.slack",
"typeVersion": 2,
"position": [1180, 340]
}
],
"connections": {
"Daily at 2AM": { "main": [[{ "node": "Set Yesterday Date", "type": "main", "index": 0 }]] },
"Manual Trigger": { "main": [[{ "node": "Set Yesterday Date", "type": "main", "index": 0 }]] },
"Set Yesterday Date": { "main": [[{ "node": "Generate Diary (rb8001)", "type": "main", "index": 0 }]] },
"Generate Diary (rb8001)": { "main": [[{ "node": "Get Diary Content", "type": "main", "index": 0 }]] },
"Get Diary Content": { "main": [[{ "node": "Post to Slack", "type": "main", "index": 0 }]] }
},
"pinData": {},
"meta": { "templateCredsSetupCompleted": true, "instanceId": "robeing-admin" }
}