{
  "name": "Send PM to Admins if new version is present",
  "nodes": [
    {
      "id": "3fe7ae22-58db-40a7-a4d4-7a80661caa96",
      "type": "action:http_request",
      "typeVersion": "1.0",
      "name": "Get Discourse latest version",
      "parameters": {
        "url": "https://api.discourse.org/api/version_check",
        "method": "GET",
        "headers": {},
        "never_error": false,
        "query_params": {},
        "full_response": false,
        "authentication": "none",
        "max_response_size_kb": 1024
      },
      "credentials": {},
      "webhookId": null,
      "position": {
        "x": 150,
        "y": 0
      },
      "notes": "",
      "notesInFlow": false,
      "alwaysOutputData": false
    },
    {
      "id": "6454e55b-f001-41e5-92d9-17821f8050e3",
      "type": "trigger:schedule",
      "typeVersion": "1.0",
      "name": "Schedule",
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "daysInterval": 1,
              "hoursInterval": 1,
              "triggerAtMinute": 0
            }
          ]
        }
      },
      "credentials": {},
      "webhookId": null,
      "position": {
        "x": 0,
        "y": 7.5
      },
      "notes": "",
      "notesInFlow": false,
      "alwaysOutputData": false
    },
    {
      "id": "d4e9c087-7257-47c4-9641-0f1a289f221a",
      "type": "action:http_request",
      "typeVersion": "1.0",
      "name": "Get site version",
      "parameters": {
        "url": "/about.json",
        "method": "GET",
        "headers": {},
        "never_error": false,
        "query_params": {},
        "full_response": false,
        "authentication": "none",
        "max_response_size_kb": 1024
      },
      "credentials": {},
      "webhookId": null,
      "position": {
        "x": 300,
        "y": 0
      },
      "notes": "",
      "notesInFlow": false,
      "alwaysOutputData": false
    },
    {
      "id": "284aafff-5dc9-41a4-8e5c-037572214b51",
      "type": "condition:if",
      "typeVersion": "1.0",
      "name": "If versions do not match",
      "parameters": {
        "combinator": "and",
        "conditions": [
          {
            "id": "09ba010a-e18d-41b7-baf3-560eb6eef239",
            "operator": {
              "type": "string",
              "operation": "notEquals",
              "singleValue": false
            },
            "leftValue": "={{ $(\"Get Discourse latest version\").first().json.latestVersion }}",
            "rightValue": "={{ $json.about.version }}"
          }
        ]
      },
      "credentials": {},
      "webhookId": null,
      "position": {
        "x": 450,
        "y": 0
      },
      "notes": "",
      "notesInFlow": false,
      "alwaysOutputData": false
    },
    {
      "id": "07031b4a-87a4-42ef-b4d8-f5d55d290fcf",
      "type": "action:send_personal_message",
      "typeVersion": "1.0",
      "name": "Send personal message",
      "parameters": {
        "recipient_usernames": [],
        "recipient_group_names": [
          "admins"
        ],
        "title": "New update available!",
        "raw": "=A new version '{{ $(\"Get Discourse latest version\").first().json.latestVersion }}' is available! Please update the site.",
        "sender_username": "system"
      },
      "credentials": {},
      "webhookId": null,
      "position": {
        "x": 648,
        "y": 0
      },
      "notes": "",
      "notesInFlow": false,
      "alwaysOutputData": false
    }
  ],
  "connections": {
    "Schedule": {
      "main": [
        [
          {
            "node": "Get Discourse latest version",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get site version": {
      "main": [
        [
          {
            "node": "If versions do not match",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If versions do not match": {
      "main": [
        [
          {
            "node": "Send personal message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Discourse latest version": {
      "main": [
        [
          {
            "node": "Get site version",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {},
  "variables": [],
  "staticData": {
    "node:Schedule": {
      "recurrenceRules": []
    }
  }
}