AutomationFlowsWeb Scraping › Automated Repository Migration From Gitlab Groups to Gitea Organizations

Automated Repository Migration From Gitlab Groups to Gitea Organizations

Bynepomuc @nepomuc on n8n.io

This flow migrates all repositories of a Gitlab group to a Gitea organization by triggering Gitea's integrated migration tool.

Event trigger★★★★☆ complexity8 nodesStop And ErrorHTTP Request
Web Scraping Trigger: Event Nodes: 8 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #4947 — we link there as the canonical source.

This workflow follows the HTTP Request → Stopanderror recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "ac1706f2-273e-4191-94f7-0e4c84e6939b",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        140,
        -20
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "93d54a8a-9a7c-4193-89b6-754014b804d5",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        800,
        -20
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "ac8b47d9-ba45-42c0-be51-2a9ecf2cada6",
      "name": "Switch error codes",
      "type": "n8n-nodes-base.switch",
      "position": [
        1260,
        -20
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "404",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "1d1c97aa-61cd-4272-a650-a70c04dea44b",
                    "operator": {
                      "type": "number",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.error.status }}",
                    "rightValue": 404
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra"
        }
      },
      "typeVersion": 3.2
    },
    {
      "id": "cf3bee67-e127-4efb-a8b1-384603eb0151",
      "name": "Stop and Error",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        1500,
        200
      ],
      "parameters": {
        "errorMessage": "Unexpected error code when checking if Gitea repo already exists"
      },
      "typeVersion": 1
    },
    {
      "id": "8e3e60c7-a555-45aa-8ff4-aa64fd3aec46",
      "name": "Setup (CHANGE ME)",
      "type": "n8n-nodes-base.set",
      "position": [
        360,
        -20
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3a089155-3799-416c-bdc6-2d8db2c093d5",
              "name": "gitlabAccessToken",
              "type": "string",
              "value": "1234567890"
            },
            {
              "id": "1da58875-baa0-4a4a-86e8-6294236b21e1",
              "name": "gitlabGroupPathName",
              "type": "string",
              "value": "gitlab-group-name"
            },
            {
              "id": "ec12a90b-5b50-4a19-8e28-84c9d540497c",
              "name": "giteaOrganizationPathName",
              "type": "string",
              "value": "gitea-org-name"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "e475bc22-719c-4d87-95ba-7567107b7ecd",
      "name": "Gitea: Migrate repo",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1500,
        -20
      ],
      "parameters": {
        "url": "=https://gitea.example.com/api/v1/repos/migrate",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"auth_token\": \"{{ $('Setup (CHANGE ME)').item.json.gitlabAccessToken }}\",\n  \"clone_addr\": \"{{ $('Loop Over Items').item.json.http_url_to_repo }}\",\n  \"description\": \"{{ $('Loop Over Items').item.json.description }}\",\n  \"issues\": true,\n  \"labels\": true,\n  \"lfs\": true,\n  \"milestones\": true,\n  \"mirror\": false,\n  \"private\": true,\n  \"pull_requests\": true,\n  \"releases\": true,\n  \"repo_name\": \"{{ $('Loop Over Items').item.json.path }}\",\n  \"repo_owner\": \"{{ $('Setup (CHANGE ME)').item.json.giteaOrganizationPathName }}\",\n  \"service\": \"gitlab\",\n  \"wiki\": true\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "159efdb3-b3a6-469f-8021-b608996ffcc5",
      "name": "Gitea: Search for repo",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        1040,
        -20
      ],
      "parameters": {
        "url": "=https://gitea.example.com/api/v1/repos/{{ $('Setup (CHANGE ME)').item.json.giteaOrganizationPathName }}/{{ $json.path }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "06081af1-73c9-4f61-889c-289ea3de4c2c",
      "name": "Gitlab: Get projects",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        580,
        -20
      ],
      "parameters": {
        "url": "=https://gitlab.com/api/v4/groups/{{ $json.gitlabGroupPathName }}/projects",
        "options": {
          "pagination": {
            "pagination": {
              "parameters": {
                "parameters": [
                  {
                    "name": "page",
                    "value": "={{ $response.headers['x-next-page'] }}"
                  }
                ]
              },
              "completeExpression": "={{ $response.headers['x-page'] == $response.headers['x-total-pages'] }}",
              "paginationCompleteWhen": "other"
            }
          }
        },
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "per_page",
              "value": "20"
            }
          ]
        }
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    }
  ],
  "connections": {
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Gitea: Search for repo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Setup (CHANGE ME)": {
      "main": [
        [
          {
            "node": "Gitlab: Get projects",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch error codes": {
      "main": [
        [
          {
            "node": "Gitea: Migrate repo",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Stop and Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gitea: Migrate repo": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gitlab: Get projects": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gitea: Search for repo": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Switch error codes",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Setup (CHANGE ME)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This flow migrates all repositories of a Gitlab group to a Gitea organization by triggering Gitea's integrated migration tool.

Source: https://n8n.io/workflows/4947/ — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Web Scraping

[n8n] Advanced URL Parsing and Shortening Workflow - Switchy.io Integration. Uses splitInBatches, stickyNote, httpRequest, html. Event-driven trigger; 56 nodes.

HTTP Request, GitHub, Stop And Error +1
Web Scraping

[](https://youtu.be/c7yCZhmMjtI)

HTTP Request, GitHub, Stop And Error +1
Web Scraping

Episode 22: sleep. Uses httpRequest, stopAndError. Event-driven trigger; 42 nodes.

HTTP Request, Stop And Error
Web Scraping

Upload files from any source to your account Kommo or AmoCRM with a simple and reusable workflow. It can split a large file into small ones and upload chunks. Works for Kommo and amoCRM There are 3 re

HTTP Request, Execute Workflow Trigger, Stop And Error
Web Scraping

This workflow provides everything you need to package and deploy multiple workflows from a single workflow you distribute.

n8n, Stop And Error, GitHub +1