From 1f4c47a968a016ae83339adeae68dbb860401257 Mon Sep 17 00:00:00 2001 From: ogrechko Date: Sat, 27 Dec 2025 21:49:59 +0000 Subject: [PATCH] Backup: My workflow --- backups/2025-12-27/My workflow.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 backups/2025-12-27/My workflow.json diff --git a/backups/2025-12-27/My workflow.json b/backups/2025-12-27/My workflow.json new file mode 100644 index 0000000..d54e62c --- /dev/null +++ b/backups/2025-12-27/My workflow.json @@ -0,0 +1 @@ +{"updatedAt":"2025-12-03T08:56:41.048Z","createdAt":"2025-11-29T21:38:38.667Z","id":"QkcQOlUlhxvB4Urv","name":"My workflow","active":false,"isArchived":true,"nodes":[{"parameters":{"updates":["*"],"additionalFields":{}},"name":"Telegram Trigger","type":"n8n-nodes-base.telegramTrigger","typeVersion":1,"position":[-400,208],"id":"67242ab2-91ef-45ed-b065-7f3464a6d373","webhookId":"8da6a665-bf05-49f4-b17d-2a302fd2ecda","credentials":{"telegramApi":{"id":"L9KHcMiteyKROF5r","name":"Telegram account"}}},{"parameters":{"functionCode":"// Парсим сообщение из Telegram\nconst message = $input.all()[0].json.message.text;\nconst chatId = $input.all()[0].json.message.chat.id;\n\n// Проверяем формат сообщения (пример: /addip 192.168.1.100 trusted_ips 1d \"Комментарий\")\nconst match = message.match(/^\\/addip (\\d+\\.\\d+\\.\\d+\\.\\d+)(?: (\\S+)(?: (\\S+)(?: \"(.+)\")?)?)?/);\n\nif (!match) {\n return [{\n json: {\n chatId,\n error: 'Неверный формат. Используйте: /addip IP [list] [timeout] \"[comment]\"'\n }\n }];\n}\n\n// Извлекаем параметры\nconst [, ipAddress, addressList = 'trusted_hosts', timeout = '1d', comment = 'Added via Telegram'] = match;\n\nreturn [{\n json: {\n chatId,\n ipAddress,\n addressList,\n timeout,\n comment,\n success: true\n }\n}];"},"name":"Parse Telegram Command","type":"n8n-nodes-base.function","typeVersion":1,"position":[-208,208],"id":"cd42faf3-6552-4055-bba0-a0f0742e02ee"},{"parameters":{"authentication":"basicAuth","requestMethod":"POST","url":"http://10.33.33.1:8738/rest/ip/firewall/address-list","jsonParameters":true,"options":{},"bodyParametersJson":"{\n \"address\": \"{{$node['Parse Telegram Command'].json['ipAddress']}}\",\n \"list\": \"{{$node['Parse Telegram Command'].json['addressList']}}\",\n \"timeout\": \"{{$node['Parse Telegram Command'].json['timeout']}}\",\n \"comment\": \"{{$node['Parse Telegram Command'].json['comment']}}\"\n}"},"name":"MikroTik API Request","type":"n8n-nodes-base.httpRequest","typeVersion":1,"position":[0,208],"id":"8f7a7535-0423-4111-a4ad-fa1d8d57334c","credentials":{"httpBasicAuth":{"id":"gBAUOrSceRAWqNfB","name":"mikrot api"}}},{"parameters":{"operation":"send"},"name":"Telegram Success","type":"n8n-nodes-base.telegram","typeVersion":1,"position":[208,112],"id":"16fb0c34-49e5-48d5-b1a4-0eeb44b40e13","webhookId":"0260be7d-496c-4728-a861-e41d14cbdd5e","credentials":{"telegramApi":{"id":"L9KHcMiteyKROF5r","name":"Telegram account"}}},{"parameters":{"operation":"send"},"name":"Telegram Error","type":"n8n-nodes-base.telegram","typeVersion":1,"position":[208,304],"id":"976d6166-60de-4b06-99bb-c2e027229050","webhookId":"06a8453c-242e-48c4-b5b7-b868a23dc102","credentials":{"telegramApi":{"id":"L9KHcMiteyKROF5r","name":"Telegram account"}}}],"connections":{"Telegram Trigger":{"main":[[{"node":"Parse Telegram Command","type":"main","index":0}]]},"Parse Telegram Command":{"main":[[{"node":"MikroTik API Request","type":"main","index":0}]]},"MikroTik API Request":{"main":[[{"node":"Telegram Success","type":"main","index":0},{"node":"Telegram Error","type":"main","index":0}]]}},"settings":{"executionOrder":"v1"},"staticData":null,"meta":{"templateCredsSetupCompleted":true},"pinData":{},"versionId":"8955e382-3a25-4495-aa00-7f7aeef3e9eb","activeVersionId":null,"triggerCount":0,"shared":[{"updatedAt":"2025-11-29T21:38:38.667Z","createdAt":"2025-11-29T21:38:38.667Z","role":"workflow:owner","workflowId":"QkcQOlUlhxvB4Urv","projectId":"sYuiFAb87pAir6jV"}],"activeVersion":null,"tags":[]} \ No newline at end of file