Building Slack notifications to monitor pg_dump and restore workflows
A nightly GitHub Actions workflow that pg_dumps an RDS production Postgres database and restores it to a Neon dev branch can be extended to post success and failure alerts to a Slack channel through an incoming webhook. Separate jobs capture start and end times and query the database name and size via psql. These values pass through job outputs and env vars into Node scripts that format Slack Block Kit messages, gated by success() and failure() conditions. Posting to Slack lets the whole team see job status without granting everyone access to the GitHub repo.
Related posts
- Slack Consolidate: a slackbot built with Python and Supabase
Supabase mediumAdeptA Python Slack bot polls watched channels via conversations.history and reposts new messages to consolidated destination channels. Supabase Postgres tables hold the channel routing config and act as a dedup buffer. The slack_watcher table's primary key on (channel_id, ts, ts_ms) makes inserts fail for already-seen messages, so only new ones get forwarded. The guide covers the Slack app manifest and OAuth scopes, the table schemas, env setup, and the full polling loop, which uses a 1.4s delay to stay under Slack Tier 3 rate limits and reloads the channel list hourly.
- Neon Twin: How to deploy a change tested in Neon to prod in RDS
Neon mediumAdept
Schema changes tested on Neon database branches can be promoted to an AWS RDS production Postgres database through GitHub Actions that run when a pull request merges. Neon's schema diff shows how a dev branch differs from main. From there, migrations are applied in one of two ways: hand-written dated .sql files that a workflow detects via git diff and runs with psql, or Prisma migrations applied with `prisma migrate deploy`. A follow-up pg_dump/pg_restore job then re-syncs the Neon Twin from production.
- Branching Postgres databases with the Neon API
Neon mediumAdept
Neon branches are copy-on-write clones of a Postgres database that can be created and deleted through the Neon API, giving CI pipelines an isolated copy of production data for end-to-end tests. Two experimental GitHub Actions, neondatabase/create-branch-action and neondatabase/delete-branch-action, wrap the API. A sample pull-request workflow creates a branch from a parent branch, runs the test steps, then deletes the branch. The actions were beta at the time and still being hardened for production use.
- How to Set Up Nightly Backups to AWS S3 for Multiple Neon Projects
Neon mediumAdept
Nightly backups of multiple Neon Postgres databases can be automated with one GitHub Actions workflow per database. Each workflow runs on a cron schedule, installs a matching Postgres client version, and assumes an AWS IAM role via OIDC. It then pipes pg_dump through gzip, deletes .gz files in that database's S3 folder older than a configurable retention period, and uploads the new dump. Workflows differ only in name, connection-string secret and retention. GitHub-hosted runners time out after about 6 hours, so large databases may need self-hosted runners.
- Using ChatOps to help Actions on-call engineers
GitHub Engineering easyNoviceGitHub's Actions on-call engineers use Hubot-driven ChatOps commands in Slack to turn repetitive diagnosis steps into shared, auditable commands. Examples include analyzing a failing run URL without direct access to a private repository, generating Kusto queries for error impact, searching team-specific docs and ADRs for playbooks, and running database health checks. The health checks use IQR-based anomaly detection on CPU, memory and worker metrics to point at root causes such as PAGELATCH_SH blocking. The broader recommendation is to codify subject-matter experts' playbooks into ChatOps so they become living, iteratively improved incident runbooks.