New to Kestra?
Use blueprints to kickstart your first workflows.
Schedule DigitalOcean managed database resizes with Kestra: scale up for business hours, down at night, and wait until the cluster is healthy again.
Stop paying peak-capacity prices for a database that only works office hours. This blueprint resizes a DigitalOcean managed database cluster on a schedule, scaling it up before the workday and back down in the evening. One flow serves both directions: each Schedule trigger passes its own target_size and target_nodes inputs. Before resizing, the flow verifies the cluster is actually online, refusing to stack a resize on top of an in-flight migration, and afterwards it polls until DigitalOcean reports the cluster healthy again, so the Slack confirmation means the capacity change really landed.
check_cluster (io.kestra.plugin.digitalocean.database.Get) reads the cluster and exposes its status.stop_if_busy (io.kestra.plugin.core.execution.Fail) fails fast when the status is anything but online, protecting against overlapping operations when a previous resize is still running.resize_cluster (io.kestra.plugin.digitalocean.database.Resize) submits the resize with the size slug and node count received as inputs.wait_until_online (io.kestra.plugin.core.flow.LoopUntil) polls database.Get every 30 seconds until the cluster status returns to online, with a 45 minute ceiling that fails the run when exceeded, matching how long larger cluster migrations can take.notify posts the success to Slack; the errors block posts a distinct alert when the pre-check, the resize, or the completion poll fails.Schedule triggers encode the policy, weekday mornings up to db-s-4vcpu-8gb with 2 nodes, weekday evenings down to db-s-2vcpu-4gb with 1 node, each simply passing different inputs to the same tasks.DigitalOcean has no native scheduled resize: the console offers a one-off manual action, and the API call returns immediately while the migration runs for many minutes in the background. Kestra supplies everything around that call that makes it safe to automate: schedules with per-trigger inputs, a health precondition, LoopUntil polling that turns the asynchronous migration into a synchronous step, Slack signaling on both outcomes, and an execution history showing every capacity change ever made to the cluster.
DIGITALOCEAN_TOKEN: DigitalOcean personal access token.SLACK_WEBHOOK_URL: Slack incoming webhook URL.database_id input default to your cluster UUID.disabled: false on each.io.kestra.plugin.dbt or warehouse batch job after wait_until_online on the morning trigger, so heavy jobs always run on the larger size.droplet.Resize, which additionally requires a POWER_OFF action first.