Skip to content
FlowHubFluxonLab
C
GitLabfree

Save your workflows into a Gitlab repository

by Julien DEL RIOadapted from n8n official workflow galleryUpdated Aug 2026
RequiresCCodeGitLabGitLab
Share Post Share
MaWhen clicking "Test Workflow"When clicking "…SeGlobalsNOResultNOCurrent workflowSILoop Over WorkflowsLoop Over Workf…Get fileCoFile statusSeStatus errorNOEnd LoopCreate fileEFExtract From FileExtract From Fi…SwSwitchNew file versionNOError output to normal outputError output to…SeStatus newSeStatus diffSeStatus sameN8Retrieve all workflowsRetrieve all wo…SeSave each version in a different fieldSave each versi…12345678910111213141516171819202122232425
1/5
STEPS · 25
Run manually by an operator

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 : Sets custom parameters Gets workflows Iterates through each workflow one by one Get the file from Gitlab if exists Compare the files as objects (not as strings) Return a status on the workflow Create, Edit or ignore the file depending on the status 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.

Tags

n8nreference-onlygitlab
Connects
CCodegitlabGitLab
CategoryGitLab
Triggermanual
Complexitycomplex
Nodes19
AddedAug 22, 2024

Related workflows

See all GitLab
gitlab
free

Backup Tag-Selected Workflows to Gitlab

Fetches workflow definitions from within n8n, selecting only the ones that have one or more (configurable) assigned tags and then: Derives a suitable backup filename by reducing the workflow name to a string with alphanumeric characters and no-spaces Note: This isn't bulletproof, but works as long as workflow names aren't too crazy. Determines which workflows need to be backed up based on whether each one: has been modified. (Note: Even repositioning a node counts.) ...or... is new. (Note: Renaming counts as this.) Commits JSON copies of each workflow, as necessary, to a Gitlab repository with a generated, date-stamped commit message. Setup Credentials Create a Gitlab Credentials item and assign it to all Gitlab nodes. Create an n8n Credentials item and assign it to the n8n node Note: This was tested with http://localhost:5678/api/v1 but should work with any reachable n8n instance and API key. Modify these values in the "Globals" Node gitlab_owner - {{your gitlab account}} gitlab_project - {{ your gitlab project name }} gitlab_workflow_path - {{ subdirectory in the project where backup files should be saved/committed }} tags_to_match_for_backup - {{tag(s) to match for backup select

by Hubschrauber