Domain expiry alert on Telegram

Every week, check when your domains expire and get a Telegram alert 30 days before.

Easy Saves ~1 hours/month Developer & ITBy Flowngn team

Works with n8n · Make · Zapier

How it works

Trigger: Schedule — Mondays at 9:00
  1. List your domains in the Code step.
  2. Look up each domain's registration with the free RDAP service.
  3. Alert on Telegram when one expires within 30 days.

Diagram

trueMondays 9:00Schedule Trigger{ }Domains to checkCodeLook up registrationHTTP Request{ }Days leftCode⑂Expires within 30 d…IfTAlert on TelegramTelegram
Trigger App Logic Code

Code

JavaScript used in the Code steps — already included in the template below.

Domains to check · Code node
// The domains to watch. Add yours here.
const DOMAINS = ["yourcompany.com", "shop.yourcompany.com"];

return DOMAINS.map((domain) => ({ json: { domain } }));
Days left · Code node
// Mode: Run Once for Each Item
// Reads the expiry date from the RDAP answer and works out the days left.
const expiry = ($json.events || []).find((e) => e.eventAction === "expiration")?.eventDate;
const domain = $json.ldhName ? String($json.ldhName).toLowerCase() : "unknown";
if (!expiry) return { json: { domain, daysLeft: 9999, expires: "unknown" } };

return {
  json: {
    domain,
    expires: expiry.slice(0, 10),
    daysLeft: Math.floor((new Date(expiry) - Date.now()) / (24 * 60 * 60 * 1000)),
  },
};

Build it

Pick your tool — same automation, step by step.

Copy and paste straight into an n8n canvas (Ctrl+V), or download and use Import from File. Then connect your own credentials and replace every YOUR_… placeholder.

Workflow JSON
Show code (198 lines)
{
  "name": "Domain expiry alert on Telegram (Flowngn)",
  "nodes": [
    {
      "parameters": {
        "content": "## Domain expiry alert on Telegram\nEvery week, check when your domains expire and get a Telegram alert 30 days before.\n\n**Setup**\n1. Open each node and connect your own credentials.\n2. Replace every YOUR_… placeholder.\n3. Test once, then activate.\n\nFree template from Flowngn",
        "height": 260,
        "width": 340
      },
      "id": "2473b0b9-60e2-42f2-a04d-319a2d0b7925",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 9 * * 1"
            }
          ]
        }
      },
      "id": "2473b0b9-60e2-42f2-a04d-319a2d0b7925",
      "name": "Mondays 9:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "// The domains to watch. Add yours here.\nconst DOMAINS = [\"yourcompany.com\", \"shop.yourcompany.com\"];\n\nreturn DOMAINS.map((domain) => ({ json: { domain } }));"
      },
      "id": "2473b0b9-60e2-42f2-a04d-319a2d0b7925",
      "name": "Domains to check",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "url": "=https://rdap.org/domain/{{ $json.domain }}",
        "options": {
          "timeout": 20000
        }
      },
      "id": "2473b0b9-60e2-42f2-a04d-319a2d0b7925",
      "name": "Look up registration",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        600,
        0
      ],
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "jsCode": "// Mode: Run Once for Each Item\n// Reads the expiry date from the RDAP answer and works out the days left.\nconst expiry = ($json.events || []).find((e) => e.eventAction === \"expiration\")?.eventDate;\nconst domain = $json.ldhName ? String($json.ldhName).toLowerCase() : \"unknown\";\nif (!expiry) return { json: { domain, daysLeft: 9999, expires: \"unknown\" } };\n\nreturn {\n  json: {\n    domain,\n    expires: expiry.slice(0, 10),\n    daysLeft: Math.floor((new Date(expiry) - Date.now()) / (24 * 60 * 60 * 1000)),\n  },\n};",
        "mode": "runOnceForEachItem"
      },
      "id": "2473b0b9-60e2-42f2-a04d-319a2d0b7925",
      "name": "Days left",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        900,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "c1",
              "leftValue": "={{ $json.daysLeft }}",
              "rightValue": 30,
              "operator": {
                "type": "number",
                "operation": "lt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "2473b0b9-60e2-42f2-a04d-319a2d0b7925",
      "name": "Expires within 30 days?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        1200,
        0
      ]
    },
    {
      "parameters": {
        "chatId": "YOUR_CHAT_ID",
        "text": "=🌐 {{ $json.domain }} expires in {{ $json.daysLeft }} days ({{ $json.expires }}). Renew it now!",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "id": "2473b0b9-60e2-42f2-a04d-319a2d0b7925",
      "name": "Alert on Telegram",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1500,
        0
      ]
    }
  ],
  "connections": {
    "Mondays 9:00": {
      "main": [
        [
          {
            "node": "Domains to check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Domains to check": {
      "main": [
        [
          {
            "node": "Look up registration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Look up registration": {
      "main": [
        [
          {
            "node": "Days left",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Days left": {
      "main": [
        [
          {
            "node": "Expires within 30 days?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Expires within 30 days?": {
      "main": [
        [
          {
            "node": "Alert on Telegram",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}

Open in the playground to edit →

Tips

  • Some country domains (like .eg) don't publish RDAP data; check those at your registrar.

Related flows