The 06:00 workflow is now one schedule-trigger -> Execute Command pair that runs scripts/morning-brief.sh on the host over a restricted SSH key. The earlier scan -> HTTP shape could not work: the n8n container cannot resolve the `remote` ssh alias (its ~/.ssh/config is a dangling nix symlink) and a split scan node hides scan failures before the notify node runs. - deploy/n8n-morning-brief.json: two-node workflow, scheduleTrigger v1.3 - deploy/setup-n8n-scan-key.sh: restricted (restrict,command=) trigger key - deploy/import-n8n-morning-brief.sh: import + publish + restart + verify - deploy/DEPLOYMENT.md, Makefile: document and expose both scripts (dry run) - docs/phase-7a-n8n-schedule.md: design, verification, failure drill Import into the shared n8n service still needs Sam's approval. Co-Authored-By: Paperclip <noreply@paperclip.ing>
66 lines
2.0 KiB
JSON
66 lines
2.0 KiB
JSON
{
|
|
"name": "Compass / NHS — 6:00am morning brief",
|
|
"nodes": [
|
|
{
|
|
"parameters": {
|
|
"rule": {
|
|
"interval": [
|
|
{
|
|
"field": "cronExpression",
|
|
"expression": "0 6 * * *"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"id": "c1a0a0a0-0000-4000-8000-000000000001",
|
|
"name": "6:00am every day",
|
|
"type": "n8n-nodes-base.scheduleTrigger",
|
|
"typeVersion": 1.3,
|
|
"position": [200, 300]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"executeOnce": true,
|
|
"command": "ssh -i /home/node/.ssh/id_ed25519_school_scan -o IdentitiesOnly=yes -o BatchMode=yes -o UserKnownHostsFile=/home/node/.ssh/known_hosts -o StrictHostKeyChecking=yes sam@192.168.20.13 'cd /home/sam/paseo/projects/compass_teams_nhs && ./scripts/morning-brief.sh'"
|
|
},
|
|
"id": "c1a0a0a0-0000-4000-8000-000000000002",
|
|
"name": "Scan both children and send the briefs",
|
|
"type": "n8n-nodes-base.executeCommand",
|
|
"typeVersion": 1,
|
|
"position": [480, 300],
|
|
"notes": "One bounded host command. The scan needs node + patchright on .13, so it runs outside this container. scripts/morning-brief.sh scans both children, builds the per-boy and combined briefs and sends them through Apprise, then exits non-zero if the scan or a send fails, so this execution goes red (FR-12). The key is restricted in authorized_keys to exactly this command."
|
|
}
|
|
],
|
|
"connections": {
|
|
"6:00am every day": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Scan both children and send the briefs",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
}
|
|
},
|
|
"settings": {
|
|
"executionOrder": "v1",
|
|
"timezone": "Australia/Melbourne",
|
|
"saveManualExecutions": true,
|
|
"callerPolicy": "workflowsFromSameOwner"
|
|
},
|
|
"staticData": null,
|
|
"meta": {
|
|
"templateCredsSetupCompleted": true,
|
|
"instanceId": "compass-teams-nhs"
|
|
},
|
|
"pinData": {},
|
|
"tags": [
|
|
{
|
|
"name": "school"
|
|
}
|
|
],
|
|
"active": false
|
|
}
|