n8n Workflow

Automate Droplet Snapshots On Digitalocean

This n8n workflow automates tasks and integrates with various services. Automate Droplet Snapshots On Digitalocean - ready to import and run in your n8n instance.

n8n workflow.json

About This Script

This n8n workflow automates tasks and integrates with various services. Automate Droplet Snapshots On Digitalocean - ready to import and run in your n8n instance.
Features:
  • Makes HTTP requests to external APIs
  • Scheduled automation with cron triggers
Source Code
{
    "nodes": [
        {
            "id": "b6582c37-00c3-467c-95cb-fc6eb7ccd27d",
            "name": "Filter",
            "type": "n8n-nodes-base.filter",
            "position": [
                1080,
                420
            ],
            "parameters": {
                "conditions": {
                    "number": [
                        {
                            "value1": "={{ $json.meta.total }}",
                            "value2": 4,
                            "operation": "largerEqual"
                        }
                    ]
                }
            },
            "typeVersion": 1
        },
        {
            "id": "54b0f895-7e56-40eb-bc6c-f657457d004a",
            "name": "List Snapshots for a Droplet",
            "type": "n8n-nodes-base.httpRequest",
            "position": [
                840,
                420
            ],
            "parameters": {
                "url": "=https://api.digitalocean.com/v2/droplets/{{ $json.droplets[0].id }}/snapshots ",
                "options": [],
                "authentication": "headerAuth"
            },
            "credentials": {
                "httpHeaderAuth": {
                    "id": "1kwUrzy4cJXZx48R",
                    "name": "Digital Ocean Account (darryn@optimus01.co.za)"
                }
            },
            "typeVersion": 1,
            "alwaysOutputData": false
        },
        {
            "id": "7c47438f-db04-41f7-aed6-a460d0a6889b",
            "name": "List All Droplets",
            "type": "n8n-nodes-base.httpRequest",
            "notes": "f3bc462f9219860aafe79747ee369e2f79ccd7f9b096dfe66b55d946871e8942",
            "position": [
                600,
                420
            ],
            "parameters": {
                "url": "https://api.digitalocean.com/v2/droplets",
                "options": [],
                "authentication": "headerAuth"
            },
            "credentials": {
                "httpHeaderAuth": {
                    "id": "1kwUrzy4cJXZx48R",
                    "name": "Digital Ocean Account (darryn@optimus01.co.za)"
                }
            },
            "typeVersion": 1
        },
        {
            "id": "e751f6a4-0fdc-4be5-84f0-fecba100da09",
            "name": "Delete a Snapshot",
            "type": "n8n-nodes-base.httpRequest",
            "notes": "f3bc462f9219860aafe79747ee369e2f79ccd7f9b096dfe66b55d946871e8942",
            "position": [
                1320,
                420
            ],
            "parameters": {
                "url": "=https://api.digitalocean.com/v2/snapshots/{{ $json.snapshots[0].id }}",
                "options": [],
                "requestMethod": "DELETE",
                "authentication": "headerAuth"
            },
            "credentials": {
                "httpHeaderAuth": {
                    "id": "1kwUrzy4cJXZx48R",
                    "name": "Digital Ocean Account (darryn@optimus01.co.za)"
                }
            },
            "typeVersion": 1
        },
        {
            "id": "d4cc4a72-f909-4c10-bada-e5c731e46c5e",
            "name": "Droplet Actions snapshot (n8n.optimus01.co.za)",
            "type": "n8n-nodes-base.httpRequest",
            "notes": "f3bc462f9219860aafe79747ee369e2f79ccd7f9b096dfe66b55d946871e8942",
            "position": [
                1560,
                420
            ],
            "parameters": {
                "url": "=https://api.digitalocean.com/v2/droplets/{{ $('List All Droplets').item.json.droplets[0].id }}/actions ",
                "options": [],
                "requestMethod": "POST",
                "authentication": "headerAuth",
                "bodyParametersUi": {
                    "parameter": [
                        {
                            "name": "type",
                            "value": "snapshot"
                        }
                    ]
                }
            },
            "credentials": {
                "httpHeaderAuth": {
                    "id": "1kwUrzy4cJXZx48R",
                    "name": "Digital Ocean Account (darryn@optimus01.co.za)"
                }
            },
            "typeVersion": 1
        },
        {
            "id": "4f3be74a-add7-4a2c-99df-d5d47f17efee",
            "name": "Runs every 48hrs",
            "type": "n8n-nodes-base.cron",
            "position": [
                360,
                420
            ],
            "parameters": {
                "triggerTimes": {
                    "item": [
                        {
                            "mode": "everyX",
                            "value": 48
                        }
                    ]
                }
            },
            "typeVersion": 1
        },
        {
            "id": "518a7b8c-adf6-448e-9f4a-5acc0f31523d",
            "name": "Sticky Note2",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                300,
                180
            ],
            "parameters": {
                "color": "#FFF59D",
                "width": 232.0445295774649,
                "height": 411.1655661971828,
                "content": "Configuration note: update with your credentials or endpoint."
            },
            "typeVersion": 1
        },
        {
            "id": "70fe9177-e770-4f19-8fbc-3782167dda55",
            "name": "Sticky Note3",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                540,
                180
            ],
            "parameters": {
                "color": "#FFF59D",
                "width": 232.0445295774649,
                "height": 411.1655661971829,
                "content": "Configuration note: update with your credentials or endpoint."
            },
            "typeVersion": 1
        },
        {
            "id": "04d74698-0198-45c8-8a79-183fd5f19820",
            "name": "Sticky Note4",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                780,
                180
            ],
            "parameters": {
                "color": "#FFF59D",
                "width": 232.0445295774649,
                "height": 412.3020619718309,
                "content": "Configuration note: update with your credentials or endpoint."
            },
            "typeVersion": 1
        },
        {
            "id": "4a971e9a-dfdf-4932-8280-3991a83c2a72",
            "name": "Sticky Note5",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                1020,
                180
            ],
            "parameters": {
                "color": "#FFF59D",
                "width": 232.0445295774649,
                "height": 411.1655661971828,
                "content": "Configuration note: update with your credentials or endpoint."
            },
            "typeVersion": 1
        },
        {
            "id": "bb9a553a-a8fc-4b72-b0e0-704ebaf8b806",
            "name": "Sticky Note6",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                1260,
                180
            ],
            "parameters": {
                "color": "#FFF59D",
                "width": 232.0445295774649,
                "height": 411.1655661971829,
                "content": "Configuration note: update with your credentials or endpoint."
            },
            "typeVersion": 1
        },
        {
            "id": "1811812f-db56-494a-8ffa-d64cc6f5037c",
            "name": "Sticky Note7",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                1500,
                180
            ],
            "parameters": {
                "color": "#FFF59D",
                "width": 232.0445295774649,
                "height": 411.1655661971829,
                "content": "Configuration note: update with your credentials or endpoint."
            },
            "typeVersion": 1
        },
        {
            "id": "cb2bd85e-578b-4888-9625-ffed7249082c",
            "name": "Sticky Note1",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                -545,
                200
            ],
            "parameters": {
                "color": "#FFF59D",
                "width": 366.75796434038665,
                "height": 381.1643518785302,
                "content": "Configuration note: update with your credentials or endpoint."
            },
            "typeVersion": 1
        },
        {
            "id": "7fbb406b-9343-4d3c-9876-80cb3b7bd51e",
            "name": "Sticky Note11",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                -165,
                240
            ],
            "parameters": {
                "color": "#FFF59D",
                "width": 396.6384066163515,
                "height": 282.5799404564392,
                "content": "Configuration note: update with your credentials or endpoint."
            },
            "typeVersion": 1
        },
        {
            "id": "8afb93b2-e547-4f3b-be25-5ab85a3f477d",
            "name": "Sticky Note14",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                -545,
                600
            ],
            "parameters": {
                "width": 777.0408639013781,
                "height": 201.45195676871373,
                "content": "Configuration note: update with your credentials or endpoint.",
                "color": "#FFF59D"
            },
            "typeVersion": 1
        },
        {
            "id": "325a4b9c-9bd4-4f29-8595-98f0579d15c1",
            "name": "Sticky Note9",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                -560,
                60
            ],
            "parameters": {
                "color": "#FFF59D",
                "width": 809.515353297114,
                "height": 944.3745310796205,
                "content": "Configuration note: update with your credentials or endpoint."
            },
            "typeVersion": 1
        },
        {
            "id": "9540cfa4-4b72-40c2-b1d1-5bf3f9bd7884",
            "name": "Sticky Note15",
            "type": "n8n-nodes-base.stickyNote",
            "position": [
                -545,
                820
            ],
            "parameters": {
                "color": "#FFF59D",
                "width": 777.0408639013781,
                "height": 168.5111194243667,
                "content": "Configuration note: update with your credentials or endpoint."
            },
            "typeVersion": 1
        }
    ],
    "connections": {
        "Filter": {
            "main": [
                [
                    {
                        "node": "Delete a Snapshot",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Runs every 48hrs": {
            "main": [
                [
                    {
                        "node": "List All Droplets",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Delete a Snapshot": {
            "main": [
                [
                    {
                        "node": "Droplet Actions snapshot (n8n.optimus01.co.za)",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "List All Droplets": {
            "main": [
                [
                    {
                        "node": "List Snapshots for a Droplet",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "List Snapshots for a Droplet": {
            "main": [
                [
                    {
                        "node": "Filter",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        }
    },
    "n8n_version": "1.5.0"
}
Requirements
n8n instance, API credentials for connected services
Tags
#n8n #automation #workflow
Quick Actions
More in n8n Workflows