Skip to main content

Backup workflows to Git repository on Gitea

Workflow preview

Workflow preview
100%
Backup workflows to Git repository on Gitea 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 workflow automates the backup of all workflows from your system to a Git repository hosted on Gitea . It runs on a scheduled trigger , fetching, encoding, and committing workflow data, ensurin...

Best for

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

Tools used

n8n-nodes-base.set, n8n-nodes-base.n8n, n8n-nodes-base.scheduletrigger, n8n-nodes-base.stickynote, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.httprequest, n8n-nodes-base.splitinbatches

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Backup workflows to Git repository on Gitea
Workflow name
Backup workflows to Git repository on Gitea
Overview

This workflow automates the backup of all workflows from your system to a Git repository hosted on Gitea. It runs on a scheduled trigger, fetching, encoding, and committing workflow data, ensuring seamless version control and disaster recovery.

📌 Quick Setup: Just update three global variables and configure authentication—no manual exports needed!


How It Works (Quick Glance)

1️⃣ Scheduled Execution → Runs automatically at defined intervals. 2️⃣ Fetch Workflows → Uses the API to retrieve all workflows. 3️⃣ Process Workflows → Converts workflow data into a Git-friendly format. 4️⃣ Commit & Push to Git → Saves workflows in a Gitea repository.


Setup Steps (⚡ Takes ~5 min)

1️⃣ Set Global Variables

Go to the Globals section in the workflow and update:

  • repo.urlhttps://your-gitea-instance.com (Replace with your actual Gitea URL)
  • repo.nameworkflows (Repository name where backups will be stored)
  • repo.owneroctoleo (Gitea account that owns the repository)

📌 These three variables define where the workflows are stored.

2️⃣ Configure Gitea Authentication
  • Go to your Gitea account → Generate a Personal Access Token
  • In the credential manager, create a new Gitea Token with:
  • Name: Authorization
  • Value: Bearer YOUR_PERSONAL_ACCESS_TOKEN

📌 Ensure there is a space after Bearer before the token!

3️⃣ Link Credentials to Git Nodes

Attach the Gitea credentials to these three Git nodes:

  • GetGitea → Retrieves existing repository data
  • PutGitea → Updates workflows
  • PostGitea → Adds new workflows
4️⃣ Link Credentials for API Requests
  • Add API authentication in the node that fetches all workflows.
5️⃣ Test & Activate
  • Run the workflow manually to confirm backups work.
  • Enable the schedule trigger for automation.

📌 The workflow automatically checks for changes before committing updates.


Why Use This Workflow?

Automated Backups → No manual exports needed. ✅ Version Control → Easily track workflow changes. ✅ Simple Setup → Just configure globals & credentials. ✅ Secure → Uses token-based authentication.


Next Steps

💬 Have questions? Reach out on the forum! 🚀

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 - Globals

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

Block 2 - n8n

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

Block 3 - Schedule Trigger

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 4 - Sticky Note

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

Block 5 - Sticky Note1

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

Block 6 - Sticky Note2

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

Block 7 - Sticky Note3

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

Block 8 - Sticky Note5

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

Block 9 - Sticky Note6

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

Block 10 - SetDataUpdateNode

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

Block 11 - SetDataCreateNode

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

Block 12 - Base64EncodeUpdate

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

Block 13 - Base64EncodeCreate

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

Block 14 - Exist

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 15 - Changed

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 16 - PutGitea

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 17 - GetGitea

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 18 - PostGitea

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 19 - ForEach

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

Block 20 - Sticky Note4

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

3. Summary Table

Workflow Backup workflows to Git repository on Gitea
Complexity advanced
Nodes 20
Categories DevOps
Author Octoleo
Published 29 Jan 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2820/2820.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 Backup workflows to Git repository on Gitea do?

This workflow automates the backup of all workflows from your system to a Git repository hosted on Gitea . It runs on a scheduled trigger , fetching, encoding, and committing workflow data, ensurin...

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.