This n8n workflow automates the process of backing up your n8n workflows to a Gitea Git repository at regular intervals, ensuring version control and safety of your automation builds. It is triggered every 45 minutes by a Schedule Trigger node. The workflow begins by setting global variables that specify your Gitea repository’s URL, owner, and name, which are crucial for connecting to the correct repository.
Next, it retrieves the current workflows using an API request node, then checks if each workflow file already exists in the repository. If the file exists, it fetches the current file data and compares it to the latest workflow data; if there are changes, it updates the file in Gitea using a PUT request, encoding the workflow JSON in Base64. If the file is new, it creates it in the repository with a POST request.
Throughout the process, sticky notes are used to document steps and setup instructions, making it easier to understand and maintain the workflow. The integration involves Gitea API endpoints for content management, requiring a personal access token for authentication.
This workflow is ideal for teams or individuals who want to keep a secure, versioned backup of their n8n workflows in a Gitea repository, facilitating collaboration, rollback capabilities, and disaster recovery.
Reviews
There are no reviews yet.