Block 1 - Globals
- Type / Role
- n8n-nodes-base.set - set
- Config choices
- Version 3.2
This workflow is provided as-is. Please review and test before using in production.
n8n Workflow: Sync Workflows with GitLab How It Works This workflow ensures that your self hosted n8n workflows are version controlled in a GitLab repository. It compares each current workflow from...
n8n-nodes-base.set, n8n-nodes-base.noop, n8n-nodes-base.splitinbatches, n8n-nodes-base.gitlab, n8n-nodes-base.code, n8n-nodes-base.extractfromfile, n8n-nodes-base.switch, n8n-nodes-base.n8n
This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Akhil Varma Gadiraju.
Original n8n.io sourceThis workflow ensures that your self-hosted n8n workflows are version-controlled in a GitLab repository. It compares each current workflow from n8n with its stored counterpart in GitLab. If any differences are detected, the GitLab file is updated with the latest version.
Retrieve Workflows – Fetch all workflows from the n8n REST API.
Compare with GitLab – For each workflow, fetch the corresponding file from GitLab and compare the JSON.
Update if Changed – If differences exist, commit the updated workflow to GitLab using its API.
Before using the workflow, ensure the following:
n8n: Self-hosted instance with access to the /rest/workflows API.
GitLab: A repository where workflows will be stored, and a Personal Access Token (PAT) with api and write_repository permissions.
n8n Nodes Required:
SplitInBatches or similar)GITLAB_TOKENGITLAB_REPOGITLAB_BRANCH (e.g., main)GITLAB_FILE_PATH_PREFIX (e.g., n8n-workflows/)Import the Workflow into your n8n instance.
Configure GitLab API Credentials:
Request node:
Private-Token: {{ $env.GITLAB_TOKEN }}
Map Workflows to GitLab Paths:
n8n-workflows/workflow-name.jsonTrigger the Workflow:
Review Commits in GitLab:
"Update workflow: Sample Workflow"This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.
| Workflow | Automated daily backup of n8n workflows to GitLab repositories |
|---|---|
| Complexity | advanced |
| Nodes | 19 |
| Categories | DevOps |
| Author | Akhil Varma Gadiraju |
| Published | 14 May 2025 |
Use the JSON export at /data/workflows/4035/4035.json as the source template for this automation.
Open n8n, import the downloaded JSON, and review each node before activating the workflow.
Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.
Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.
Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.
Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.
Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.
n8n Workflow: Sync Workflows with GitLab How It Works This workflow ensures that your self hosted n8n workflows are version controlled in a GitLab repository. It compares each current workflow from...
Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.
Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps use case.