Skip to main content

Daily Postgres table backup to GitHub in CSV format

Workflow preview

Workflow preview
100%
Daily Postgres table backup to GitHub in CSV format preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow automatically backs up all public Postgres tables into a GitHub repository as CSV files every 24 hours. It ensures your database snapshots are always up to date updating existing file...

Best for

  • DevOps automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.postgres, n8n-nodes-base.splitinbatches, n8n-nodes-base.code, n8n-nodes-base.converttofile, n8n-nodes-base.github, n8n-nodes-base.itemlists, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jay Emp0.

Original n8n.io source

1.1 Workflow description

Title
Daily Postgres table backup to GitHub in CSV format
Workflow name
Daily Postgres table backup to GitHub in CSV format

This workflow automatically backs up all public Postgres tables into a GitHub repository as CSV files every 24 hours.
It ensures your database snapshots are always up to date updating existing files if data changes, or creating new backups for new tables.

How it works:

  1. Schedule Trigger – Runs daily to start the backup process.
  2. GitHub Integration – Lists existing files in the target repo to avoid duplicates.
  3. Postgres Query – Fetches all table names from the public schema.
  4. Data Extraction – Selects all rows from each table.
  5. Convert to CSV – Saves table data as CSV files.
  6. Conditional Upload
    • If the table already exists in GitHub → Update the file.
    • If new → Upload a new file.

Postgres Tables Preview


GitHub Backup Preview


Use case:
Perfect for developers, analysts, or data engineers who want daily automated backups of Postgres data without manual exports keeping both history and version control in GitHub.

Requirements:

  • Postgres credentials with read access.
  • GitHub repository (OAuth2 connected in n8n).

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Daily Schedule

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - List tables

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 3 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 4 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Convert to File1

Type / Role
n8n-nodes-base.convertToFile - convertToFile
Config choices
Version 1.1

Block 6 - List tables1

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 7 - List files from repository [GITHUB]

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1

Block 8 - Combine file names [GITHUB]

Type / Role
n8n-nodes-base.itemLists - itemLists
Config choices
Version 2.1

Block 9 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Split to single items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 2

Block 11 - Check if file exists in repository

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 12 - Update file [GITHUB]

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1

Block 13 - Upload file [GITHUB]

Type / Role
n8n-nodes-base.github - github
Config choices
Version 1

Block 14 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Daily Postgres table backup to GitHub in CSV format
Complexity advanced
Nodes 17
Categories DevOps, Multimodal AI
Author Jay Emp0
Published 15 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7419/7419.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Daily Postgres table backup to GitHub in CSV format do?

This workflow automatically backs up all public Postgres tables into a GitHub repository as CSV files every 24 hours. It ensures your database snapshots are always up to date updating existing file...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps, Multimodal AI use case.