Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. N8N
  3. Cloudron Notifications in Telegram

Cloudron Notifications in Telegram

Scheduled Pinned Locked Moved N8N
2 Posts 2 Posters 641 Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      M Offline
      manngobaum
      wrote on last edited by manngobaum
      #1

      My goal is to interact with my Cloudron Instance via Telegram or other Chat protocols. I know there are already implementations for Uptime Kuma but I wanted to have more flexibilty and for the future also response endpoints in my messages (restarting an app or even Cloudron (it's not impleted yet)).

      What it basically does is to fetch the Cloudron notifications of a certain status and to send a message to a Telegram Chat.
      Therefore I set up a Telegram Bot (https://core.telegram.org/bots). Started a chat with this bot and used the following HTTP request to receive the chat ID which is needed for n8n:

      https://api.telegram.org/bot{TELEGRAMBOT_API_KEY}/getUpdates
      

      You also need an API Key to access your Cloudron (https://my.xxx.tld.de/#/profile) -> under API Tokens

      And here is the code for the notifications to build the workflow in n8n:

      {
        "nodes": [
          {
            "parameters": {
              "interval": 60
            },
            "name": "Interval",
            "type": "n8n-nodes-base.interval",
            "typeVersion": 1,
            "position": [
              460,
              300
            ]
          },
          {
            "parameters": {
              "url": "https://my.xxx.tld/api/v1/notifications?acknowledged=false&page=1&per_page=100",
              "options": {
                "splitIntoItems": false
              },
              "headerParametersUi": {
                "parameter": [
                  {
                    "name": "authorization",
                    "value": "Bearer {Cloudron_API_KEY}"
                  }
                ]
              }
            },
            "name": "HTTP Request",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 2,
            "position": [
              620,
              300
            ]
          },
          {
            "parameters": {
              "chatId": "{TELEGRAM_CHAT_ID}",
              "text": "=<b>What?</b>\n{{$node[\"Item Lists\"].json[\"title\"]}}\n\n<b>When?</b>\n{{$node[\"Item Lists\"].json[\"creationTime\"]}}\n\n<b>Message</b>\n{{$node[\"Item Lists\"].json[\"message\"]}}",
              "additionalFields": {
                "parse_mode": "HTML"
              }
            },
            "name": "Telegram",
            "type": "n8n-nodes-base.telegram",
            "typeVersion": 1,
            "position": [
              940,
              300
            ],
            "credentials": {
              "telegramApi": {
                "id": "7",
                "name": "Telegram account"
              }
            }
          },
          {
            "parameters": {
              "fieldToSplitOut": "notifications",
              "options": {}
            },
            "name": "Item Lists",
            "type": "n8n-nodes-base.itemLists",
            "typeVersion": 1,
            "position": [
              780,
              300
            ]
          },
          {
            "parameters": {
              "requestMethod": "POST",
              "url": "=https://my.xxx.tld/api/v1/notifications/{{$node[\"Item Lists\"].json[\"id\"]}}",
              "options": {},
              "headerParametersUi": {
                "parameter": [
                  {
                    "name": "authorization",
                    "value": "Bearer XXX"
                  }
                ]
              }
            },
            "name": "HTTP Request1",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 2,
            "position": [
              1100,
              300
            ]
          }
        ],
        "connections": {
          "Interval": {
            "main": [
              [
                {
                  "node": "HTTP Request",
                  "type": "main",
                  "index": 0
                }
              ]
            ]
          },
          "HTTP Request": {
            "main": [
              [
                {
                  "node": "Item Lists",
                  "type": "main",
                  "index": 0
                }
              ]
            ]
          },
          "Telegram": {
            "main": [
              [
                {
                  "node": "HTTP Request1",
                  "type": "main",
                  "index": 0
                }
              ]
            ]
          },
          "Item Lists": {
            "main": [
              [
                {
                  "node": "Telegram",
                  "type": "main",
                  "index": 0
                }
              ]
            ]
          }
        }
      }
      

      I'll update this soon to include App downtimes with the possibilty to restart the App right away.

      1 Reply Last reply
      6
      • M manngobaum referenced this topic on
      • andreasduerenA Offline
        andreasduerenA Offline
        andreasdueren
        wrote on last edited by
        #2

        Did you explore this any further?

        1 Reply Last reply
        1
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Bookmarks
          • Search