AutomationFlowsGeneral › Send Email If Server Has Upgradable Packages

Send Email If Server Has Upgradable Packages

ByHostinger @hostinger on n8n.io

This workflow automates the routine check for upgradable packages on your Ubuntu server, ensuring you stay updated with the latest software patches and security improvements. By running a daily script, it efficiently monitors any available package upgrades and promptly notifies…

Cron / scheduled trigger★★★★☆ complexity7 nodesSshEmail Send
General Trigger: Cron / scheduled Nodes: 7 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #2925 — we link there as the canonical source.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "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": {
          "name": "<your credential>"
        }
      },
      "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
      ],
      "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": "user@example.com",
        "fromEmail": "user@example.com"
      },
      "credentials": {
        "smtp": {
          "name": "<your credential>"
        }
      },
      "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 `<li>${line.trim()}</li>`;\n        }\n    }).filter(item => item); // Remove any undefined items due to empty lines or skipped headers\n\n    // Wrap the list items in a <ul> tag\n    const htmlList = `<ul>${htmlListItems.join('')}</ul>`;\n\n    // Return the formatted HTML list as part of an object\n    return { \"htmlList\": htmlList };\n}\n\nreturn formatStdoutAsHtmlList($input.first().json.stdout);"
      },
      "typeVersion": 2
    },
    {
      "id": "6f14eb02-c505-4f83-a5bb-68094e763fd9",
      "name": "Check if there are updates",
      "type": "n8n-nodes-base.if",
      "position": [
        140,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "db66d892-26fb-406c-a0ac-2e4b8a60310a",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.htmlList }}",
              "rightValue": "<ul></ul>"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "3924c696-5b0e-4ae2-b2e2-435fed344028",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        -180
      ],
      "parameters": {
        "width": 300,
        "content": "## VPS upgrade notify \nThis workflow will everyday check if server has upgradable packages and inform you by email if there is."
      },
      "typeVersion": 1
    },
    {
      "id": "bb8ade2a-4ffe-4c79-91eb-55af568eb1b1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        -180
      ],
      "parameters": {
        "width": 300,
        "content": "## Update email addresses\nUpdate From and To email addresses in this node to receive notifications"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Format as HTML list": {
      "main": [
        [
          {
            "node": "Check if there are updates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run workflow every day": {
      "main": [
        [
          {
            "node": "List upgradable packages",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email through SMTP": {
      "main": [
        []
      ]
    },
    "List upgradable packages": {
      "main": [
        [
          {
            "node": "Format as HTML list",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if there are updates": {
      "main": [
        [
          {
            "node": "Send Email through SMTP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow automates the routine check for upgradable packages on your Ubuntu server, ensuring you stay updated with the latest software patches and security improvements. By running a daily script, it efficiently monitors any available package upgrades and promptly notifies…

Source: https://n8n.io/workflows/2925/ — original creator credit. Request a take-down →

More General workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

General

This n8n workflow template is designed to help system administrators and DevOps professionals monitor key resource usage metrics — CPU, RAM, and Disk — on a VPS (Virtual Private Server). The workflow

Email Send, Ssh
General

Ssh Workflow. Uses ssh, emailSend. Scheduled trigger; 7 nodes.

Ssh, Email Send
General

Perfect for content publishing with organic scheduling patterns, social media automation, API systems that need to avoid rate limiting, or any automation requiring randomised timing control across mul

n8n, Read Write File, Stop And Error +1
General

Complete backup solution that saves both workflows and credentials to local/server disk with optional FTP upload for off-site redundancy.

Read Write File, Email Send, Execute Command +3
General

This workflow automates flight price comparison across multiple booking platforms (Kayak, Skyscanner, Expedia, Google Flights). It accepts natural language queries, extracts flight details using NLP,

Ssh, Email Send