8
n8n 한국어amn8n.com

GitHub에 대한 예약 자동 워크플로우 백업

중급

이것은DevOps분야의자동화 워크플로우로, 10개의 노드를 포함합니다.주로 If, Merge, Github, HttpRequest, MoveBinaryData 등의 노드를 사용하며. GitHub에 대한 정기적 자동 워크플로우 백업

사전 요구사항
  • GitHub Personal Access Token
  • 대상 API의 인증 정보가 필요할 수 있음

카테고리

워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "meta": {
    "instanceId": "40e2ddc17723de14c7d0537f9006dd246a3f4df33df6ca7f746ccb612d5f27b9",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "d413aa8d-5e9e-4d06-a4dc-4806d2cf656f",
      "name": "스티커 노트7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        -16
      ],
      "parameters": {
        "color": 2,
        "width": 763,
        "height": 316,
        "content": "## Backup every 6 Hour (can be changed as per requirement) "
      },
      "typeVersion": 1
    },
    {
      "id": "b2cc1790-3177-4ddd-bcd1-df8408ad7418",
      "name": "바이너리 데이터 이동",
      "type": "n8n-nodes-base.moveBinaryData",
      "position": [
        1712,
        64
      ],
      "parameters": {
        "mode": "jsonToBinary",
        "options": {
          "fileName": "=backup",
          "useRawData": true
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f2bd8590-ba99-4bff-a01e-f94306382bb3",
      "name": "일정 트리거",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1200,
        64
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 6
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "44e5938e-5ec5-49b9-9b64-1d2f4507750a",
      "name": "스티커 노트2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        -128
      ],
      "parameters": {
        "width": 720,
        "height": 1400,
        "content": "# 🚀 Automated n8n Workflow Backup to GitHub for schedule Interval\n\nEasily ensure your n8n workflows are never lost! This template automates the process of backing up all your n8n workflows to a GitHub repository every 6 hours. Set it up once and enjoy *worry-free* workflow versioning and disaster recovery! 🔄✨\n\n## 📝 What This Workflow Does\n\n- **Schedules backups**: Triggers the workflow automatically every 6 hours—no manual steps needed. ⏰\n- **Exports all current workflows**: Collects a JSON snapshot of every workflow in your n8n instance. 📦\n- **Pushes backups to GitHub**: Commits each backup file to your specified GitHub repository with a time-stamped commit message for easy tracking. 🗂️🚀\n- **Smart file handling**: Checks if a backup file already exists and creates or updates as needed, keeping your repository clean and organized. 🤖\n\n##⚡️ Why Use This Template?\n\n- **Automate your workflow backups – never miss a backup again!**\n- **Seamless integration with GitHub** for team collaboration, change management, and rollback.\n- **Simple, reliable, and fully customizable** to match your backup intervals and repository setup.\n- **Peace of mind** that your critical automation assets are always protected.\n\n## 📦 How the Template Works: Step-by-step Overview\n\n1. **Scheduled Trigger**: Fires every 6 hours to launch the backup sequence.\n2. **Get All Workflows**: Uses the `HTTP Request` node to fetch all n8n workflows from your instance as JSON data.\n3. **Move Binary Data**: Converts the JSON into a binary format, ready for GitHub storage.\n4. **Edit/Create Backup File**: Attempts to edit (update) an existing backup file in your GitHub repo. If the file does not exist, the workflow will create a new one.\n5. **Conditional Logic**: Checks after each run whether the backup file exists and ensures previous versions can be recovered or merged as needed.\n6. **Repeat**: The process auto-loops every 6 hours—no further intervention required!\n\n## 🔧 How To Set Up On Your Server\n\n1. **Import the template** into your n8n instance.\n2. **Configure your GitHub credentials** in the workflow nodes.\n3. **Update the GitHub repository details** (`owner`, `repository`, and `filePath`) to use your own repo and desired file path.\n4. **Set your n8n API key** and update the API endpoint URL to match your deployment.\n5. **Save and activate** the workflow—now your backups are on autopilot!\n\n## 👨‍💻 Example Use Cases\n\n- Version control for rapidly changing automation environments.\n- Safeguarding business-critical automation assets.\n- Easy rollback in case of workflow corruption or accidental deletion.\n- Team collaboration through GitHub's pull request and review process.\n\n## 🌟 Pro Tips\n\n- Adjust the backup interval in the `Schedule Trigger` node if you require more/less frequent backups.\n- Use GitHub branch protection rules for enhanced workflow security.\n- Pair this backup workflow with notifications (e.g., Slack or Email) for backup alerts.\n\n**Protect your n8n workflows with automated, reliable, and versioned GitHub backups—set it and forget it!** 🚦🔒"
      },
      "typeVersion": 1
    },
    {
      "id": "9a65446c-1088-477d-b45e-892b65a78153",
      "name": "Edit a file",
      "type": "n8n-nodes-base.github",
      "onError": "continueErrorOutput",
      "position": [
        1984,
        64
      ],
      "webhookId": "32a29392-11c6-402e-9a15-2d7726d3fade",
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "github-profile-name"
        },
        "filePath": "backup.json",
        "resource": "file",
        "operation": "edit",
        "binaryData": true,
        "repository": {
          "__rl": true,
          "mode": "list",
          "value": "n8n_backup",
          "cachedResultUrl": "https://github.com/akashkankariya/n8n_backup",
          "cachedResultName": "n8n_backup"
        },
        "commitMessage": "=n8n_backup_{{ $now.format('yyyy-MM-dd hh') }}"
      },
      "credentials": {
        "githubApi": {
          "id": "jxsix3PrSX5TsSW1",
          "name": "GitHub Account "
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "95b1d46c-6641-4b6f-805e-9847ec837878",
      "name": "Get All Workflows",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1472,
        64
      ],
      "parameters": {
        "url": "https://your-n8n-instance.com/rest/workflows?limit=9999",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "accept",
              "value": "application/json"
            },
            {
              "name": "X-N8N-API-KEY",
              "value": "<n8n-api-key>"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "528b75d1-0c3a-4e42-bbcb-555f85d151ab",
      "name": "Create a file",
      "type": "n8n-nodes-base.github",
      "position": [
        2784,
        128
      ],
      "webhookId": "177f801e-da88-46aa-804c-1e365cc1f5aa",
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "github-profile-name"
        },
        "filePath": "backup.json",
        "resource": "file",
        "binaryData": true,
        "repository": {
          "__rl": true,
          "mode": "list",
          "value": "n8n_backup",
          "cachedResultUrl": "https://github.com/akashkankariya/n8n_backup",
          "cachedResultName": "n8n_backup"
        },
        "commitMessage": "=n8n_backup_{{ $now.format('yyyy-MM-dd hh') }}"
      },
      "credentials": {
        "githubApi": {
          "id": "jxsix3PrSX5TsSW1",
          "name": "GitHub Account "
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "f56f7667-d3d8-49ec-8c8c-d25a1ed67adc",
      "name": "If file not exits?",
      "type": "n8n-nodes-base.if",
      "position": [
        2320,
        192
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "dc419c30-f84f-493f-9125-3b60daeb4a4c",
              "operator": {
                "name": "filter.operator.equals",
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.error }}",
              "rightValue": "The resource you are requesting could not be found"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9025fa65-9c6b-4f1e-898c-45679c720129",
      "name": "Get Previous FIle back",
      "type": "n8n-nodes-base.merge",
      "position": [
        2560,
        128
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "joinMode": "enrichInput1",
        "fieldsToMatchString": "data"
      },
      "typeVersion": 3.2
    },
    {
      "id": "41c7655b-5b7d-4f3b-8aca-ba56736d2ec6",
      "name": "스티커 노트",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1952,
        -16
      ],
      "parameters": {
        "color": 3,
        "width": 1063,
        "height": 356,
        "content": "## Check if File is present or not else it will create file a new file based on error"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "9a65446c-1088-477d-b45e-892b65a78153": {
      "main": [
        [],
        [
          {
            "node": "f56f7667-d3d8-49ec-8c8c-d25a1ed67adc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "528b75d1-0c3a-4e42-bbcb-555f85d151ab": {
      "main": [
        []
      ]
    },
    "Move Binary Data": {
      "main": [
        [
          {
            "node": "9a65446c-1088-477d-b45e-892b65a78153",
            "type": "main",
            "index": 0
          },
          {
            "node": "9025fa65-9c6b-4f1e-898c-45679c720129",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "95b1d46c-6641-4b6f-805e-9847ec837878",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "95b1d46c-6641-4b6f-805e-9847ec837878": {
      "main": [
        [
          {
            "node": "Move Binary Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f56f7667-d3d8-49ec-8c8c-d25a1ed67adc": {
      "main": [
        [
          {
            "node": "9025fa65-9c6b-4f1e-898c-45679c720129",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "9025fa65-9c6b-4f1e-898c-45679c720129": {
      "main": [
        [
          {
            "node": "528b75d1-0c3a-4e42-bbcb-555f85d151ab",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

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

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

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

중급 - 데브옵스

유료인가요?

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

워크플로우 정보
난이도
중급
노드 수10
카테고리1
노드 유형7
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

저자
Akash Kankariya

Akash Kankariya

@akash25

I'm a developer with 5 years of experience in Python and Node.js. Over the past year, I've been building workflows to streamline operations for my team. I have also developed RAG chatbots, AI agents, and WhatsApp automation. If you need any help with N8N workflows, let's connect over a call and solve it together!

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34