Files
buryan-infra/infra/n8n/workflows/workflow-current.json
T
root d2ecee05bc feat(n8n): workflows-as-code — 4 canonical workflows under Git control
Closes Phase 0 of Foundation & Swarm sprint (#null).

Workflows:
- Buryan Health Monitor (webhook → host_states)
- Alert Queue Processor (cron 15min → Telegram)
- Uptime Kuma Self-Healing (webhook → Gitea issue)
- Gitea Task Dispatcher (webhook → Agent Swarm)

All workflows cleaned (del shared/activeVersion/versionId) for portability.

Ref: MASTER-PLAN.md v1.2 §4 Phase 0
2026-10-06 21:40:26 +03:00

230 lines
6.5 KiB
JSON

[
{
"id": "TSqu00NJx2JOrtoN",
"name": "Uptime Kuma → Gitea Self-Healing",
"description": null,
"active": true,
"createdAt": "2026-09-11T12:37:51.879Z",
"updatedAt": "2026-09-25T07:26:21.344Z",
"isArchived": false,
"sourceWorkflowId": null,
"triggerCount": 1,
"nodes": [
{
"name": "Uptime Kuma Webhook",
"webhookId": "95de5809-c2a6-4ba1-a472-89debbc46fbb",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
256,
304
],
"parameters": {
"path": "uptime-kuma",
"options": {},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"id": "3d7a7e98-5b78-4709-9474-1e10bae2469b"
},
{
"name": "Extract Info",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
480,
304
],
"parameters": {
"jsCode": "const webhookData = $input.first().json;\nconst body = webhookData.body || webhookData;\n\nconst monitorName = body.monitor_name || 'Unknown';\nconst monitorUrl = body.monitor_url || '';\nconst status = parseInt(body.heartbeat_status) || 0;\nconst message = body.heartbeat_message || 'Service is down';\n\nconst ctMatch = monitorName.match(/\\((\\d+)\\)/);\nconst ctId = ctMatch ? ctMatch[1] : null;\n\nreturn [{\n json: {\n monitorName,\n monitorUrl,\n status,\n message,\n ctId,\n timestamp: new Date().toISOString(),\n shouldAlert: status === 0 && ctId !== null\n }\n}];"
},
"id": "49a459f5-1b1e-4bd6-83d9-b231a7d018c6"
},
{
"name": "Should Create Issue?",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
720,
304
],
"parameters": {
"options": {},
"conditions": {
"boolean": [
{
"value1": "={{ $json.shouldAlert }}",
"value2": true
}
],
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and"
}
},
"id": "a5a56bde-cd3c-404c-959d-5eb4cf344f80"
},
{
"name": "Create Gitea Issue",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
944,
208
],
"parameters": {
"url": "http://192.168.1.140:3000/api/v1/repos/root/buryan-hub/issues",
"method": "POST",
"options": {},
"jsonBody": "={{ JSON.stringify({ title: \"AUTO-FIX: \" + $json.monitorName + \" DOWN\", body: \"CT_DOWN:\" + $json.ctId + \"\\n\\nАвтоматическое восстановление \" + $json.monitorName + \".\\n\\nURL: \" + $json.monitorUrl + \"\\nMessage: \" + $json.message + \"\\nTime: \" + $json.timestamp, labels: [2] }) }}",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"headerParameters": {
"parameters": [
{
"name": "Authorization",
"value": "token 416f50c1a559be2def78bd6e3616a97906b0623d"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"id": "ffc579ec-a0cf-41d4-9444-66fc9af71bfb"
},
{
"name": "Respond",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
1184,
208
],
"parameters": {
"options": {},
"respondWith": "json",
"responseBody": "={{ JSON.stringify({ ok: true, issue_created: $json.html_url || null }) }}"
},
"id": "b7050fd1-a247-4b50-846d-4358e7073e89"
},
{
"id": "06142831-0672-469e-898e-79463b84f3db",
"name": "Notify Telegram",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
1200,
304
],
"parameters": {
"method": "POST",
"url": "https://193.233.210.184/tg-api/bot8668603602:AAHVmUmq44dcomw8QOfw_qj1aICXuT5c5XU/sendMessage",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "chat_id",
"value": "=273442500"
},
{
"name": "text",
"value": "=🚨 {{ $json.monitorName }} DOWN\n\nURL: {{ $json.monitorUrl }}\nВремя: {{ new Date().toLocaleString(\"ru-RU\") }}\n\nIssue создан в Gitea"
},
{
"name": "parse_mode",
"value": "HTML"
}
]
},
"options": {
"allowUnauthorizedCerts": true
},
"proxy": "http://193.233.210.184:1080"
}
}
],
"connections": {
"Extract Info": {
"main": [
[
{
"node": "Should Create Issue?",
"type": "main",
"index": 0
}
]
]
},
"Create Gitea Issue": {
"main": [
[
{
"node": "Notify Telegram",
"type": "main",
"index": 0
}
]
]
},
"Uptime Kuma Webhook": {
"main": [
[
{
"node": "Extract Info",
"type": "main",
"index": 0
}
]
]
},
"Should Create Issue?": {
"main": [
[
{
"node": "Create Gitea Issue",
"type": "main",
"index": 0
}
]
]
},
"Notify Telegram": {
"main": [
[
{
"node": "Respond",
"type": "main",
"index": 0
}
]
]
}
},
"nodeGroups": [],
"settings": {
"binaryMode": "separate",
"executionOrder": "v1"
},
"staticData": null,
"pinData": {},
"meta": null,
"tags": []
}
]