Skip to main content

Save your workflows into a Gitlab repository

Workflow preview

Workflow preview
100%
Save your workflows into a Gitlab repository preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This template is inspired by Save your workflows into a GitHub repository by [hikerspath](https://n8n.io/creators/hiker...

Best for

  • DevOps automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, 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

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Julien DEL RIO.

Original n8n.io source

1.1 Workflow description

Title
Save your workflows into a Gitlab repository
Workflow name
Save your workflows into a Gitlab repository

This template is inspired by Save your workflows into a GitHub repository by hikerspath and Back Up Your n8n Workflows To Github by jon-n8n.

Basic

Retrieve all workflows from an n8n instance and save it on a gitlab project. If the workflow exist, il will only save the changes.

Flow

What the workflow does :

  1. Sets custom parameters
  2. Gets workflows
  3. Iterates through each workflow one by one
    1. Get the file from Gitlab if exists
    2. Compare the files as objects (not as strings)
    3. Return a status on the workflow
  4. Create, Edit or ignore the file depending on the status
  5. Return a list of status for each workflow

Configuration

Select a credential in each Gitlab nodes.

Edit the data in node "Globals" :

  • repo.owner : slug of the user or team owning the repo
  • repo.name : slug of the repository
  • repo.branch : branch to commit on
  • repo.path : from root of the repository. Should end with /

Comments

Error on gitlab nodes will not stop the run but will list the current workflow as error in the results

Some fields are ignored to determined if there is changes :

  • updatedAt : should be ignored if only ignores fields are changed
  • globals : it's running information, no need to follow the changes

1.2 Logical Blocks

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.

2. Block-by-Block Analysis

Block 1 - When clicking "Test Workflow"

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Globals

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.2

Block 3 - Result

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 4 - Current workflow

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 5 - Loop Over Workflows

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 6 - Get file

Type / Role
n8n-nodes-base.gitlab - gitlab
Config choices
Version 1

Block 7 - File status

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Status error

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.2

Block 9 - End Loop

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 10 - Create file

Type / Role
n8n-nodes-base.gitlab - gitlab
Config choices
Version 1

Block 11 - Extract From File

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1

Block 12 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3

Block 13 - New file version

Type / Role
n8n-nodes-base.gitlab - gitlab
Config choices
Version 1

Block 14 - Error output to normal output

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 15 - Status new

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.2

Block 16 - Status diff

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.2

Block 17 - Status same

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.2

Block 18 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Retrieve all workflows

Type / Role
n8n-nodes-base.n8n - n8n
Config choices
Version 1

Block 21 - Save each version in a different field

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.2

3. Summary Table

Workflow Save your workflows into a Gitlab repository
Complexity advanced
Nodes 21
Categories DevOps
Author Julien DEL RIO
Published 22 Aug 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2385/2385.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

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.

Frequently asked questions

What does Save your workflows into a Gitlab repository do?

This template is inspired by Save your workflows into a GitHub repository by [hikerspath](https://n8n.io/creators/hiker...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

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.