ken_nogi/Pleasanter/健康診断管理/docs/n8n/workflows/hc-wp-status-push.json
Kenichiro NOGI bd6a605539 健康診断管理システムのn8nワークフロー設計ドキュメントとPleasanter操作スクリプトを追加
n8nに構築済みのHC-SUB/HC-WP/HC-WAワークフロー設計・実装計画・エクスポートJSONを
Pleasanter/健康診断管理/docs/n8n/に集約管理。508971/513156のColumns/Styles/Summaries
反映用ワンショットスクリプトも合わせて追加。worktree-healthcheck-survey-botブランチを
mainへfast-forward mergeし、.claude/worktrees/はgit管理対象外に追加。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-06 09:02:14 +09:00

143 lines
3.4 KiB
JSON

{
"name": "HC-WP: Statusプッシュ通知",
"nodes": [
{
"id": "webhook-status-push",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
220,
300
],
"webhookId": "healthcheck-status-push",
"parameters": {
"httpMethod": "POST",
"path": "healthcheck-status-push",
"responseMode": "responseNode",
"options": {}
}
},
{
"id": "dt-get-healthcheck_wp_api_key",
"name": "設定値一括取得",
"type": "n8n-nodes-base.dataTable",
"typeVersion": 1,
"position": [
440,
300
],
"parameters": {
"operation": "get",
"dataTableId": {
"__rl": true,
"mode": "id",
"value": "bNkadTyDgDepYx2p"
},
"returnAll": true
}
},
{
"id": "code-validate",
"name": "検証",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
660,
300
],
"parameters": {
"jsCode": "const configRows = $('設定値一括取得').all().map((item) => item.json);\nconst expectedApiKey = configRows.find((row) => row.configKey === \"HEALTHCHECK_WP_API_KEY\")?.configValue;\nconst headers = $input.first().json.headers || {};\nif (headers[\"x-api-key\"] !== expectedApiKey) {\n throw new Error(\"Unauthorized: invalid API key\");\n}\nconst body = $input.first().json.body || {};\nif (!body.resultId || !body.processId) {\n throw new Error(\"Bad Request: resultId, processId は必須です\");\n}\nreturn [{ json: { resultId: body.resultId, processId: body.processId } }];"
}
},
{
"id": "execute-hc-sub",
"name": "HC-SUB実行",
"type": "n8n-nodes-base.executeWorkflow",
"typeVersion": 1.2,
"position": [
880,
300
],
"parameters": {
"workflowId": {
"__rl": true,
"mode": "id",
"value": "XRqcykbG2LuAjGG2"
},
"workflowInputs": {
"mappingMode": "defineBelow",
"value": {
"resultId": "={{ $json.resultId }}",
"processId": "={{ $json.processId }}"
}
}
}
},
{
"id": "respond-ok",
"name": "Respond to Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
1100,
300
],
"parameters": {
"respondWith": "json",
"responseBody": "={{ JSON.stringify({ result: \"ok\" }) }}",
"options": {}
}
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "設定値一括取得",
"type": "main",
"index": 0
}
]
]
},
"設定値一括取得": {
"main": [
[
{
"node": "検証",
"type": "main",
"index": 0
}
]
]
},
"検証": {
"main": [
[
{
"node": "HC-SUB実行",
"type": "main",
"index": 0
}
]
]
},
"HC-SUB実行": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
}
}