Auto-stop idle RunPod GPUs and log the savings

By General Input

Every hour, stop any RunPod Pod that has been running too long, log it to a Google Sheet, and post a savings rollup to Slack.

Integrations

  • RunPod
  • Google Sheets
  • Slack

Type

Deterministic Code

Categories

  • Engineering
  • Finance

Build a deterministic, code-based workflow that auto-shuts-down long-running RunPod GPU Pods on a schedule. The trigger is a cron that fires every hour.

On each run:

1) Call RunPod's List Pods operation to get every Pod on the account.

2) Filter that list down to Pods that meet ALL of these conditions: status is RUNNING (or desiredStatus is RUNNING), uptime is greater than a configurable threshold (default 6 hours, derived from the Pod's lastStatusChange / costPerHr / createdAt timestamp depending on what RunPod returns), and the Pod name does NOT start with any of the protected prefixes in a configurable list (default ["keep-", "prod-"]).

3) For each Pod that qualifies, call RunPod's Start, Stop, Restart, or Reset Pod operation with the stop action, passing the Pod ID.

4) For each Pod that was successfully stopped, append a row to a Google Sheet via the Append Values operation. The columns are: pod id, name, GPU type, cost per hour (USD), uptime at stop (in hours), and ISO timestamp of the stop. The spreadsheet ID and tab name are workflow inputs.

5) After all stops complete, send a single rollup Slack message via Send a Message to a configurable channel. The message should look roughly like: "Auto-stopped {N} idle RunPod Pods. Reclaimed ${X}/hr. See audit log: {sheet link}." Include a short bullet list of the stopped Pods (name and GPU type) underneath.

6) If nothing qualifies on a given run, finish silently. Do not send a Slack message and do not write to the sheet.

Workflow inputs (exposed as configuration, not hardcoded): uptime threshold in hours (default 6), protected name prefixes (default ["keep-", "prod-"]), Google Sheet spreadsheet ID, sheet tab name, and Slack channel ID.

This is a code workflow, not an agent. Every step is a known list, filter, act, log pipeline with no judgement involved. Use discrete deterministic nodes wired together: cron trigger, RunPod List Pods, a filter / transform node, a loop over the filtered Pods that calls RunPod Stop and then Google Sheets Append Values, then a conditional Slack Send a Message at the end. Handle errors per-Pod so one failed stop does not abort the whole sweep.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seats