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.

Deterministic Code
DigitalOceanSlack BotEngineeringOperationsNotifications & Alerts
PromptCreate

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.

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

FAQs

How does this save money on DigitalOcean storage?
Snapshots are billed monthly per gigabyte, so old backups quietly add up. By keeping only the most recent few per server and deleting the rest every night, you stop paying for backups you no longer need.
Which servers get backed up?
Only the DigitalOcean servers you have given a specific tag, "backup" by default. Tag a server to include it or remove the tag to leave it out, without editing the workflow.
What happens if a backup fails?
The Slack summary includes a clear warning line naming any server whose snapshot or cleanup did not complete, so you can look into it right away instead of finding out later.
Will it ever delete a backup I still need?
It only removes snapshots beyond the retention count you set and always keeps the newest ones. Raise the count if you want to hold on to a longer history.
Can I change when it runs?
Yes. It is set for 2am nightly by default, but you can move it to any time or frequency that fits your maintenance window.

Related templates

Build a credential rotation checklist when someone leaves

When someone leaves, we check which shared passwords they used in their final months and post a ranked rotation list to your security channel.

1Password
Rippling
Slack Bot
+1
Agentic Task
Weekly Amazon S3 bucket security audit posted to Slack

Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.

Amazon S3
Slack Bot
Google Sheets
Agentic Task
Log Agorapulse social conversations to HubSpot contacts

Twice every weekday, the conversations from your social inbox land on the right HubSpot contact timelines, with a Slack recap for sales.

Agorapulse
HubSpot
Slack Bot
Agentic Task
Clean up HubSpot contacts from your Amazon SES suppression list

Every morning, find the addresses that hard bounced or filed a spam complaint, update the matching HubSpot contacts, and post a short Slack recap.

Amazon SES
HubSpot
Slack Bot
Agentic Task
Draft polite follow-ups for emails that never got a reply

Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.

Aurinko
Google Sheets
Slack Bot
Agentic Task
Replay failed SQS messages when a bug fix is merged

When you merge a fix in GitHub, this agent checks the matching dead-letter queue, replays the failed messages, and reports back on the pull request and in Slack.

Amazon SQS
GitHub
Slack Bot
Agentic Task

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.