Auto backup: 2026-02-21 07:01
This commit is contained in:
@@ -9,8 +9,9 @@ Verify daily that backup pushed to Gitea includes critical files.
|
||||
3. Configure credentials:
|
||||
- HTTP Header Auth for Gitea API (Authorization: token <YOUR_GITEA_TOKEN>)
|
||||
- Telegram credential named `Telegram account`
|
||||
4. Set env var in n8n for Gotify:
|
||||
- `GOTIFY_TOKEN=<your token>`
|
||||
4. Set env vars in n8n for ntfy:
|
||||
- `NTFY_URL=https://ntfy.sh`
|
||||
- `NTFY_TOPIC=anthony-krilly-9f3k2`
|
||||
|
||||
## What it checks
|
||||
- AGENTS.md
|
||||
@@ -21,8 +22,8 @@ Verify daily that backup pushed to Gitea includes critical files.
|
||||
- state-backup/devices/paired.json
|
||||
|
||||
## Alerts
|
||||
- Success: Gotify priority 2
|
||||
- Failure: Gotify priority 9 + Telegram alert
|
||||
- Success: ntfy (priority header not configured in this workflow yet) + Telegram
|
||||
- Failure: ntfy + Telegram alert
|
||||
|
||||
## Notes
|
||||
- Schedule is 02:20 AWST by default (after backup)
|
||||
|
||||
@@ -17,16 +17,35 @@
|
||||
"name": "Daily 02:20 AWST",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"typeVersion": 1.2,
|
||||
"position": [200, 300]
|
||||
"position": [
|
||||
200,
|
||||
300
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{ "name": "repoOwner", "type": "string", "value": "Anthony" },
|
||||
{ "name": "repoName", "type": "string", "value": "openclaw-backups" },
|
||||
{ "name": "branch", "type": "string", "value": "main" },
|
||||
{ "name": "requiredPaths", "type": "string", "value": "AGENTS.md,MEMORY.md,TOOLS.md,state-backup/openclaw.json,state-backup/cron/jobs.json,state-backup/devices/paired.json" }
|
||||
{
|
||||
"name": "repoOwner",
|
||||
"type": "string",
|
||||
"value": "Anthony"
|
||||
},
|
||||
{
|
||||
"name": "repoName",
|
||||
"type": "string",
|
||||
"value": "openclaw-backups"
|
||||
},
|
||||
{
|
||||
"name": "branch",
|
||||
"type": "string",
|
||||
"value": "main"
|
||||
},
|
||||
{
|
||||
"name": "requiredPaths",
|
||||
"type": "string",
|
||||
"value": "AGENTS.md,MEMORY.md,TOOLS.md,state-backup/openclaw.json,state-backup/cron/jobs.json,state-backup/devices/paired.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -34,20 +53,28 @@
|
||||
"name": "Set Context",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [420, 300]
|
||||
"position": [
|
||||
420,
|
||||
300
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"url": "=http://gitea.kangaroo-eel.ts.net:3000/api/v1/repos/{{$json.repoOwner}}/{{$json.repoName}}/branches/{{$json.branch}}",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"options": { "timeout": 10000 }
|
||||
"options": {
|
||||
"timeout": 10000
|
||||
}
|
||||
},
|
||||
"id": "get-branch",
|
||||
"name": "Get Branch Head",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [660, 300],
|
||||
"position": [
|
||||
660,
|
||||
300
|
||||
],
|
||||
"retryOnFail": true,
|
||||
"maxTries": 3,
|
||||
"waitBetweenTries": 2000
|
||||
@@ -57,13 +84,18 @@
|
||||
"url": "=http://gitea.kangaroo-eel.ts.net:3000/api/v1/repos/{{$node[\"Set Context\"].json.repoOwner}}/{{$node[\"Set Context\"].json.repoName}}/git/trees/{{$json.commit.id}}?recursive=1",
|
||||
"authentication": "genericCredentialType",
|
||||
"genericAuthType": "httpHeaderAuth",
|
||||
"options": { "timeout": 10000 }
|
||||
"options": {
|
||||
"timeout": 10000
|
||||
}
|
||||
},
|
||||
"id": "get-tree",
|
||||
"name": "Get Repo Tree",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [900, 300],
|
||||
"position": [
|
||||
900,
|
||||
300
|
||||
],
|
||||
"retryOnFail": true,
|
||||
"maxTries": 3,
|
||||
"waitBetweenTries": 2000
|
||||
@@ -76,13 +108,20 @@
|
||||
"name": "Validate Required Files",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 2,
|
||||
"position": [1140, 300]
|
||||
"position": [
|
||||
1140,
|
||||
300
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"conditions": {
|
||||
"string": [
|
||||
{ "value1": "={{$json.status}}", "operation": "equals", "value2": "ok" }
|
||||
{
|
||||
"value1": "={{$json.status}}",
|
||||
"operation": "equals",
|
||||
"value2": "ok"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -90,59 +129,93 @@
|
||||
"name": "Backup OK?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"typeVersion": 2,
|
||||
"position": [1360, 300]
|
||||
"position": [
|
||||
1360,
|
||||
300
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"url": "=http://runtipi.kangaroo-eel.ts.net:8129/message?token={{$env.GOTIFY_TOKEN}}",
|
||||
"url": "={{$env.NTFY_URL || 'https://ntfy.sh'}}/{{ $env.NTFY_TOPIC || 'anthony-krilly-9f3k2' }}",
|
||||
"sendBody": true,
|
||||
"contentType": "json",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{ "name": "title", "value": "✅ Backup Verified" },
|
||||
{ "name": "message", "value": "={{`Repo ${$json.repo} verified. SHA: ${$json.headSha.slice(0,7)}. Checked ${$json.checked} required files.`}}" },
|
||||
{ "name": "priority", "value": "2" }
|
||||
{
|
||||
"name": "title",
|
||||
"value": "\u2705 Backup Verified"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"value": "={{`Repo ${$json.repo} verified. SHA: ${$json.headSha.slice(0,7)}. Checked ${$json.checked} required files.`}}"
|
||||
},
|
||||
{
|
||||
"name": "priority",
|
||||
"value": "2"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": { "timeout": 10000 }
|
||||
"options": {
|
||||
"timeout": 10000
|
||||
}
|
||||
},
|
||||
"id": "notify-ok",
|
||||
"name": "Gotify Success",
|
||||
"name": "ntfy Success",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [1600, 200]
|
||||
"position": [
|
||||
1600,
|
||||
200
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"url": "=http://runtipi.kangaroo-eel.ts.net:8129/message?token={{$env.GOTIFY_TOKEN}}",
|
||||
"url": "={{$env.NTFY_URL || 'https://ntfy.sh'}}/{{ $env.NTFY_TOPIC || 'anthony-krilly-9f3k2' }}",
|
||||
"sendBody": true,
|
||||
"contentType": "json",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{ "name": "title", "value": "🚨 Backup Verification Failed" },
|
||||
{ "name": "message", "value": "={{`Repo ${$json.repo} failed verification. Missing: ${$json.missing.join(', ')}. SHA: ${$json.headSha.slice(0,7)}`}}" },
|
||||
{ "name": "priority", "value": "9" }
|
||||
{
|
||||
"name": "title",
|
||||
"value": "\ud83d\udea8 Backup Verification Failed"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"value": "={{`Repo ${$json.repo} failed verification. Missing: ${$json.missing.join(', ')}. SHA: ${$json.headSha.slice(0,7)}`}}"
|
||||
},
|
||||
{
|
||||
"name": "priority",
|
||||
"value": "9"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": { "timeout": 10000 }
|
||||
"options": {
|
||||
"timeout": 10000
|
||||
}
|
||||
},
|
||||
"id": "notify-fail-gotify",
|
||||
"name": "Gotify Failure",
|
||||
"name": "ntfy Failure",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [1600, 360]
|
||||
"position": [
|
||||
1600,
|
||||
360
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"chatId": "1793951355",
|
||||
"text": "={{`🦀 Backup verifier failed\nRepo: ${$json.repo}\nMissing: ${$json.missing.join(', ')}\nSHA: ${$json.headSha.slice(0,7)}`}}",
|
||||
"text": "={{`\ud83e\udd80 Backup verifier failed\nRepo: ${$json.repo}\nMissing: ${$json.missing.join(', ')}\nSHA: ${$json.headSha.slice(0,7)}`}}",
|
||||
"additionalFields": {}
|
||||
},
|
||||
"id": "notify-fail-telegram",
|
||||
"name": "Telegram Failure",
|
||||
"type": "n8n-nodes-base.telegram",
|
||||
"typeVersion": 1.2,
|
||||
"position": [1810, 360],
|
||||
"position": [
|
||||
1810,
|
||||
360
|
||||
],
|
||||
"credentials": {
|
||||
"telegramApi": {
|
||||
"name": "Telegram account"
|
||||
@@ -151,19 +224,93 @@
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Daily 02:20 AWST": { "main": [[{ "node": "Set Context", "type": "main", "index": 0 }]] },
|
||||
"Set Context": { "main": [[{ "node": "Get Branch Head", "type": "main", "index": 0 }]] },
|
||||
"Get Branch Head": { "main": [[{ "node": "Get Repo Tree", "type": "main", "index": 0 }]] },
|
||||
"Get Repo Tree": { "main": [[{ "node": "Validate Required Files", "type": "main", "index": 0 }]] },
|
||||
"Validate Required Files": { "main": [[{ "node": "Backup OK?", "type": "main", "index": 0 }]] },
|
||||
"Backup OK?": {
|
||||
"Daily 02:20 AWST": {
|
||||
"main": [
|
||||
[{ "node": "Gotify Success", "type": "main", "index": 0 }],
|
||||
[{ "node": "Gotify Failure", "type": "main", "index": 0 }]
|
||||
[
|
||||
{
|
||||
"node": "Set Context",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Gotify Failure": { "main": [[{ "node": "Telegram Failure", "type": "main", "index": 0 }]] }
|
||||
"Set Context": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Branch Head",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Branch Head": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Repo Tree",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Repo Tree": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Validate Required Files",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Validate Required Files": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Backup OK?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Backup OK?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "ntfy Success",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"node": "ntfy Failure",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"ntfy Failure": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Telegram Failure",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"settings": { "executionOrder": "v1" },
|
||||
"active": false
|
||||
}
|
||||
}
|
||||
@@ -3,14 +3,24 @@
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {
|
||||
"rule": {"interval": [{"field": "cronExpression", "expression": "15 7 * * *"}]},
|
||||
"rule": {
|
||||
"interval": [
|
||||
{
|
||||
"field": "cronExpression",
|
||||
"expression": "15 7 * * *"
|
||||
}
|
||||
]
|
||||
},
|
||||
"timezone": "Australia/Perth"
|
||||
},
|
||||
"id": "cron",
|
||||
"name": "Daily 07:15 AWST",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"typeVersion": 1.2,
|
||||
"position": [220, 300]
|
||||
"position": [
|
||||
220,
|
||||
300
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
@@ -23,7 +33,10 @@
|
||||
"name": "Webhook Execute (POST)",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"typeVersion": 2,
|
||||
"position": [220, 460]
|
||||
"position": [
|
||||
220,
|
||||
460
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
@@ -41,7 +54,10 @@
|
||||
"name": "Set Prompt",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [470, 380]
|
||||
"position": [
|
||||
470,
|
||||
380
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
@@ -52,47 +68,112 @@
|
||||
"contentType": "json",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{"name": "text", "value": "={{$json.wakeText}}"},
|
||||
{"name": "mode", "value": "now"}
|
||||
{
|
||||
"name": "text",
|
||||
"value": "={{$json.wakeText}}"
|
||||
},
|
||||
{
|
||||
"name": "mode",
|
||||
"value": "now"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {"timeout": 15000}
|
||||
"options": {
|
||||
"timeout": 15000
|
||||
}
|
||||
},
|
||||
"id": "wake",
|
||||
"name": "Trigger OpenClaw Briefing",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [730, 380],
|
||||
"position": [
|
||||
730,
|
||||
380
|
||||
],
|
||||
"retryOnFail": true,
|
||||
"maxTries": 3,
|
||||
"waitBetweenTries": 2000
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"url": "http://runtipi.kangaroo-eel.ts.net:8129/message?token=AGKnHafW3FGzBlt",
|
||||
"url": "http://runtipi.kangaroo-eel.ts.net:8129/message?token=AGoV3cAUyUMDbyt",
|
||||
"sendBody": true,
|
||||
"contentType": "json",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{"name": "title", "value": "📰 Newsletter Compressor Triggered"},
|
||||
{"name": "message", "value": "Morning newsletter compression job was triggered via n8n."},
|
||||
{"name": "priority", "value": "3"}
|
||||
{
|
||||
"name": "title",
|
||||
"value": "\ud83d\udcf0 Newsletter Compressor Triggered"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"value": "Morning newsletter compression job was triggered via n8n."
|
||||
},
|
||||
{
|
||||
"name": "priority",
|
||||
"value": "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": "gotify",
|
||||
"name": "Gotify Status",
|
||||
"name": "ntfy Status",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [980, 380]
|
||||
"position": [
|
||||
980,
|
||||
380
|
||||
]
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Daily 07:15 AWST": {"main": [[{"node": "Set Prompt", "type": "main", "index": 0}]]},
|
||||
"Webhook Execute (POST)": {"main": [[{"node": "Set Prompt", "type": "main", "index": 0}]]},
|
||||
"Set Prompt": {"main": [[{"node": "Trigger OpenClaw Briefing", "type": "main", "index": 0}]]},
|
||||
"Trigger OpenClaw Briefing": {"main": [[{"node": "Gotify Status", "type": "main", "index": 0}]]}
|
||||
"Daily 07:15 AWST": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set Prompt",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook Execute (POST)": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set Prompt",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set Prompt": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Trigger OpenClaw Briefing",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Trigger OpenClaw Briefing": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "ntfy Status",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"settings": {"executionOrder": "v1"},
|
||||
"active": false
|
||||
}
|
||||
}
|
||||
@@ -3,22 +3,44 @@
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {
|
||||
"rule": {"interval": [{"field": "cronExpression", "expression": "45 6 * * *"}]},
|
||||
"rule": {
|
||||
"interval": [
|
||||
{
|
||||
"field": "cronExpression",
|
||||
"expression": "45 6 * * *"
|
||||
}
|
||||
]
|
||||
},
|
||||
"timezone": "Australia/Perth"
|
||||
},
|
||||
"id": "cron",
|
||||
"name": "Daily 06:45 AWST",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"typeVersion": 1.2,
|
||||
"position": [220, 320]
|
||||
"position": [
|
||||
220,
|
||||
320
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{"name": "repoOwner", "type": "string", "value": "Anthony"},
|
||||
{"name": "repoName", "type": "string", "value": "openclaw-backups"},
|
||||
{"name": "branch", "type": "string", "value": "main"}
|
||||
{
|
||||
"name": "repoOwner",
|
||||
"type": "string",
|
||||
"value": "Anthony"
|
||||
},
|
||||
{
|
||||
"name": "repoName",
|
||||
"type": "string",
|
||||
"value": "openclaw-backups"
|
||||
},
|
||||
{
|
||||
"name": "branch",
|
||||
"type": "string",
|
||||
"value": "main"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -26,18 +48,26 @@
|
||||
"name": "Set Repo Context",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [440, 320]
|
||||
"position": [
|
||||
440,
|
||||
320
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"url": "=http://gitea.kangaroo-eel.ts.net:3000/api/v1/repos/{{$json.repoOwner}}/{{$json.repoName}}/commits?sha={{$json.branch}}&limit=2",
|
||||
"options": {"timeout": 10000}
|
||||
"options": {
|
||||
"timeout": 10000
|
||||
}
|
||||
},
|
||||
"id": "commits",
|
||||
"name": "Get Last 2 Commits",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [680, 320],
|
||||
"position": [
|
||||
680,
|
||||
320
|
||||
],
|
||||
"retryOnFail": true,
|
||||
"maxTries": 3,
|
||||
"waitBetweenTries": 1500
|
||||
@@ -50,28 +80,47 @@
|
||||
"name": "Prepare Compare SHAs",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 2,
|
||||
"position": [920, 320]
|
||||
"position": [
|
||||
920,
|
||||
320
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"conditions": {"string": [{"value1": "={{$json.status}}", "operation": "equals", "value2": "ok"}]}
|
||||
"conditions": {
|
||||
"string": [
|
||||
{
|
||||
"value1": "={{$json.status}}",
|
||||
"operation": "equals",
|
||||
"value2": "ok"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": "if-ready",
|
||||
"name": "Ready to Compare?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"typeVersion": 2,
|
||||
"position": [1140, 320]
|
||||
"position": [
|
||||
1140,
|
||||
320
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"url": "=http://gitea.kangaroo-eel.ts.net:3000/api/v1/repos/Anthony/openclaw-backups/compare/{{$json.base}}...{{$json.head}}",
|
||||
"options": {"timeout": 10000}
|
||||
"options": {
|
||||
"timeout": 10000
|
||||
}
|
||||
},
|
||||
"id": "compare",
|
||||
"name": "Compare Commits",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [1360, 260],
|
||||
"position": [
|
||||
1360,
|
||||
260
|
||||
],
|
||||
"retryOnFail": true,
|
||||
"maxTries": 3,
|
||||
"waitBetweenTries": 1500
|
||||
@@ -84,59 +133,187 @@
|
||||
"name": "Analyze Drift",
|
||||
"type": "n8n-nodes-base.code",
|
||||
"typeVersion": 2,
|
||||
"position": [1580, 260]
|
||||
"position": [
|
||||
1580,
|
||||
260
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"conditions": {"boolean": [{"value1": "={{$json.drift}}", "operation": "true"}]}
|
||||
"conditions": {
|
||||
"boolean": [
|
||||
{
|
||||
"value1": "={{$json.drift}}",
|
||||
"operation": "true"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": "if-drift",
|
||||
"name": "Drift Detected?",
|
||||
"type": "n8n-nodes-base.if",
|
||||
"typeVersion": 2,
|
||||
"position": [1800, 260]
|
||||
"position": [
|
||||
1800,
|
||||
260
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"url": "http://runtipi.kangaroo-eel.ts.net:8129/message?token=AGKnHafW3FGzBlt",
|
||||
"url": "http://runtipi.kangaroo-eel.ts.net:8129/message?token=AGoV3cAUyUMDbyt",
|
||||
"sendBody": true,
|
||||
"contentType": "json",
|
||||
"bodyParameters": {"parameters": [
|
||||
{"name": "title", "value": "🦀 OpenClaw Drift Detected"},
|
||||
{"name": "message", "value": "={{`Changed files: ${$json.changed.join(', ')}${$json.criticalCount>0 ? '\nCritical state changed.' : ''}`}}"},
|
||||
{"name": "priority", "value": "={{$json.criticalCount>0 ? 9 : 6}}"}
|
||||
]}
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "title",
|
||||
"value": "\ud83e\udd80 OpenClaw Drift Detected"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"value": "={{`Changed files: ${$json.changed.join(', ')}${$json.criticalCount>0 ? '\nCritical state changed.' : ''}`}}"
|
||||
},
|
||||
{
|
||||
"name": "priority",
|
||||
"value": "={{$json.criticalCount>0 ? 9 : 6}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": "gotify",
|
||||
"name": "Gotify Drift Alert",
|
||||
"name": "ntfy Drift Alert",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [2020, 220]
|
||||
"position": [
|
||||
2020,
|
||||
220
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"chatId": "1793951355",
|
||||
"text": "={{`🦀 OpenClaw drift detected\nChanged: ${$json.changed.join(', ')}${$json.criticalCount>0 ? '\n⚠️ Critical state changed' : ''}`}}"
|
||||
"text": "={{`\ud83e\udd80 OpenClaw drift detected\nChanged: ${$json.changed.join(', ')}${$json.criticalCount>0 ? '\n\u26a0\ufe0f Critical state changed' : ''}`}}"
|
||||
},
|
||||
"id": "tg",
|
||||
"name": "Telegram Drift Alert",
|
||||
"type": "n8n-nodes-base.telegram",
|
||||
"typeVersion": 1.2,
|
||||
"position": [2240, 220],
|
||||
"credentials": {"telegramApi": {"name": "Telegram account"}}
|
||||
"position": [
|
||||
2240,
|
||||
220
|
||||
],
|
||||
"credentials": {
|
||||
"telegramApi": {
|
||||
"name": "Telegram account"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Daily 06:45 AWST": {"main": [[{"node": "Set Repo Context", "type": "main", "index": 0}]]},
|
||||
"Set Repo Context": {"main": [[{"node": "Get Last 2 Commits", "type": "main", "index": 0}]]},
|
||||
"Get Last 2 Commits": {"main": [[{"node": "Prepare Compare SHAs", "type": "main", "index": 0}]]},
|
||||
"Prepare Compare SHAs": {"main": [[{"node": "Ready to Compare?", "type": "main", "index": 0}]]},
|
||||
"Ready to Compare?": {"main": [[{"node": "Compare Commits", "type": "main", "index": 0}], []]},
|
||||
"Compare Commits": {"main": [[{"node": "Analyze Drift", "type": "main", "index": 0}]]},
|
||||
"Analyze Drift": {"main": [[{"node": "Drift Detected?", "type": "main", "index": 0}]]},
|
||||
"Drift Detected?": {"main": [[{"node": "Gotify Drift Alert", "type": "main", "index": 0}], []]},
|
||||
"Gotify Drift Alert": {"main": [[{"node": "Telegram Drift Alert", "type": "main", "index": 0}]]}
|
||||
"Daily 06:45 AWST": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set Repo Context",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set Repo Context": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Get Last 2 Commits",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Get Last 2 Commits": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Prepare Compare SHAs",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Prepare Compare SHAs": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Ready to Compare?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Ready to Compare?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Compare Commits",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[]
|
||||
]
|
||||
},
|
||||
"Compare Commits": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Analyze Drift",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Analyze Drift": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Drift Detected?",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Drift Detected?": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "ntfy Drift Alert",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
[]
|
||||
]
|
||||
},
|
||||
"ntfy Drift Alert": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Telegram Drift Alert",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"settings": {"executionOrder": "v1"},
|
||||
"active": false
|
||||
}
|
||||
}
|
||||
@@ -3,14 +3,24 @@
|
||||
"nodes": [
|
||||
{
|
||||
"parameters": {
|
||||
"rule": {"interval": [{"field": "cronExpression", "expression": "0 16 * * 5"}]},
|
||||
"rule": {
|
||||
"interval": [
|
||||
{
|
||||
"field": "cronExpression",
|
||||
"expression": "0 16 * * 5"
|
||||
}
|
||||
]
|
||||
},
|
||||
"timezone": "Australia/Perth"
|
||||
},
|
||||
"id": "cron",
|
||||
"name": "Friday 4:00 PM AWST",
|
||||
"type": "n8n-nodes-base.scheduleTrigger",
|
||||
"typeVersion": 1.2,
|
||||
"position": [220, 280]
|
||||
"position": [
|
||||
220,
|
||||
280
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
@@ -23,14 +33,25 @@
|
||||
"name": "Webhook Execute (POST)",
|
||||
"type": "n8n-nodes-base.webhook",
|
||||
"typeVersion": 2,
|
||||
"position": [220, 430]
|
||||
"position": [
|
||||
220,
|
||||
430
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"assignments": {
|
||||
"assignments": [
|
||||
{"name": "draftPrompt", "type": "string", "value": "Create a weekend plan draft for Anthony in Perth. Use: calendar items next 3 days, Perth weather, and practical recommendations. Output concise sections: Saturday, Sunday, Prep List, and one fun optional idea. Keep it useful and warm."},
|
||||
{"name": "approvalHint", "type": "string", "value": "Reply APPROVE to send full plan, or REGEN to regenerate."}
|
||||
{
|
||||
"name": "draftPrompt",
|
||||
"type": "string",
|
||||
"value": "Create a weekend plan draft for Anthony in Perth. Use: calendar items next 3 days, Perth weather, and practical recommendations. Output concise sections: Saturday, Sunday, Prep List, and one fun optional idea. Keep it useful and warm."
|
||||
},
|
||||
{
|
||||
"name": "approvalHint",
|
||||
"type": "string",
|
||||
"value": "Reply APPROVE to send full plan, or REGEN to regenerate."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -38,7 +59,10 @@
|
||||
"name": "Set Planner Prompt",
|
||||
"type": "n8n-nodes-base.set",
|
||||
"typeVersion": 3.4,
|
||||
"position": [450, 350]
|
||||
"position": [
|
||||
450,
|
||||
350
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
@@ -47,60 +71,142 @@
|
||||
"contentType": "json",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{"name": "text", "value": "={{$json.draftPrompt}}"},
|
||||
{"name": "mode", "value": "now"}
|
||||
{
|
||||
"name": "text",
|
||||
"value": "={{$json.draftPrompt}}"
|
||||
},
|
||||
{
|
||||
"name": "mode",
|
||||
"value": "now"
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {"timeout": 15000}
|
||||
"options": {
|
||||
"timeout": 15000
|
||||
}
|
||||
},
|
||||
"id": "wake-draft",
|
||||
"name": "Generate Plan Draft",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [700, 350],
|
||||
"position": [
|
||||
700,
|
||||
350
|
||||
],
|
||||
"retryOnFail": true,
|
||||
"maxTries": 3,
|
||||
"waitBetweenTries": 2000
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"url": "http://runtipi.kangaroo-eel.ts.net:8129/message?token=AGKnHafW3FGzBlt",
|
||||
"url": "http://runtipi.kangaroo-eel.ts.net:8129/message?token=AGoV3cAUyUMDbyt",
|
||||
"sendBody": true,
|
||||
"contentType": "json",
|
||||
"bodyParameters": {
|
||||
"parameters": [
|
||||
{"name": "title", "value": "🗓️ Weekend Planner Draft Ready"},
|
||||
{"name": "message", "value": "={{`Draft generated. ${$node['Set Planner Prompt'].json.approvalHint}`}}"},
|
||||
{"name": "priority", "value": "5"}
|
||||
{
|
||||
"name": "title",
|
||||
"value": "\ud83d\uddd3\ufe0f Weekend Planner Draft Ready"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"value": "={{`Draft generated. ${$node['Set Planner Prompt'].json.approvalHint}`}}"
|
||||
},
|
||||
{
|
||||
"name": "priority",
|
||||
"value": "5"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": "gotify-draft",
|
||||
"name": "Gotify Draft Ready",
|
||||
"name": "ntfy Draft Ready",
|
||||
"type": "n8n-nodes-base.httpRequest",
|
||||
"typeVersion": 4.2,
|
||||
"position": [940, 350]
|
||||
"position": [
|
||||
940,
|
||||
350
|
||||
]
|
||||
},
|
||||
{
|
||||
"parameters": {
|
||||
"chatId": "1793951355",
|
||||
"text": "🦀 Weekend Planner draft is ready. Reply here with APPROVE to send final plan, or REGEN to regenerate."
|
||||
"text": "\ud83e\udd80 Weekend Planner draft is ready. Reply here with APPROVE to send final plan, or REGEN to regenerate."
|
||||
},
|
||||
"id": "telegram-review",
|
||||
"name": "Telegram Review Prompt",
|
||||
"type": "n8n-nodes-base.telegram",
|
||||
"typeVersion": 1.2,
|
||||
"position": [1160, 350],
|
||||
"credentials": {"telegramApi": {"name": "Telegram account"}}
|
||||
"position": [
|
||||
1160,
|
||||
350
|
||||
],
|
||||
"credentials": {
|
||||
"telegramApi": {
|
||||
"name": "Telegram account"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"connections": {
|
||||
"Friday 4:00 PM AWST": {"main": [[{"node": "Set Planner Prompt", "type": "main", "index": 0}]]},
|
||||
"Webhook Execute (POST)": {"main": [[{"node": "Set Planner Prompt", "type": "main", "index": 0}]]},
|
||||
"Set Planner Prompt": {"main": [[{"node": "Generate Plan Draft", "type": "main", "index": 0}]]},
|
||||
"Generate Plan Draft": {"main": [[{"node": "Gotify Draft Ready", "type": "main", "index": 0}]]},
|
||||
"Gotify Draft Ready": {"main": [[{"node": "Telegram Review Prompt", "type": "main", "index": 0}]]}
|
||||
"Friday 4:00 PM AWST": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set Planner Prompt",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Webhook Execute (POST)": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Set Planner Prompt",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Set Planner Prompt": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Generate Plan Draft",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Generate Plan Draft": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "ntfy Draft Ready",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"ntfy Draft Ready": {
|
||||
"main": [
|
||||
[
|
||||
{
|
||||
"node": "Telegram Review Prompt",
|
||||
"type": "main",
|
||||
"index": 0
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"executionOrder": "v1"
|
||||
},
|
||||
"settings": {"executionOrder": "v1"},
|
||||
"active": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user