8
n8n 한국어amn8n.com

AI를 사용한 n8n 워크플로우 백업至GitLab

중급

이것은DevOps, AI Summarization분야의자동화 워크플로우로, 15개의 노드를 포함합니다.주로 If, N8n, Code, Gitlab, N8nTrigger 등의 노드를 사용하며. GPT-4.1 문서 생성 기반 작업 흐름 자동 백업至 GitLab

사전 요구사항
  • GitLab Personal Access Token
  • OpenAI API Key
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "jzbnQsF9eV0G8PKA",
  "meta": {
    "instanceId": "a28fa941f4dd50ba130162204d368b9dfd7d9b960d864f7ae0094ae8b516daa8",
    "templateCredsSetupCompleted": true
  },
  "name": "Backup n8n workflows to GitLab with AI",
  "tags": [],
  "nodes": [
    {
      "id": "3e71ace2-735e-47c8-a9c0-23c575080f47",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        560,
        -336
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "db9435fd-f5b4-4c18-a9a2-0b6471c029e8",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.isFileOnGit }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "d5316aa4-c279-4eec-a7af-c10e0ed663f8",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -336,
        -432
      ],
      "parameters": {
        "inputSource": "passthrough"
      },
      "typeVersion": 1.1
    },
    {
      "id": "5b647f82-91ee-43d2-be81-72f615d7cae3",
      "name": "Workflow Change Detector",
      "type": "n8n-nodes-base.n8nTrigger",
      "position": [
        -336,
        -240
      ],
      "parameters": {
        "events": [
          "update",
          "activate"
        ]
      },
      "typeVersion": 1
    },
    {
      "id": "12c58db0-c097-444e-ace7-6d7492547130",
      "name": "Fetch Updated Workflow",
      "type": "n8n-nodes-base.n8n",
      "position": [
        -112,
        -336
      ],
      "parameters": {
        "operation": "get",
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.workflow_id }}"
        },
        "requestOptions": {}
      },
      "credentials": {
        "n8nApi": {
          "id": "sPrxjiTGmum0YltE",
          "name": "n8n account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "5b6307b5-bef1-4064-93d5-8651585dccc2",
      "name": "Check GitLab Repository",
      "type": "n8n-nodes-base.gitlab",
      "onError": "continueRegularOutput",
      "position": [
        112,
        -336
      ],
      "parameters": {
        "owner": "n8n_projects",
        "filePath": "={{$json.name +'/' }}",
        "resource": "file",
        "operation": "list",
        "returnAll": true,
        "repository": "all_projects",
        "additionalParameters": {}
      },
      "credentials": {
        "gitlabApi": {
          "id": "jSe8yMHXlJPNv5lh",
          "name": "GitLab account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "cdce94a6-bb32-4ab5-b6fa-d32a13706cbb",
      "name": "Analyze Repository State",
      "type": "n8n-nodes-base.code",
      "position": [
        336,
        -336
      ],
      "parameters": {
        "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nconst err = $input.first().json.error;\nif(err\n   && err.indexOf(\"resource you are requesting could not be found\")>0)\n  return {workflow: $('Fetch Updated Workflow').first().json,isFileOnGit:false};\n\nlet isFileOnGit = false;\nfor (const item of $input.all()) {\n  if(item.json.name == $('Fetch Updated Workflow').first().json.name +\".json\"){\n    isFileOnGit = true;\n    break;\n  }\n}\n\nreturn {workflow: $('Fetch Updated Workflow').first().json,isFileOnGit};"
      },
      "typeVersion": 2
    },
    {
      "id": "4db0954c-e7f3-45af-892d-b7befd983539",
      "name": "Update Existing Workflow",
      "type": "n8n-nodes-base.gitlab",
      "position": [
        784,
        -432
      ],
      "parameters": {
        "owner": "n8n_projects",
        "branch": "main",
        "filePath": "={{ $('Analyze Repository State').item.json.workflow.name+'/'+$('Analyze Repository State').item.json.workflow.name +\".json\"}}",
        "resource": "file",
        "operation": "edit",
        "repository": "all_projects",
        "fileContent": "={{ $('Analyze Repository State').item.json.workflow.toJsonString() }}",
        "commitMessage": "={{ `updated by n8n` }}"
      },
      "credentials": {
        "gitlabApi": {
          "id": "jSe8yMHXlJPNv5lh",
          "name": "GitLab account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d5595a4d-e56e-4d97-a794-68bb09c6bdd8",
      "name": "Create New Workflow File",
      "type": "n8n-nodes-base.gitlab",
      "position": [
        784,
        -240
      ],
      "parameters": {
        "owner": "n8n_projects",
        "branch": "main",
        "filePath": "={{$('Analyze Repository State').item.json.workflow.name+'/'+ $('Analyze Repository State').item.json.workflow.name +\".json\"}}",
        "resource": "file",
        "repository": "all_projects",
        "fileContent": "={{$json.workflow.toJsonString()}}",
        "commitMessage": "Pushed by n8n"
      },
      "credentials": {
        "gitlabApi": {
          "id": "jSe8yMHXlJPNv5lh",
          "name": "GitLab account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4cde1c01-7294-493d-908a-adeca486c213",
      "name": "Generate AI Documentation",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1008,
        -240
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "GPT-4.1"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Generate a simple readme.md for the following n8n workflow json.\nYour json output must be exaclty this:\n{\"README\":\"The markdown content\"}\nWorkflow JSON:\n\n{{ $('Analyze Repository State').item.json.workflow.toJsonString() }}"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "id": "OLXWXsZdKGOvJr95",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "a8471cd5-0619-44cd-ae4e-e07dba2b87fa",
      "name": "Save README to GitLab",
      "type": "n8n-nodes-base.gitlab",
      "position": [
        1408,
        -240
      ],
      "parameters": {
        "owner": "n8n_projects",
        "branch": "main",
        "filePath": "={{$('Analyze Repository State').item.json.workflow.name+'/readme.md'}}",
        "resource": "file",
        "repository": "all_projects",
        "fileContent": "={{ $json.message.content.README }}",
        "commitMessage": "Pushed by n8n"
      },
      "credentials": {
        "gitlabApi": {
          "id": "jSe8yMHXlJPNv5lh",
          "name": "GitLab account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "80f77f85-0766-4107-83b2-57e2d4cb9d73",
      "name": "메모",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -848
      ],
      "parameters": {
        "width": 480,
        "height": 416,
        "content": "**Auto backup n8n workflows to GitLab with AI-generated documentation**\nThis n8n template automatically backs up your workflows to a GitLab repository whenever they're updated or activated, and generates README documentation using AI.\n\n**Who's it for** :\nThis template is perfect for n8n users who want to:\n\nMaintain version control of their workflows\nCreate automatic backups in Git repositories\nGenerate documentation for their workflows using AI\nKeep their workflow library organized and documented\n\n**How it works**\nThe workflow monitors n8n for workflow updates and activations, then automatically saves the workflow JSON to GitLab and generates a README file using OpenAI.\n\n**This workflow can be added as a sub-workflow to any existing workflow to enable backup functionality.**\n"
      },
      "typeVersion": 1
    },
    {
      "id": "18b73c77-f66c-4bb7-82be-0ec51d6f488d",
      "name": "메모3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -400
      ],
      "parameters": {
        "color": 7,
        "width": 424,
        "height": 224,
        "content": "Retrieves workflow data and checks repository status to determine is the file exist on repo"
      },
      "typeVersion": 1
    },
    {
      "id": "a032531b-7e75-4c53-8abf-c259c55ea10e",
      "name": "메모2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        -272
      ],
      "parameters": {
        "color": 7,
        "height": 80,
        "content": "Triggers when workflows are updated or activated"
      },
      "typeVersion": 1
    },
    {
      "id": "538be132-53e5-424c-afdd-d74f7dcd282b",
      "name": "메모4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        544,
        -512
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 480,
        "content": "Creates or updates workflow files in GitLab"
      },
      "typeVersion": 1
    },
    {
      "id": "796de781-25ef-42a4-a17f-6ffc350e4aeb",
      "name": "메모5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        976,
        -320
      ],
      "parameters": {
        "color": 7,
        "width": 312,
        "height": 288,
        "content": "Uses OpenAI to generate README files automatically"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8b4b37e5-d7f5-4c32-84c8-90d1fa120a8a",
  "connections": {
    "3e71ace2-735e-47c8-a9c0-23c575080f47": {
      "main": [
        [
          {
            "node": "4db0954c-e7f3-45af-892d-b7befd983539",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "d5595a4d-e56e-4d97-a794-68bb09c6bdd8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "12c58db0-c097-444e-ace7-6d7492547130": {
      "main": [
        [
          {
            "node": "5b6307b5-bef1-4064-93d5-8651585dccc2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5b6307b5-bef1-4064-93d5-8651585dccc2": {
      "main": [
        [
          {
            "node": "cdce94a6-bb32-4ab5-b6fa-d32a13706cbb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cdce94a6-bb32-4ab5-b6fa-d32a13706cbb": {
      "main": [
        [
          {
            "node": "3e71ace2-735e-47c8-a9c0-23c575080f47",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d5595a4d-e56e-4d97-a794-68bb09c6bdd8": {
      "main": [
        [
          {
            "node": "4cde1c01-7294-493d-908a-adeca486c213",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5b647f82-91ee-43d2-be81-72f615d7cae3": {
      "main": [
        [
          {
            "node": "12c58db0-c097-444e-ace7-6d7492547130",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4cde1c01-7294-493d-908a-adeca486c213": {
      "main": [
        [
          {
            "node": "a8471cd5-0619-44cd-ae4e-e07dba2b87fa",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d5316aa4-c279-4eec-a7af-c10e0ed663f8": {
      "main": [
        [
          {
            "node": "12c58db0-c097-444e-ace7-6d7492547130",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

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

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

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

중급 - 데브옵스, AI 요약

유료인가요?

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

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

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

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34