{ "name": "robeing-daily-headlines-actual-runtime", "nodes": [ { "parameters": { "height": 420, "width": 2380 }, "type": "n8n-nodes-base.stickyNote", "position": [ -220, 64 ], "typeVersion": 1, "id": "aeb5f661-29a0-461b-9d7b-1d8f68a2c001", "name": "Workflow Note" }, { "parameters": { "rule": { "cronExpression": "10 9 * * 1-5" } }, "id": "aeb5f661-29a0-461b-9d7b-1d8f68a2c002", "name": "09:10 Trigger", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1, "position": [ 0, 224 ] }, { "parameters": { "jsCode": "return {\n scheduler_source: 'scheduled_jobs.daily_headlines',\n cron_expression: '10 9 * * mon-fri',\n channel_id: 'C09C98KK2TT',\n job_wrapper: 'app.scheduler.jobs.daily_headlines._run_headlines_with_logging',\n workflow_entry: 'run_headlines_workflow(channel_id)',\n state_store: '/code/state/headlines_graph.sqlite'\n};" }, "id": "aeb5f661-29a0-461b-9d7b-1d8f68a2c003", "name": "Build Runtime Context", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 240, 224 ] }, { "parameters": { "method": "POST", "url": "=http://192.168.219.52:8505/api/news/naver/startup-headlines", "sendBody": true, "specifyBody": "json", "jsonBody": "={\"format\":\"slack\"}", "options": { "response": { "response": { "fullResponse": true } } } }, "id": "aeb5f661-29a0-461b-9d7b-1d8f68a2c004", "name": "Call Naver Headlines API", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 512, 160 ] }, { "parameters": { "method": "POST", "url": "=http://192.168.219.52:8505/api/news/sea/headlines", "sendBody": true, "specifyBody": "json", "jsonBody": "={\"format\":\"json\"}", "options": { "response": { "response": { "fullResponse": true } } } }, "id": "aeb5f661-29a0-461b-9d7b-1d8f68a2c005", "name": "Call SEA Headlines API", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 512, 304 ] }, { "parameters": { "jsCode": "const runtime = $('Build Runtime Context').item.json;\nconst naver = $('Call Naver Headlines API').item.json;\nconst sea = $('Call SEA Headlines API').item.json;\n\nreturn {\n channel_id: runtime.channel_id,\n summary: [\n 'DB scheduler -> daily_headlines wrapper',\n 'run_headlines_workflow(channel_id)',\n 'fetch_naver + fetch_sea + extract_terms + format + send',\n 'Naver Slack text + SEA section inserted',\n 'keyword summary hidden, final blank lines kept in formatter'\n ].join('\\n'),\n runtime,\n naver_status: naver.statusCode,\n sea_status: sea.statusCode,\n final_delivery: 'rb8001 headlines_workflow.send_node -> Slack chat_postMessage'\n};" }, "id": "aeb5f661-29a0-461b-9d7b-1d8f68a2c006", "name": "Describe Actual Path", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 816, 224 ] }, { "parameters": { "conditions": { "number": [ { "value1": "={{ $json.naver_status }}", "operation": "equal", "value2": 200 }, { "value1": "={{ $json.sea_status }}", "operation": "equal", "value2": 200 } ] }, "options": {} }, "id": "aeb5f661-29a0-461b-9d7b-1d8f68a2c007", "name": "APIs Reachable?", "type": "n8n-nodes-base.if", "typeVersion": 2, "position": [ 1088, 224 ] }, { "parameters": { "jsCode": "return {\n channel: $json.runtime.channel_id,\n text: $json.summary\n};" }, "id": "aeb5f661-29a0-461b-9d7b-1d8f68a2c008", "name": "Build Runtime Summary", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1344, 160 ] }, { "parameters": { "jsCode": "return {\n channel: $('Build Runtime Context').item.json.channel_id,\n text: 'Actual runtime path documented, but referenced APIs were not reachable in this visualization run.'\n};" }, "id": "aeb5f661-29a0-461b-9d7b-1d8f68a2c009", "name": "Build Fallback Summary", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 1344, 304 ] }, { "parameters": { "resource": "message", "operation": "post", "channel": "={{ $json.channel }}", "text": "={{ $json.text }}", "otherOptions": {} }, "id": "aeb5f661-29a0-461b-9d7b-1d8f68a2c010", "name": "Slack Delivery View", "type": "n8n-nodes-base.slack", "typeVersion": 2, "position": [ 1616, 224 ] } ], "connections": { "09:10 Trigger": { "main": [ [ { "node": "Build Runtime Context", "type": "main", "index": 0 } ] ] }, "Build Runtime Context": { "main": [ [ { "node": "Call Naver Headlines API", "type": "main", "index": 0 }, { "node": "Call SEA Headlines API", "type": "main", "index": 0 } ] ] }, "Call Naver Headlines API": { "main": [ [ { "node": "Describe Actual Path", "type": "main", "index": 0 } ] ] }, "Call SEA Headlines API": { "main": [ [ { "node": "Describe Actual Path", "type": "main", "index": 0 } ] ] }, "Describe Actual Path": { "main": [ [ { "node": "APIs Reachable?", "type": "main", "index": 0 } ] ] }, "APIs Reachable?": { "main": [ [ { "node": "Build Runtime Summary", "type": "main", "index": 0 } ], [ { "node": "Build Fallback Summary", "type": "main", "index": 0 } ] ] }, "Build Runtime Summary": { "main": [ [ { "node": "Slack Delivery View", "type": "main", "index": 0 } ] ] }, "Build Fallback Summary": { "main": [ [ { "node": "Slack Delivery View", "type": "main", "index": 0 } ] ] } }, "pinData": {}, "meta": { "templateCredsSetupCompleted": true, "instanceId": "robeing-scheduler" } }