Nightly DigitalOcean Droplet snapshots with auto-cleanup
Back up your DigitalOcean servers every night, automatically delete snapshots past your retention window, and get a Slack recap of exactly what changed.
Every night at 2:00am, snapshot my tagged DigitalOcean Droplets, prune old snapshots beyond a retention window, and post a summary to Slack. Use a cron trigger set to run once nightly at 02:00.
Expose these settings at the top of the workflow so they are easy to change: the Droplet tag to back up (default "backup"), the retention count (default: keep the 7 most recent snapshots per Droplet and delete the rest), the snapshot name date format (default YYYY-MM-DD), and the Slack channel to post the summary to.
Step 1 - find the Droplets. Call DigitalOcean's List All Droplets operation filtered by the configured backup tag to get the set of Droplets to snapshot. If none match the tag, skip straight to the Slack step and report that nothing was tagged for backup.
Step 2 - take snapshots. For each Droplet, call Initiate a Droplet Action with type "snapshot" and a name built from the Droplet name plus the current date in the configured date format (for example "web-01-2026-07-17"). Alternatively, use Act on Tagged Droplets to snapshot the whole tag in one bulk call. Remember that DigitalOcean Droplet actions are asynchronous: each call returns an action object with an id and a status. Collect every returned action id.
Step 3 - wait for completion. Poll Retrieve a Droplet Action for each action id until its status is "completed" or "errored", waiting a few seconds between polls and capping the total wait so the workflow cannot hang forever. Record which Droplets completed successfully and which returned an error.
Step 4 - prune old snapshots. After the new snapshots exist, list the snapshots for each Droplet with List Snapshots for a Droplet (or use List All Snapshots for the whole account and group them by Droplet). Sort each Droplet's snapshots newest first, keep the number set by the retention count, and call Delete a Snapshot for every snapshot beyond that window. Track which snapshot names or ids were deleted per Droplet.
Step 5 - confirm in Slack. Finish by using the Send a Message action (posting as the Slack bot) to the configured channel with a summary: list which Droplets were snapshotted and which old snapshots were deleted per Droplet. If any snapshot action returned status "errored", any poll timed out, or any delete call failed, add a clearly marked warning line at the top naming the affected Droplets so the failure is not missed.
Additional information
What does this prompt do?
- Runs every night and takes a fresh snapshot of every DigitalOcean server you have tagged for backup
- Automatically deletes older snapshots so you only keep the most recent few per server and control storage costs
- Posts a Slack summary of which servers were backed up and which old snapshots were removed
- Flags a warning in Slack if any backup or cleanup step failed, so nothing silently breaks
What do I need to use this?
- A DigitalOcean account with the servers you want to back up
- A tag on those servers (for example "backup") so the workflow knows which ones to snapshot
- A Slack workspace and the channel where you want the nightly summary posted
How can I customize it?
- Change which servers get backed up by editing the tag it looks for
- Set how many snapshots to keep per server before older ones are deleted (the default keeps the 7 most recent)
- Adjust the run time, the date format used in snapshot names, and the Slack channel
Frequently asked questions
How does this save money on DigitalOcean storage?
Which servers get backed up?
What happens if a backup fails?
Will it ever delete a backup I still need?
Can I change when it runs?
Related templates
Stop paying for backups you forgot to delete.
Put your DigitalOcean snapshots on autopilot with nightly backups, automatic cleanup, and a Slack recap every morning.