8
n8n 한국어amn8n.com

Postgres 백업을 CSV로GitHub에 저장

고급

이것은DevOps, Multimodal AI분야의자동화 워크플로우로, 17개의 노드를 포함합니다.주로 If, Code, Github, Postgres, ItemLists 등의 노드를 사용하며. 매일 Postgres 테이블을 CSV 형식으로 GitHub에 백업

사전 요구사항
  • GitHub Personal Access Token
  • PostgreSQL 데이터베이스 연결 정보
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "oBJaQvcNxODDoAl1",
  "meta": {
    "instanceId": "52254486b159b349334953c1738da94e90477c7604aa8db2062d11afc0120739",
    "templateCredsSetupCompleted": true
  },
  "name": "backup postgres as csv to github",
  "tags": [],
  "nodes": [
    {
      "id": "20477146-5542-4701-a92f-4300c95a0c5d",
      "name": "일일 스케줄",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1712,
        -96
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "3f5ec59d-374f-421c-a333-155c06443e5d",
      "name": "테이블 목록 조회",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -544,
        64
      ],
      "parameters": {
        "table": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $json.table_name }}"
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "public"
        },
        "options": {},
        "operation": "select",
        "returnAll": true
      },
      "credentials": {
        "postgres": {
          "id": "0bZEnNx2jwoEznOw",
          "name": "pg - n8n-discord-trigger-bot"
        }
      },
      "typeVersion": 2.6
    },
    {
      "id": "8d8af1f2-5b28-449d-a354-a624f9e2a53c",
      "name": "항목 순회 처리",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -912,
        -96
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "680847b4-e704-4728-8ee2-44642d931d58",
      "name": "코드",
      "type": "n8n-nodes-base.code",
      "position": [
        -752,
        64
      ],
      "parameters": {
        "jsCode": "return $input.all();"
      },
      "typeVersion": 2
    },
    {
      "id": "0ec30d45-c281-4d65-a966-29f615eade3a",
      "name": "파일로 변환1",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        -336,
        64
      ],
      "parameters": {
        "options": {
          "fileName": "={{ $('List tables1').item.json.table_name }}"
        },
        "binaryPropertyName": "=data"
      },
      "typeVersion": 1.1
    },
    {
      "id": "09466877-0cdb-4011-809f-87c696ab3717",
      "name": "테이블 목록 조회1",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -1104,
        -96
      ],
      "parameters": {
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tables",
          "cachedResultName": "tables"
        },
        "where": {
          "values": [
            {
              "value": "public",
              "column": "table_schema"
            }
          ]
        },
        "schema": {
          "__rl": true,
          "mode": "list",
          "value": "information_schema",
          "cachedResultName": "information_schema"
        },
        "options": {},
        "operation": "select"
      },
      "credentials": {
        "postgres": {
          "id": "0bZEnNx2jwoEznOw",
          "name": "pg - n8n-discord-trigger-bot"
        }
      },
      "typeVersion": 2.6
    },
    {
      "id": "014fa66c-4acc-4698-97cc-142efaae9376",
      "name": "리포지토리 파일 목록 조회 [GITHUB]",
      "type": "n8n-nodes-base.github",
      "position": [
        -1536,
        -96
      ],
      "webhookId": "f7310d6a-1573-4848-9757-f9a75e359e73",
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "user"
        },
        "filePath": "=",
        "resource": "file",
        "operation": "list",
        "repository": {
          "__rl": true,
          "mode": "list",
          "value": "github-repo",
          "cachedResultUrl": "https://github.com/user/github-repo",
          "cachedResultName": "github-repo"
        },
        "authentication": "oAuth2"
      },
      "credentials": {
        "githubOAuth2Api": {
          "id": "g3sESgnuArjRvV8F",
          "name": "GitHub account"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "5942926d-b940-4ba4-a0c1-7209c04c0a3c",
      "name": "파일명 통합 [GITHUB]",
      "type": "n8n-nodes-base.itemLists",
      "position": [
        -1344,
        -96
      ],
      "parameters": {
        "options": {},
        "operation": "aggregateItems",
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "name"
            }
          ]
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "00aa6a0e-b5c1-4093-8ee0-94b35bcdd934",
      "name": "참고 노트2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1584,
        -256
      ],
      "parameters": {
        "color": 7,
        "width": 390,
        "height": 547,
        "content": "## Get list of current tables\nReturn a list of existing files in GitHub repository. \nSome of them are tables, \nSome are readme files"
      },
      "typeVersion": 1
    },
    {
      "id": "863c59ef-6ce2-4c22-8c0e-00b9abcfdbd9",
      "name": "단일 항목 분할",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -80,
        -112
      ],
      "parameters": {
        "options": {},
        "batchSize": 1
      },
      "typeVersion": 2
    },
    {
      "id": "ccee7881-77c8-419e-ad99-ac3bb113ae6b",
      "name": "리포지토리 내 파일 존재 확인",
      "type": "n8n-nodes-base.if",
      "position": [
        160,
        -128
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $node['Combine file names [GITHUB]'].json.name }}",
              "value2": "={{ $binary.data.fileName }}",
              "operation": "contains"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f6d53dcc-1e40-43f5-b793-4d06a55ccbed",
      "name": "파일 업데이트 [GITHUB]",
      "type": "n8n-nodes-base.github",
      "position": [
        384,
        -128
      ],
      "webhookId": "fb5f5095-cf60-4421-8b83-91041cfc8929",
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "user"
        },
        "filePath": "={{ $binary.data.fileName }}",
        "resource": "file",
        "operation": "edit",
        "binaryData": true,
        "repository": {
          "__rl": true,
          "mode": "list",
          "value": "github-repo",
          "cachedResultUrl": "https://github.com/user/github-repo",
          "cachedResultName": "github-repo"
        },
        "commitMessage": "=backup-{{ $now.toMillis() }}",
        "authentication": "oAuth2"
      },
      "credentials": {
        "githubOAuth2Api": {
          "id": "g3sESgnuArjRvV8F",
          "name": "GitHub account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ebcd65d3-37ac-4d47-90dc-fede45adb9c0",
      "name": "파일 업로드 [GITHUB]",
      "type": "n8n-nodes-base.github",
      "position": [
        384,
        80
      ],
      "webhookId": "17b56fbd-32da-4e39-ae22-8c01a7b4bbb6",
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "user"
        },
        "filePath": "={{ $binary.data.fileName }}",
        "resource": "file",
        "binaryData": true,
        "repository": {
          "__rl": true,
          "mode": "list",
          "value": "github-repo",
          "cachedResultUrl": "https://github.com/user/github-repo",
          "cachedResultName": "github-repo"
        },
        "commitMessage": "=backup-{{ $node['Set commit date'].json.commitDate }}",
        "authentication": "oAuth2"
      },
      "credentials": {
        "githubOAuth2Api": {
          "id": "g3sESgnuArjRvV8F",
          "name": "GitHub account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6bcbeffb-b036-45f3-88a8-dd5f1ac0fa39",
      "name": "참고 노트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1168,
        -256
      ],
      "parameters": {
        "color": 5,
        "width": 998,
        "height": 547,
        "content": "## Get postgres table data\nReturn a list of existing tables and data in the postgres.  \nConvert them to csv"
      },
      "typeVersion": 1
    },
    {
      "id": "88cc96e5-fc5b-4d28-8e57-82c193efb19d",
      "name": "참고 노트1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        -256
      ],
      "parameters": {
        "color": 7,
        "width": 694,
        "height": 547,
        "content": "## Make a list of existing files\nCreate backup if its a new table. \nUpdate backup if there is new data in the table"
      },
      "typeVersion": 1
    },
    {
      "id": "4b4f32d2-2138-4d9a-8d48-6b35b387270a",
      "name": "참고 노트3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -848,
        320
      ],
      "parameters": {
        "color": 7,
        "width": 374,
        "height": 195,
        "content": "![postgres table](https://articles.emp0.com/wp-content/uploads/2025/08/backup-postgres-to-github-tables.png)"
      },
      "typeVersion": 1
    },
    {
      "id": "02ddc44f-7c23-4022-9978-c43876593274",
      "name": "참고 노트4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -144,
        320
      ],
      "parameters": {
        "color": 7,
        "width": 694,
        "height": 259,
        "content": "![github backup](https://articles.emp0.com/wp-content/uploads/2025/08/backup-postgres-to-github-repo.png)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "747a3b1e-5b2a-4f61-875c-250bd44fbf01",
  "connections": {
    "680847b4-e704-4728-8ee2-44642d931d58": {
      "main": [
        [
          {
            "node": "3f5ec59d-374f-421c-a333-155c06443e5d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3f5ec59d-374f-421c-a333-155c06443e5d": {
      "main": [
        [
          {
            "node": "0ec30d45-c281-4d65-a966-29f615eade3a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "09466877-0cdb-4011-809f-87c696ab3717": {
      "main": [
        [
          {
            "node": "8d8af1f2-5b28-449d-a354-a624f9e2a53c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "20477146-5542-4701-a92f-4300c95a0c5d": {
      "main": [
        [
          {
            "node": "014fa66c-4acc-4698-97cc-142efaae9376",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "8d8af1f2-5b28-449d-a354-a624f9e2a53c": {
      "main": [
        [
          {
            "node": "863c59ef-6ce2-4c22-8c0e-00b9abcfdbd9",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "680847b4-e704-4728-8ee2-44642d931d58",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0ec30d45-c281-4d65-a966-29f615eade3a": {
      "main": [
        [
          {
            "node": "8d8af1f2-5b28-449d-a354-a624f9e2a53c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f6d53dcc-1e40-43f5-b793-4d06a55ccbed": {
      "main": [
        [
          {
            "node": "863c59ef-6ce2-4c22-8c0e-00b9abcfdbd9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ebcd65d3-37ac-4d47-90dc-fede45adb9c0": {
      "main": [
        [
          {
            "node": "863c59ef-6ce2-4c22-8c0e-00b9abcfdbd9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "863c59ef-6ce2-4c22-8c0e-00b9abcfdbd9": {
      "main": [
        [
          {
            "node": "ccee7881-77c8-419e-ad99-ac3bb113ae6b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5942926d-b940-4ba4-a0c1-7209c04c0a3c": {
      "main": [
        [
          {
            "node": "09466877-0cdb-4011-809f-87c696ab3717",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ccee7881-77c8-419e-ad99-ac3bb113ae6b": {
      "main": [
        [
          {
            "node": "f6d53dcc-1e40-43f5-b793-4d06a55ccbed",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "ebcd65d3-37ac-4d47-90dc-fede45adb9c0",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "014fa66c-4acc-4698-97cc-142efaae9376": {
      "main": [
        [
          {
            "node": "5942926d-b940-4ba4-a0c1-7209c04c0a3c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

고급 - 데브옵스, 멀티모달 AI

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
고급
노드 수17
카테고리2
노드 유형9
난이도 설명

고급 사용자를 위한 16+개 노드의 복잡한 워크플로우

저자
Jay Emp0

Jay Emp0

@jay-emp0

AI and Automation developer. Im implementing n8n and ai tools to automate marketing and sales in companies

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34