See llms.txt for all machine-readable content.

Back to Templates

Stop idle RunPod GPU pods with Slack approvals and daily cost briefs

Quick Overview

This workflow monitors RunPod GPU pods for prolonged idleness or “never started” states, requests stop approval in Slack (or auto-stops when enabled), logs actions in n8n Data Tables, and posts a daily Slack brief covering spend, avoided cost, running pods, and GPU availability changes.

How it works

  1. Runs every 15 minutes to fetch your RunPod pod list, retrieve per-pod runtime metrics, and normalize CPU/GPU utilization samples.
  2. Stores each pod sample in an n8n Data Table and compares it with recent sample history and prior actions to detect idle or not-started pods while respecting snoozes and protected pod name prefixes.
  3. When a pod is due for notification, fetches its RunPod audit log (if available) to identify who created or last started it and builds a Slack Block Kit approval card.
  4. Posts a new Slack approval message or a reminder in the existing thread with Stop and Snooze buttons, or stops the pod automatically via the RunPod API when auto-stop is enabled and then posts a Start button for undo.
  5. Receives Slack button clicks via a webhook, verifies the request signature and approver list, and then runs the requested RunPod stop/start action or records a snooze.
  6. Logs all notifications and actions to an n8n Data Table and updates prior Slack messages to remove buttons and reflect the final outcome.
  7. Runs daily at 08:00 to pull RunPod pods, billing, and GPU catalog availability (secure and community), calculate spend and avoided cost from the ledger, post a Slack daily ops brief, store an availability snapshot, and prune old sample rows.

Setup

  1. Add a RunPod API key as an HTTP Header Auth credential and ensure requests send an Authorization header in the form Bearer <key>.
  2. Add Slack bot credentials with permission to post and update messages in your target channel, and invite the bot to the channel used by slackChannelId.
  3. Create a Slack app with Interactivity enabled, set its Interactivity Request URL to the Slack Interaction webhook production URL, and add your Slack Signing Secret as an n8n Crypto credential for request verification.
  4. Run the “Set Up Data Tables” path once to create the required n8n Data Tables (RunPod Ops Ledger, RunPod Ops Samples, and RunPod Ops Availability).
  5. Update the Config values for slackChannelId and approverIds, and optionally tune thresholds such as gpuMemUtilMax, cpuUtilMax, requiredConsecutiveSamples, minimumCostPerHour, and autoStop.