Daily Postgres table backup to GitHub in CSV format
Needs changesWhat this workflow does
This workflow has 12 nodes and runs on a schedule (every 24 hours). Along the way it connects Postgres and GitHub.
How it runs
Trigger: On a schedule (every 24 hours).
- List files from repository [GITHUB] (GitHub): list (file)
- Combine file names [GITHUB] (Item Lists): reshapes item lists (legacy Item Lists node)
- List tables (Postgres): select
- Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
- Split to single items (Loop Over Items (Split in Batches)): loops over the items in batches
- Code: runs custom JavaScript code
- Check if file exists in repository (If): checks a condition and branches into true / false
- List tables (Postgres): select
- Update file [GITHUB] (GitHub): edit (file)
- Upload file [GITHUB] (GitHub): work with file
…plus 1 more step. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- Item Lists (legacy) in Combine file names [GITHUB]: replace with Split Out, Aggregate, Sort, Limit, Remove Duplicates or Summarize (match the operation used).
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
| Removed in 3.0 | Replace with |
|---|---|
| Item Lists (legacy) Combine file names [GITHUB] | Split Out, Aggregate, Sort, Limit, Remove Duplicates or Summarize (match the operation used) |
Nodes used (8)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Postgres
n8n-nodes-base.postgres - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Code
n8n-nodes-base.code - Convert to File
n8n-nodes-base.convertToFile - GitHub
n8n-nodes-base.github - Item Lists
n8n-nodes-base.itemLists - If
n8n-nodes-base.if
From the author
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…