Backup workflows to git repository on Gitea

Automated backups for workflows on Gitea, running every 45 minutes. This workflow checks for changes, updates existing files, and creates new ones as needed, ensuring your workflows are securely stored and easily retrievable.

7/8/2025
20 nodes
Complex
uwnx4azsneynvtqi4b7bs9t0cagsg5tthin3ehc2kkap5kvsschedulecomplexn8nschedule triggersticky notesplitinbatchesautomationadvancedcronlogicconditionalapiintegration
Categories:
Schedule TriggeredComplex Workflow
Integrations:
N8nSchedule TriggerSticky NoteSplitInBatches

Target Audience

Target Audience


- Developers looking to automate the backup of their workflows to a Gitea repository.
- DevOps Engineers who need a reliable and scheduled backup solution for their automation scripts.
- Project Managers who want to ensure that all workflow changes are version-controlled and easily retrievable.
- Organizations that prioritize data integrity and require a systematic approach to backup critical workflows.

Problem Solved

Problem Solved


This workflow addresses the challenge of ensuring that automation workflows are consistently backed up in a version-controlled environment. It automates the process of checking for changes in workflows and updating them in a Gitea repository, preventing data loss and providing easy access to previous versions.

Workflow Steps

Workflow Steps


1. Schedule Trigger: The workflow is triggered every 45 minutes to ensure regular backups.
2. Get All Workflows: It retrieves all existing workflows to compare with the current state.
3. Check for Changes: The workflow checks if there are any modifications in the workflows since the last backup.
4. Base64 Encoding: If changes are detected, the workflow encodes the workflow data to Base64 format for secure storage.
5. Gitea Interaction: The workflow interacts with the Gitea API to:
- Check if the file exists in the repository.
- Update the existing file if it has changed.
- Create a new file if it does not exist.
6. Sticky Notes: Throughout the process, sticky notes provide useful information and reminders about each step for easy reference.
7. Completion Notification: A sticky note confirms that the workflow changes have been successfully committed to the repository.

Customization Guide

Customization Guide


- Global Variables: Update the repo.url, repo.name, and repo.owner in the Globals node to match your Gitea repository settings.
- Authentication: Ensure you set up a Gitea Token with appropriate permissions and link it to the HTTP request nodes (GetGitea, PutGitea, PostGitea).
- Schedule Frequency: Modify the Schedule Trigger interval to adjust how often the workflow runs (e.g., change from 45 minutes to 1 hour).
- Workflow Content: If you need to back up different workflows, adjust the Get All Workflows node to include those workflows.
- Testing: Run the workflow manually after making changes to ensure everything is functioning as expected before enabling the scheduled trigger.