{ "updatedAt": "2026-02-07T17:40:54.000Z", "createdAt": "2026-02-07T17:26:56.088Z", "id": "ELSlHxqYRAgcoG7FM610k", "name": "Backup workflows to git repository on Gitea", "active": false, "isArchived": true, "nodes": [ { "parameters": { "values": { "string": [ { "name": "repo.url", "value": "https://gitea.prinz-pilaw.de" }, { "name": "repo.name", "value": "n8n-workspace" }, { "name": "repo.owner", "value": "gitea" } ] }, "options": {} }, "id": "34f39470-ae54-4816-b50c-cb86ad547cf7", "name": "Globals", "type": "n8n-nodes-base.set", "position": [ 112, 64 ], "typeVersion": 1 }, { "parameters": { "filters": {}, "requestOptions": {} }, "id": "129e03c7-299b-49cf-8fb6-2f953b951e9f", "name": "n8n", "type": "n8n-nodes-base.n8n", "position": [ 352, 64 ], "typeVersion": 1, "credentials": { "n8nApi": { "id": "sRsWD6qTeQzLCxKg", "name": "n8n-workspace-backup-token" } } }, { "parameters": { "rule": { "interval": [ { "field": "minutes", "minutesInterval": 45 } ] } }, "id": "3551acee-8513-4cf5-a878-443a2a0980c6", "name": "Schedule Trigger", "type": "n8n-nodes-base.scheduleTrigger", "position": [ -112, 64 ], "typeVersion": 1.2 }, { "parameters": { "content": "Workflow changes committed to the repository", "height": 80 }, "id": "43454e8f-d2ed-47d5-ad83-14a5eefdd87d", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 2128, 128 ], "typeVersion": 1 }, { "parameters": { "content": "Check if there are any changes in the workflow", "height": 80 }, "id": "031d6185-04c5-4668-bc19-157d36042ea6", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 1760, 0 ], "typeVersion": 1 }, { "parameters": { "content": "Create a new file for the workflow", "height": 80 }, "id": "347eaab7-b7be-4156-a1a5-4b2b5f5c8336", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 1312, 400 ], "typeVersion": 1 }, { "parameters": { "content": "Check if file exists in the repository", "height": 80 }, "id": "2290978f-79c6-4782-ab5b-0b7085935b34", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 800, 32 ], "typeVersion": 1 }, { "parameters": { "content": "Get all workflows", "height": 80 }, "id": "3b77938a-2156-46cd-b055-d5a03697d326", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 288, 0 ], "typeVersion": 1 }, { "parameters": { "content": "Set variables", "height": 80 }, "id": "fabcf735-0f3f-4d47-8986-37004737667c", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ 0, 0 ], "typeVersion": 1 }, { "parameters": { "assignments": { "assignments": [ { "id": "0a6b769a-c66d-4784-92c7-a70caa28e1ba", "name": "item", "type": "object", "value": "={{ $node[\"ForEach\"].json }}" } ] }, "options": {} }, "id": "590e1db3-d167-418c-a97d-cdbccefa9701", "name": "SetDataUpdateNode", "type": "n8n-nodes-base.set", "position": [ 1424, 64 ], "typeVersion": 3.4 }, { "parameters": { "assignments": { "assignments": [ { "id": "0a6b769a-c66d-4784-92c7-a70caa28e1ba", "name": "item", "type": "object", "value": "={{ $node[\"ForEach\"].json }}" } ] }, "options": {} }, "id": "dafa7f4f-9088-4061-a3db-63ac49711b3d", "name": "SetDataCreateNode", "type": "n8n-nodes-base.set", "position": [ 720, 464 ], "typeVersion": 3.4 }, { "parameters": { "language": "pythonNative", "pythonCode": "# Loop over input items and add a new field called 'my_new_field' to the JSON of each one\nfor item in _items:\n item[\"json\"][\"my_new_field\"] = 1\nreturn _items" }, "id": "9ed8fa7d-8e21-46bd-b8dc-19f7ba28bdb2", "name": "Base64EncodeUpdate", "type": "n8n-nodes-base.code", "position": [ 1648, 64 ], "typeVersion": 2 }, { "parameters": { "language": "python" }, "id": "d77edd2c-5ef8-494c-9d05-b269f0d75a53", "name": "Base64EncodeCreate", "type": "n8n-nodes-base.code", "position": [ 1024, 464 ], "typeVersion": 2 }, { "parameters": { "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "or", "conditions": [ { "id": "16a9182d-059d-4774-ba95-654fb4293fdb", "operator": { "type": "object", "operation": "notExists", "singleValue": true }, "leftValue": "={{ $json.error }}", "rightValue": 404 } ] }, "options": { "ignoreCase": false } }, "id": "19f7391d-5035-4ea0-a38c-9d7068cff3f8", "name": "Exist", "type": "n8n-nodes-base.if", "position": [ 1152, 80 ], "executeOnce": false, "typeVersion": 2.2, "alwaysOutputData": false }, { "parameters": { "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "e0c66624-429a-4f1f-bf7b-1cc1b32bad7b", "operator": { "type": "string", "operation": "notEquals" }, "leftValue": "={{ $json.item }}", "rightValue": "={{ $('GetGitea').item.json.content }}" } ] }, "options": {} }, "id": "21374491-bf17-4fd8-b9b9-6eeb38ae56e2", "name": "Changed", "type": "n8n-nodes-base.if", "position": [ 1872, 64 ], "typeVersion": 2.2 }, { "parameters": { "method": "PUT", "url": "={{ $('Globals').item.json.repo.url }}/api/v1/repos/{{ $('Globals').item.json.repo.owner }}/{{ $('Globals').item.json.repo.name }}/contents/{{ encodeURIComponent($('GetGitea').item.json.name) }}", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, "bodyParameters": { "parameters": [ { "name": "content", "value": "={{ $('Base64EncodeUpdate').item.json.item }}" }, { "name": "sha", "value": "={{ $('GetGitea').item.json.sha }}" } ] }, "options": {} }, "id": "8460c95b-9304-4356-9d92-e953312cbbf4", "name": "PutGitea", "type": "n8n-nodes-base.httpRequest", "position": [ 2208, 192 ], "typeVersion": 4.2 }, { "parameters": { "url": "={{ $('Globals').item.json.repo.url }}/api/v1/repos/{{ encodeURIComponent($('Globals').item.json.repo.owner) }}/{{ encodeURIComponent($('Globals').item.json.repo.name) }}/contents/{{ encodeURIComponent($json.name) }}.json", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "options": {} }, "id": "1021ef3f-4bb6-4821-80ca-fbf342a4bd2f", "name": "GetGitea", "type": "n8n-nodes-base.httpRequest", "position": [ 880, 80 ], "typeVersion": 4.2, "credentials": { "httpHeaderAuth": { "id": "9rVued8FuUi6ySvN", "name": "gittea" } }, "onError": "continueRegularOutput" }, { "parameters": { "method": "POST", "url": "={{ $('Globals').item.json.repo.url }}/api/v1/repos/{{ $('Globals').item.json.repo.owner }}/{{ $('Globals').item.json.repo.name }}/contents/{{ encodeURIComponent($('ForEach').item.json.name) }}.json", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "sendBody": true, "bodyParameters": { "parameters": [ { "name": "content", "value": "={{ $json.item }}" } ] }, "options": {} }, "id": "36ff91a0-c476-4b14-96b9-074fd80312a5", "name": "PostGitea", "type": "n8n-nodes-base.httpRequest", "position": [ 1424, 464 ], "typeVersion": 4.2, "credentials": { "httpHeaderAuth": { "id": "9rVued8FuUi6ySvN", "name": "gittea" } } }, { "parameters": { "options": {} }, "id": "1ed03af6-df51-410b-a479-5c1fd6327e58", "name": "ForEach", "type": "n8n-nodes-base.splitInBatches", "position": [ 560, 64 ], "executeOnce": false, "typeVersion": 3 }, { "parameters": { "content": "### **šŸ“Œ Setup Guide for Backup Workflows to Git Repository on Gitea**\n\n#### **šŸ”§ 1. Configure Global Variables**\nGo to the **Globals** node and update the following:\n- **`repo.url`** → `https://your-gitea-instance.com` *(Replace with your actual Gitea URL)*\n- **`repo.name`** → `workflows` *(Repository name where backups will be stored)*\n- **`repo.owner`** → `octoleo` *(Gitea account that owns the repository)*\n\nšŸ“Œ **These settings define where workflows will be backed up.**\n\n---\n\n#### **šŸ”‘ 2. Set Up Gitea Authentication**\n1ļøāƒ£ **In Gitea:**\n- Generate a **Personal Access Token** under **Settings → Applications → Generate Token**\n- Ensure the token has **repo read/write permissions**\n\n2ļøāƒ£ **In the Credentials Manager:**\n- Create a new **Gitea Token** credential\n- Set the **Name** as `Authorization`\n- Set the **Value** as:\n```\nBearer YOUR_TOKEN_HERE\n```\nšŸ“Œ **Ensure there is a space after `Bearer` before the token!**\n\n---\n\n#### **šŸ”— 3. Connect Gitea Credentials to Git Nodes**\n- Open each of these **three Git nodes**:\n- **GetGitea** → Retrieves existing repository data\n- **PutGitea** → Updates workflows\n- **PostGitea** → Adds new workflows\n\n- Assign the **Gitea Token** credential to each node.\n\nšŸ“Œ **These nodes handle pushing your workflows to Gitea.**\n\n---\n\n#### **🌐 4. Set Up API Credentials for Workflow Retrieval**\n- Locate the API request node that **fetches workflows**.\n- Add your **API authentication credentials** (Token or Basic Auth).\n\nšŸ“Œ **This ensures the workflow can fetch all available workflows from your system.**\n\n---\n\n#### **šŸ› ļø 5. Test & Activate the Workflow**\nāœ… **Run the workflow manually** → Check that workflows are being backed up correctly.\nāœ… **Review the Gitea repository** → Ensure the files are updated.\nāœ… **Enable the scheduled trigger** → Automates backups at defined intervals.\n\nšŸ“Œ **The workflow automatically checks for changes before committing updates!**\n\n---\n\n### **šŸš€ Done! Your Workflows Are Now Backed Up Securely!**\nšŸ’¬ Have issues? **Reach out on the forum for help!**", "height": 1620, "width": 560 }, "id": "5411d3bf-23f2-4fa3-a1c7-e1d4e370006e", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ -112, 272 ], "typeVersion": 1 } ], "connections": { "n8n": { "main": [ [ { "node": "ForEach", "type": "main", "index": 0 } ] ] }, "Exist": { "main": [ [ { "node": "SetDataUpdateNode", "type": "main", "index": 0 } ], [ { "node": "SetDataCreateNode", "type": "main", "index": 0 } ] ] }, "Changed": { "main": [ [ { "node": "PutGitea", "type": "main", "index": 0 } ], [ { "node": "ForEach", "type": "main", "index": 0 } ] ] }, "ForEach": { "main": [ [], [ { "node": "GetGitea", "type": "main", "index": 0 } ] ] }, "Globals": { "main": [ [ { "node": "n8n", "type": "main", "index": 0 } ] ] }, "GetGitea": { "main": [ [ { "node": "Exist", "type": "main", "index": 0 } ] ] }, "PutGitea": { "main": [ [ { "node": "ForEach", "type": "main", "index": 0 } ] ] }, "PostGitea": { "main": [ [ { "node": "ForEach", "type": "main", "index": 0 } ] ] }, "Schedule Trigger": { "main": [ [ { "node": "Globals", "type": "main", "index": 0 } ] ] }, "SetDataCreateNode": { "main": [ [ { "node": "Base64EncodeCreate", "type": "main", "index": 0 } ] ] }, "SetDataUpdateNode": { "main": [ [ { "node": "Base64EncodeUpdate", "type": "main", "index": 0 } ] ] }, "Base64EncodeCreate": { "main": [ [ { "node": "PostGitea", "type": "main", "index": 0 } ] ] }, "Base64EncodeUpdate": { "main": [ [ { "node": "Changed", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1", "availableInMCP": false }, "staticData": null, "meta": { "templateCredsSetupCompleted": true }, "pinData": {}, "versionId": "4e5b2595-bd2b-458c-9ed2-6ea60e7a0d7f", "activeVersionId": null, "triggerCount": 0, "shared": [ { "updatedAt": "2026-02-07T17:26:56.090Z", "createdAt": "2026-02-07T17:26:56.090Z", "role": "workflow:owner", "workflowId": "ELSlHxqYRAgcoG7FM610k", "projectId": "cSAaWNJydnksD5EB" } ], "activeVersion": null, "tags": [] }