---
title: "Building Slack notifications to monitor pg_dump and restore workflows"
description: "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."
url: "https://swe.quest/articles/building-slack-notifications-to-monitor-pg-dump-and-restore-workflows-da994be4f8b4a40d"
canonical: "https://neon.com/blog/building-slack-notifications-to-monitor-pg_dump-and-restore-workflows"
source: "Neon"
published: "2024-08-01"
difficulty: "medium"
kind: "How-to"
reading_minutes: 10
tags: ["ci-cd","postgres","observability","javascript"]
---

# Building Slack notifications to monitor pg\_dump and restore workflows

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-08-01, 10 min read, How-to. Original: [https://neon.com/blog/building-slack-notifications-to-monitor-pg\_dump-and-restore-workflows](https://neon.com/blog/building-slack-notifications-to-monitor-pg_dump-and-restore-workflows)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)

## Prerequisites

- GitHub Actions workflows ([easy posts on CI/CD](https://swe.quest/tags/ci-cd.md?difficulty=easy))
- pg\_dump and pg\_restore
- Node.js basics ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))

## Keywords

Neon, Amazon RDS, GitHub Actions, Slack webhooks, pg\_dump, Block Kit

## Related posts

- [Slack Consolidate: a slackbot built with Python and Supabase](https://swe.quest/articles/slack-consolidate-a-slackbot-built-with-python-and-supabase-0daf5634c032a1a6.md): Supabase · 2022-08-09 · Medium · 8 min read · Python, PostgreSQL, Communications
  A Python Slack bot polls watched channels via conversations.history and reposts new messages to consolidated destination channels.
- [Neon Twin: How to deploy a change tested in Neon to prod in RDS](https://swe.quest/articles/neon-twin-how-to-deploy-a-change-tested-in-neon-to-prod-in-rds-09282f8f58bccb12.md): Neon · 2024-08-15 · Medium · 10 min read · Schema migrations, PostgreSQL, CI/CD, Deployment
  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.
- [Branching Postgres databases with the Neon API](https://swe.quest/articles/branching-postgres-databases-with-the-neon-api-3faf0de941bc811a.md): Neon · 2022-12-07 · Medium · 3 min read · PostgreSQL, CI/CD, Testing
  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.
- [How to Set Up Nightly Backups to AWS S3 for Multiple Neon Projects](https://swe.quest/articles/how-to-set-up-nightly-backups-to-aws-s3-for-multiple-neon-projects-8546de66a0aa7f01.md): Neon · 2024-10-29 · Medium · 7 min read · PostgreSQL, CI/CD, Cloud platforms, Databases
  Nightly backups of multiple Neon Postgres databases can be automated with one GitHub Actions workflow per database.
- [Using ChatOps to help Actions on-call engineers](https://swe.quest/articles/using-chatops-to-help-actions-on-call-engineers-a5ab9f63f48bb50a.md): GitHub Engineering · 2021-12-01 · Easy · 6 min read · Incidents & postmortems, SRE, Developer tools, Observability
  GitHub's Actions on-call engineers use Hubot-driven ChatOps commands in Slack to turn repetitive diagnosis steps into shared, auditable commands.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
