n8n

How to Automate Gitea n8n Workflow Backups?

Keep every n8n workflow safely stored in a Git repo so your team has history, audit, and quick recovery. Ideal for teams that build many flows and want simple version control without manual exports.

A schedule runs every 45 minutes. The n8n node pulls all workflows. SplitInBatches handles them one by one. The system checks Gitea to see if a file already exists. If it does not exist, it creates it. If it exists, it encodes the new content and compares using a change check. Updates use the file SHA so only changed workflows are committed. Globals hold the repo URL, owner, and name, and HTTP Request nodes handle GET, POST, and PUT calls to Gitea with a token.

Setup needs a Gitea personal access token and an n8n API credential. Enter the repo details in the Globals node, then connect the credentials to the three Gitea request nodes. Run a test and confirm files appear and update as you change flows. Expect less manual work, clear history, and faster recovery after mistakes. Great for IT teams, platform owners, and any group that must track automation changes.

What are the key features?

  • Schedule Trigger runs the backup every 45 minutes or at your chosen interval.
  • n8n node fetches all workflows from your n8n account.
  • SplitInBatches processes workflows one by one to stay stable.
  • HTTP Request nodes call Gitea to check, create, and update files.
  • If nodes decide when a file exists and when content has changed.
  • Code nodes encode workflow JSON to Base64 for the Gitea API.
  • Globals store repo URL, owner, and name for easy reuse.
  • Uses file SHA on updates so only changed workflows are committed.

What are the benefits?

  • Reduce manual backup work from 60 minutes to 5 minutes per day
  • Automate 100 percent of workflow versioning with scheduled commits
  • Update only changed files to cut API calls and noise
  • Improve backup accuracy to near 100 percent with SHA checks
  • Handle hundreds of workflows reliably with batch processing
  • Connect n8n and Gitea so your automations have a single source of truth

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Gitea and n8n. See the Tools Required section above for links to create accounts with these services.
  3. Open the Globals node and set repo.url, repo.owner, and repo.name to match your Gitea server and repository.
  4. In Gitea, create a Personal Access Token with repo read and write permissions. Copy the token.
  5. In the n8n credentials manager, create a new HTTP Header credential. Set the header name to Authorization and the value to Bearer YOUR_TOKEN, then save.
  6. Open the GetGitea, PostGitea, and PutGitea nodes. In Credential to connect with, choose your Gitea token credential.
  7. Open the n8n node. In Credential to connect with, click Create new credential and follow the on screen steps to connect to your n8n instance.
  8. Check the Schedule Trigger and adjust the interval if needed. Save the workflow.
  9. Run the workflow once. In your Gitea repo, confirm that workflow files were created. Make a small change to a workflow and run again to confirm an update commit appears.
  10. If you get 401 errors, verify the Gitea token and Authorization header format. If you see 404 errors, confirm repo URL, owner, and name in Globals. If updates fail, check that the file path and SHA values are present in the responses.
  11. Enable the workflow so backups run on the set schedule.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Gitea

Sign up

Self-hosted open-source: $0 (API available via personal access token)

n8n API

Sign up

Community Edition (self-hosted): $0 (public REST API available). Cloud Starter: $20 / mo billed annually ($24 monthly); API unavailable during free trial.

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.