Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lanhild/f5259f2afafc99037a6a0c05f3b7e452 to your computer and use it in GitHub Desktop.
Save Lanhild/f5259f2afafc99037a6a0c05f3b7e452 to your computer and use it in GitHub Desktop.
n8n workflow to check for Cloudron platform reboot
{
"name": "[CRON] Check for Cloudron platform reboot copy",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "hours",
"hoursInterval": 12
}
]
}
},
"id": "00628b68-02d1-4129-ba62-32f905f29964",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"typeVersion": 1.1,
"position": [
1580,
540
]
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "a091fb70-f050-47e6-a6bd-2aced8d8d952",
"name": "channelId",
"value": "",
"type": "string"
},
{
"id": "f0680348-c5c9-4f8f-ad6a-f30cabe917e9",
"name": "cloudronDomain",
"value": "",
"type": "string"
},
{
"id": "a09ca82e-ec3f-47d9-a235-887276b43faa",
"name": "authorName",
"value": "",
"type": "string"
}
]
},
"includeOtherFields": true,
"options": {}
},
"id": "7e5f388b-a4c8-4421-a518-e2d1e11be4c6",
"name": "Workflow metadata",
"type": "n8n-nodes-base.set",
"typeVersion": 3.3,
"position": [
1820,
540
]
},
{
"parameters": {
"content": "This workflow listens for Cloudron platform reboot notifications. If it detects that a reboot is required, a notification is sent to the configured Mattermost server.\n\nIt runs on an 12 hour basis.",
"height": 116.45215305363553,
"width": 537.2856091016785,
"color": 4
},
"id": "85fb4b5d-ea49-4048-bce0-aef6731461a7",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
1580,
400
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict"
},
"conditions": [
{
"id": "a34cc90a-8049-49e5-bad9-97f231bd1c7f",
"leftValue": false,
"rightValue": "",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "21e87c1d-f5b3-4fb7-8547-3b55df31ba77",
"name": "Check if reboot is required",
"type": "n8n-nodes-base.if",
"typeVersion": 2,
"position": [
2320,
540
]
},
{
"parameters": {},
"id": "f7ce1b8f-abe6-42d2-9483-e41c77051dd3",
"name": "No Operation, do nothing",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
2580,
740
]
},
{
"parameters": {
"url": "=https://{{ $json.cloudronDomain }}/api/v1/system/info",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"options": {}
},
"id": "93fd7050-8606-4a2a-b194-5ae8e70c821c",
"name": "Get Cloudron system info",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
2060,
540
],
"credentials": {
"httpHeaderAuth": {
"id": "ZAuvHBBgcrxZHUvj",
"name": "Numigi Cloudron Readonly"
}
}
},
{
"parameters": {
"channelId": "={{ $('Workflow metadata').item.json.channelId }}",
"attachments": [
{
"color": "#F5BE5C",
"author_name": "={{ $('Workflow metadata').item.json.authorName }}",
"title": "Server Restart Required",
"author_link": "=https://{{ $('Workflow metadata').item.json.cloudronDomain }}"
}
],
"otherOptions": {}
},
"id": "73e8b5e4-f714-4b49-b592-26ff41dcce17",
"name": "Send notification",
"type": "n8n-nodes-base.mattermost",
"typeVersion": 1,
"position": [
2580,
540
],
"credentials": {
"mattermostApi": {
"id": "EaUIVEJuzpV1qxz6",
"name": "Numigi Chat Release Bell Bot"
}
}
}
],
"pinData": {},
"connections": {
"Schedule Trigger": {
"main": [
[
{
"node": "Workflow metadata",
"type": "main",
"index": 0
}
]
]
},
"Workflow metadata": {
"main": [
[
{
"node": "Get Cloudron system info",
"type": "main",
"index": 0
}
]
]
},
"Check if reboot is required": {
"main": [
[
{
"node": "Send notification",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Get Cloudron system info": {
"main": [
[
{
"node": "Check if reboot is required",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "4e35a48a-2fcf-4ba3-917e-05c4e45da18a",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "hPofPqNKA1eRrVtM",
"tags": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment