{ "nodes": [ { "id": "4ca55c6e-cf2e-4239-82a9-88d0a201e761", "name": "List upgradable packages", "type": "n8n-nodes-base.ssh", "notes": "apt list --upgradable", "position": [ -280, 0 ], "parameters": { "command": "apt list --upgradable" }, "credentials": { "sshPassword": { "id": "Ps31IKTeseWFlA0g", "name": "SSH Password account" } }, "notesInFlow": true, "typeVersion": 1, "alwaysOutputData": false }, { "id": "ae1f0a55-31aa-494b-baa6-822dc606188e", "name": "Send Email through SMTP", "type": "n8n-nodes-base.emailSend", "position": [ 380, 0 ], "webhookId": "8073c571-b36f-4330-a510-ca2ff2924fbf", "parameters": { "html": "=The following packages can be updated on your server:\n\n{{ $json.htmlList }}\n\nPlease login and perform upgrade.", "options": {}, "subject": "Server needs updates", "toEmail": "change.me@example.com", "fromEmail": "change.me@example.com" }, "credentials": { "smtp": { "id": "uiNePdJaDng5a43S", "name": "SMTP account" } }, "typeVersion": 2.1 }, { "id": "e1d76671-d94c-40d5-9364-623db9319f11", "name": "Run workflow every day", "type": "n8n-nodes-base.scheduleTrigger", "position": [ -540, 0 ], "parameters": { "rule": { "interval": [ {} ] } }, "typeVersion": 1.2 }, { "id": "ec4d722a-b88c-42da-971c-28ad5774596d", "name": "Format as HTML list", "type": "n8n-nodes-base.code", "position": [ -60, 0 ], "parameters": { "jsCode": "function formatStdoutAsHtmlList(stdoutData) {\n\n // Split the stdout into lines and map to HTML list items\n const htmlListItems = stdoutData.split('\\n').map((line) => {\n if (line.trim() && line !== \"Listing...\") { // Optionally skip empty lines or headers\n return `
  • ${line.trim()}
  • `;\n }\n }).filter(item => item); // Remove any undefined items due to empty lines or skipped headers\n\n // Wrap the list items in a