Add SSH-based n8n workflow to run validate-settings.sh

This commit is contained in:
2026-03-30 18:16:06 -04:00
parent 61a96d490c
commit c4c57a1dab
2 changed files with 296 additions and 0 deletions
+152
View File
@@ -0,0 +1,152 @@
{
"name": "MQL Settings Monitor - SSH Localhost",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "hours",
"hoursInterval": 6
}
]
}
},
"name": "Schedule - Every 6 Hours",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"authentication": "password",
"host": "localhost",
"port": 22,
"username": "garfield",
"password": "=onelove01",
"command": "/home/garfield/mql-trading-bots/scripts/validate-settings.sh"
},
"name": "SSH - Run Validation",
"type": "n8n-nodes-base.ssh",
"typeVersion": 1,
"position": [
450,
300
],
"credentials": {
"sshPassword": {
"id": "local-ssh-creds",
"name": "Local SSH Creds"
}
}
},
{
"parameters": {
"conditions": {
"number": [
{
"value1": "={{ $json.code }}",
"operation": "notEqual",
"value2": 0
}
]
}
},
"name": "Has Issues?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
650,
300
]
},
{
"parameters": {
"chatId": "={{ $env.TELEGRAM_CHAT_ID }}",
"text": "=🚨 <b>MQL Settings Issues Detected</b>\n\n<pre>{{ $json.stdout }}</pre>\n\n⏰ {{ new Date().toLocaleString() }}"
},
"name": "Telegram Alert",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1,
"position": [
850,
200
],
"credentials": {
"telegramApi": {
"id": "telegram-bot-api",
"name": "Telegram Bot API"
}
}
},
{
"parameters": {},
"name": "Success - No Alert",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
850,
400
]
}
],
"connections": {
"Schedule - Every 6 Hours": {
"main": [
[
{
"node": "SSH - Run Validation",
"type": "main",
"index": 0
}
]
]
},
"SSH - Run Validation": {
"main": [
[
{
"node": "Has Issues?",
"type": "main",
"index": 0
}
]
]
},
"Has Issues?": {
"main": [
[
{
"node": "Telegram Alert",
"type": "main",
"index": 0
}
],
[
{
"node": "Success - No Alert",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"staticData": null,
"tags": [
{
"name": "trading",
"id": "trading-tag"
},
{
"name": "mql5",
"id": "mql5-tag"
}
]
}