Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - {
 - "name": "GitHub Workflow Version History",
 - "nodes": [
 - {
 - "parameters": {
 - "rule": {
 - "interval": [
 - {
 - "field": "hours",
 - "hoursInterval": 4
 - }
 - ]
 - }
 - },
 - "type": "n8n-nodes-base.scheduleTrigger",
 - "typeVersion": 1.2,
 - "position": [
 - 0,
 - 96
 - ],
 - "id": "205daad7-56f4-488b-a98b-0081d831c82a",
 - "name": "Schedule Trigger"
 - },
 - {
 - "parameters": {
 - "resource": "file",
 - "owner": {
 - "__rl": true,
 - "value": "YOUR_GITHUB_USERNAME",
 - "mode": "list",
 - "cachedResultName": "YOUR_GITHUB_USERNAME",
 - "cachedResultUrl": ""
 - },
 - "repository": {
 - "__rl": true,
 - "value": "YOUR_REPOSITORY_NAME",
 - "mode": "list",
 - "cachedResultName": "YOUR_REPOSITORY_NAME",
 - "cachedResultUrl": ""
 - },
 - "filePath": "={{ $json.name }}.json",
 - "fileContent": "={{ $json.toJsonString() }}",
 - "commitMessage": "=Updated {{ $json.updatedAt }}",
 - "additionalParameters": {
 - "branch": {
 - "branch": "main"
 - },
 - "author": {
 - "name": "YOUR_NAME",
 - }
 - }
 - },
 - "type": "n8n-nodes-base.github",
 - "typeVersion": 1.1,
 - "position": [
 - 896,
 - 192
 - ],
 - "id": "e13d2006-2f7a-43b2-ad0e-4c3b7e97f37e",
 - "name": "Create a file",
 - "webhookId": "3401d931-11ad-4e09-be5a-cbad607fe8e1"
 - },
 - {
 - "parameters": {
 - "resource": "file",
 - "operation": "edit",
 - "owner": {
 - "__rl": true,
 - "value": "YOUR_GITHUB_USERNAME",
 - "mode": "list",
 - "cachedResultName": "YOUR_GITHUB_USERNAME",
 - "cachedResultUrl": ""
 - },
 - "repository": {
 - "__rl": true,
 - "value": "YOUR_REPOSITORY_NAME",
 - "mode": "list",
 - "cachedResultName": "YOUR_REPOSITORY_NAME",
 - "cachedResultUrl": ""
 - },
 - "filePath": "={{ $('Get All Active Workflows').item.json.name }}.json",
 - "fileContent": "={{ $json.toJsonString() }}",
 - "commitMessage": "=Updated At {{ $json.data.updatedAt }}"
 - },
 - "type": "n8n-nodes-base.github",
 - "typeVersion": 1.1,
 - "position": [
 - 1120,
 - 0
 - ],
 - "id": "5a6b55ca-03d7-46f5-a448-f1316db735d2",
 - "name": "Edit a file",
 - "webhookId": "83055caa-9e23-4ce7-916e-389a0906257f"
 - },
 - {
 - "parameters": {
 - "operation": "fromJson",
 - "options": {}
 - },
 - "type": "n8n-nodes-base.extractFromFile",
 - "typeVersion": 1,
 - "position": [
 - 672,
 - -96
 - ],
 - "id": "b27525a4-8f6a-4f37-b597-353ae54bc9a5",
 - "name": "Extract from File"
 - },
 - {
 - "parameters": {},
 - "type": "n8n-nodes-base.noOp",
 - "typeVersion": 1,
 - "position": [
 - 1120,
 - -192
 - ],
 - "id": "48ec6713-a0c9-4da8-aae6-81d40342ecd5",
 - "name": "Ignores Because it is already up to date"
 - },
 - {
 - "parameters": {},
 - "type": "n8n-nodes-base.noOp",
 - "typeVersion": 1,
 - "position": [
 - 896,
 - 368
 - ],
 - "id": "d953ec2b-3560-42ce-8f99-86325977e8a5",
 - "name": "Ignores because it's not related to missing file"
 - },
 - {
 - "parameters": {
 - "filters": {
 - "activeWorkflows": true
 - },
 - "requestOptions": {}
 - },
 - "type": "n8n-nodes-base.n8n",
 - "typeVersion": 1,
 - "position": [
 - 224,
 - 96
 - ],
 - "id": "98fd97f3-8efe-4352-bad1-efd82204581d",
 - "name": "Get All Active Workflows"
 - },
 - {
 - "parameters": {
 - "resource": "file",
 - "operation": "get",
 - "owner": {
 - "__rl": true,
 - "value": "YOUR_GITHUB_USERNAME",
 - "mode": "list",
 - "cachedResultName": "YOUR_GITHUB_USERNAME",
 - "cachedResultUrl": ""
 - },
 - "repository": {
 - "__rl": true,
 - "value": "YOUR_REPOSITORY_NAME",
 - "mode": "list",
 - "cachedResultName": "YOUR_REPOSITORY_NAME",
 - "cachedResultUrl": ""
 - },
 - "filePath": "={{ $json.name }}.json",
 - "additionalParameters": {}
 - },
 - "type": "n8n-nodes-base.github",
 - "typeVersion": 1.1,
 - "position": [
 - 448,
 - 96
 - ],
 - "id": "256128b4-b2b9-4c1e-80e7-23cfd4f92ba8",
 - "name": "Check if File exists And Return if Exists",
 - "webhookId": "42cce76f-ff67-40f1-870a-b7b6349c1458",
 - "onError": "continueErrorOutput"
 - },
 - {
 - "parameters": {
 - "conditions": {
 - "options": {
 - "caseSensitive": true,
 - "leftValue": "",
 - "typeValidation": "strict",
 - "version": 2
 - },
 - "conditions": [
 - {
 - "id": "6d500852-4065-4cf2-8ec2-69fdc7ca1c76",
 - "leftValue": "={{ $json.data.updatedAt }}",
 - "rightValue": "={{ $('Get All Active Workflows').item.json.updatedAt }}",
 - "operator": {
 - "type": "string",
 - "operation": "equals",
 - "name": "filter.operator.equals"
 - }
 - }
 - ],
 - "combinator": "and"
 - },
 - "options": {}
 - },
 - "type": "n8n-nodes-base.if",
 - "typeVersion": 2.2,
 - "position": [
 - 896,
 - -96
 - ],
 - "id": "c5e8b708-47b6-4179-a97e-f474531196d9",
 - "name": "Check if Update to Date"
 - },
 - {
 - "parameters": {
 - "conditions": {
 - "options": {
 - "caseSensitive": true,
 - "leftValue": "",
 - "typeValidation": "strict",
 - "version": 2
 - },
 - "conditions": [
 - {
 - "id": "44998fae-9cd0-479d-9360-a281c8dfef4b",
 - "leftValue": "={{ $json.error }}",
 - "rightValue": "The resource you are requesting could not be found",
 - "operator": {
 - "type": "string",
 - "operation": "equals",
 - "name": "filter.operator.equals"
 - }
 - }
 - ],
 - "combinator": "and"
 - },
 - "options": {}
 - },
 - "type": "n8n-nodes-base.if",
 - "typeVersion": 2.2,
 - "position": [
 - 672,
 - 256
 - ],
 - "id": "add1f71e-1885-4186-a684-9c71926ad39a",
 - "name": "Check if File Missing"
 - },
 - {
 - "parameters": {
 - "content": "##Update Existing File",
 - "height": 384,
 - "width": 752
 - },
 - "type": "n8n-nodes-base.stickyNote",
 - "position": [
 - 624,
 - -240
 - ],
 - "typeVersion": 1,
 - "id": "c56683f7-3021-4900-93c2-51e066db4240",
 - "name": "Sticky Note"
 - },
 - {
 - "parameters": {
 - "content": "## Add New File",
 - "height": 384,
 - "width": 752,
 - "color": 5
 - },
 - "type": "n8n-nodes-base.stickyNote",
 - "position": [
 - 624,
 - 144
 - ],
 - "typeVersion": 1,
 - "id": "3a4435ba-e3e0-4f35-9a8f-80300826eafa",
 - "name": "Sticky Note1"
 - },
 - {
 - "parameters": {
 - "content": "## Check Workflow State",
 - "height": 272,
 - "width": 720,
 - "color": 6
 - },
 - "type": "n8n-nodes-base.stickyNote",
 - "position": [
 - -96,
 - 32
 - ],
 - "typeVersion": 1,
 - "id": "c7d7bbf3-bf7d-4388-b5bd-d631f38e7fcb",
 - "name": "Sticky Note2"
 - }
 - ],
 - "pinData": {},
 - "connections": {
 - "Schedule Trigger": {
 - "main": [
 - [
 - {
 - "node": "Get All Active Workflows",
 - "type": "main",
 - "index": 0
 - }
 - ]
 - ]
 - },
 - "Extract from File": {
 - "main": [
 - [
 - {
 - "node": "Check if Update to Date",
 - "type": "main",
 - "index": 0
 - }
 - ]
 - ]
 - },
 - "Get All Active Workflows": {
 - "main": [
 - [
 - {
 - "node": "Check if File exists And Return if Exists",
 - "type": "main",
 - "index": 0
 - }
 - ]
 - ]
 - },
 - "Check if File exists And Return if Exists": {
 - "main": [
 - [
 - {
 - "node": "Extract from File",
 - "type": "main",
 - "index": 0
 - }
 - ],
 - [
 - {
 - "node": "Check if File Missing",
 - "type": "main",
 - "index": 0
 - }
 - ]
 - ]
 - },
 - "Check if Update to Date": {
 - "main": [
 - [
 - {
 - "node": "Ignores Because it is already up to date",
 - "type": "main",
 - "index": 0
 - }
 - ],
 - [
 - {
 - "node": "Edit a file",
 - "type": "main",
 - "index": 0
 - }
 - ]
 - ]
 - },
 - "Check if File Missing": {
 - "main": [
 - [
 - {
 - "node": "Create a file",
 - "type": "main",
 - "index": 0
 - }
 - ],
 - [
 - {
 - "node": "Ignores because it's not related to missing file",
 - "type": "main",
 - "index": 0
 - }
 - ]
 - ]
 - }
 - },
 - "active": false,
 - "settings": {
 - "executionOrder": "v1"
 - },
 - "versionId": "3b89d86e-6809-4a55-ac6a-d7b7fa32638f",
 - "meta": {
 - "templateCredsSetupCompleted": true,
 - "instanceId": "30a7d5bd3ded7aaf7d092822cf25bde1a7a80c113246004be47c438c17ff5bbc"
 - },
 - "id": "ix8CoZSODshwVulg",
 - "tags": []
 - }
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment