n8n Workflows to Github
Shared 12/9/2025
14 views
Visual Workflow
JSON Code
{
"meta": {
"instanceId": "ca0935fb7d3cc6f244f34460314892df2eee219bc55baa58e8c83ff1b04697f1",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "343ad886-2b16-4929-9788-44a3d6430dd8",
"name": "Schedule Trigger",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
176,
64
],
"parameters": {
"rule": {
"interval": [
{
"field": "hours",
"hoursInterval": 4,
"triggerAtMinute": 40
}
]
}
},
"typeVersion": 1.2
},
{
"id": "988ccffc-c014-4d0f-8c26-4e4415d63548",
"name": "Message a model",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
496,
608
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini",
"cachedResultName": "GPT-4.1-MINI"
},
"options": {
"textFormat": {
"textOptions": {
"type": "json_schema",
"schema": "{\n \"type\": \"object\",\n \"properties\": {\n \"commit_message\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\"commit_message\"]\n}"
}
}
},
"responses": {
"values": [
{
"content": "=#TASK\n\nI would like you to prepare a short commit message related the automation below. There is older version and an updated version of the automation. I would like you to identify the differences/updates made to the automation by comparing differences in the Old and Updated versions, then use that comparison to write the commit message to add the Updated Workflow into Github.\n\nWorkflow Name: {{ $('Get many workflows').item.json.name }}\n\n## UPDATED WORKFLOW\n{{ $('Get many workflows').item.json.nodes.toJsonString() }}\n\n## OLD WORKFLOW\n{{ $json.data.nodes.toJsonString() }}"
}
]
},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"id": "tjf9ytf3xLEqDCRr",
"name": "OpenAi account"
}
},
"typeVersion": 2
},
{
"id": "2ed5aea1-0f43-46b2-a246-1de46a2319c6",
"name": "Create a file",
"type": "n8n-nodes-base.github",
"position": [
960,
848
],
"webhookId": "af1a453b-db41-4a8f-baa9-95b28849c06e",
"parameters": {
"owner": {
"__rl": true,
"mode": "name",
"value": "njogued"
},
"filePath": "={{ $('Edit Fields').item.json.file_name }}",
"resource": "file",
"repository": {
"__rl": true,
"mode": "list",
"value": "automation",
"cachedResultUrl": "https://github.com/njogued/automation",
"cachedResultName": "automation"
},
"fileContent": "={{ JSON.stringify($('Get many workflows').item.json, null, 2) }}",
"commitMessage": "={{ $json.output[0].content[0].text.commit_message }}"
},
"credentials": {
"githubApi": {
"id": "95qFLriSOUXwIi39",
"name": "GitHub account"
}
},
"typeVersion": 1.1
},
{
"id": "951d0213-bd6b-4c50-8739-aa57473094e3",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
512,
352
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "22311fda-25e7-4585-b07e-e60e14a4b812",
"name": "file_name",
"type": "string",
"value": "=n8n/{{ $json.name.replaceAll(' ','_') }}.json"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "8282bdd1-ad96-4978-81bb-dd08ad6a4a70",
"name": "List files",
"type": "n8n-nodes-base.github",
"position": [
528,
64
],
"webhookId": "1c17a39c-7667-4705-bf7c-a4dd7983f02e",
"parameters": {
"owner": {
"__rl": true,
"mode": "list",
"value": "njogued",
"cachedResultUrl": "https://github.com/njogued",
"cachedResultName": "njogued"
},
"filePath": "n8n",
"resource": "file",
"operation": "list",
"repository": {
"__rl": true,
"mode": "list",
"value": "automation",
"cachedResultUrl": "https://github.com/njogued/automation",
"cachedResultName": "automation"
}
},
"credentials": {
"githubApi": {
"id": "95qFLriSOUXwIi39",
"name": "GitHub account"
}
},
"typeVersion": 1.1
},
{
"id": "d08dcf98-4535-4584-be68-c5322c4c5c47",
"name": "Aggregate",
"type": "n8n-nodes-base.aggregate",
"position": [
848,
64
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "path"
}
]
}
},
"typeVersion": 1
},
{
"id": "c3403ea4-1a73-47ea-9df1-7db309dc6c2c",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
848,
352
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2cf86146-b19c-4f32-8d46-d866fc11c320",
"operator": {
"type": "array",
"operation": "contains",
"rightType": "any"
},
"leftValue": "={{ $('Aggregate').item.json.path }}",
"rightValue": "={{ $('Edit Fields').item.json.file_name }}"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "be043fd5-e728-471c-8a06-ed4fbd815035",
"operator": {
"type": "array",
"operation": "notContains",
"rightType": "any"
},
"leftValue": "={{ $('Aggregate').item.json.path }}",
"rightValue": "={{ $('Edit Fields').item.json.file_name }}"
}
]
}
}
]
},
"options": {}
},
"typeVersion": 3.3
},
{
"id": "e6721494-2063-4ae8-8736-bbcd3b0bc967",
"name": "Edit a file",
"type": "n8n-nodes-base.github",
"position": [
960,
608
],
"webhookId": "0c6f49d9-0eb4-4c45-a86c-e1d9bf203d38",
"parameters": {
"owner": {
"__rl": true,
"mode": "list",
"value": "njogued",
"cachedResultUrl": "https://github.com/njogued",
"cachedResultName": "njogued"
},
"filePath": "={{ $('Edit Fields').item.json.file_name }}",
"resource": "file",
"operation": "edit",
"repository": {
"__rl": true,
"mode": "list",
"value": "automation",
"cachedResultUrl": "https://github.com/njogued/automation",
"cachedResultName": "automation"
},
"fileContent": "={{ JSON.stringify($('Get many workflows').item.json, null, 2) }}",
"commitMessage": "={{ $('Message a model').item.json.output[0].content[0].text.commit_message }}"
},
"credentials": {
"githubApi": {
"id": "95qFLriSOUXwIi39",
"name": "GitHub account"
}
},
"typeVersion": 1.1
},
{
"id": "033be4cf-ce15-47d0-b09a-d9cbe41d6f6c",
"name": "Get a file",
"type": "n8n-nodes-base.github",
"position": [
1152,
336
],
"webhookId": "3040be33-3e0b-47d7-aabe-49814827f32c",
"parameters": {
"owner": {
"__rl": true,
"mode": "list",
"value": "njogued",
"cachedResultUrl": "https://github.com/njogued",
"cachedResultName": "njogued"
},
"filePath": "={{ $('Edit Fields').item.json.file_name }}",
"resource": "file",
"operation": "get",
"repository": {
"__rl": true,
"mode": "list",
"value": "automation",
"cachedResultUrl": "https://github.com/njogued/automation",
"cachedResultName": "automation"
},
"additionalParameters": {}
},
"credentials": {
"githubApi": {
"id": "95qFLriSOUXwIi39",
"name": "GitHub account"
}
},
"typeVersion": 1.1
},
{
"id": "ba2905c2-9aa0-4433-96bf-7986f24ff70e",
"name": "Extract from File",
"type": "n8n-nodes-base.extractFromFile",
"position": [
192,
608
],
"parameters": {
"options": {},
"operation": "fromJson"
},
"typeVersion": 1
},
{
"id": "55f64f11-4993-44ea-82ff-1e37263bcdb7",
"name": "Message a model1",
"type": "@n8n/n8n-nodes-langchain.openAi",
"maxTries": 5,
"position": [
192,
848
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini",
"cachedResultName": "GPT-4.1-MINI"
},
"options": {
"textFormat": {
"textOptions": {
"type": "json_schema",
"schema": "{\n \"type\": \"object\",\n \"properties\": {\n \"commit_message\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\"commit_message\"]\n}"
}
}
},
"responses": {
"values": [
{
"content": "=Extract this n8n workflow and prepare a short commit message related the automation.\n\nWorkflow Name: {{ $('Filter').item.json.name }}\n\nWorkflow: {{ $('Get many workflows').item.json.nodes.toJsonString() }}"
}
]
},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"id": "tjf9ytf3xLEqDCRr",
"name": "OpenAi account"
}
},
"retryOnFail": true,
"typeVersion": 2,
"waitBetweenTries": 5000
},
{
"id": "c2621b12-40e3-47cb-b6f2-bdc6a39a6023",
"name": "Get many workflows",
"type": "n8n-nodes-base.n8n",
"position": [
1136,
64
],
"parameters": {
"filters": {},
"requestOptions": {}
},
"credentials": {
"n8nApi": {
"id": "O5eUF4InQFmNoPB5",
"name": "n8n account"
}
},
"typeVersion": 1
},
{
"id": "8fc3f8f9-4cc6-4ede-ad42-3f4529eb3cf2",
"name": "Filter",
"type": "n8n-nodes-base.filter",
"position": [
192,
352
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "4886fde7-a356-4b96-b508-1269f12d8902",
"operator": {
"type": "dateTime",
"operation": "afterOrEquals"
},
"leftValue": "={{ $json.updatedAt }}",
"rightValue": "={{ $('Schedule Trigger').item.json.timestamp.toDateTime().minus(4, 'hours') }}"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "27f5f198-3272-42c3-a2e7-399f3cebb987",
"name": "Create a file1",
"type": "n8n-nodes-base.github",
"onError": "continueRegularOutput",
"position": [
1200,
2176
],
"webhookId": "af1a453b-db41-4a8f-baa9-95b28849c06e",
"parameters": {
"owner": {
"__rl": true,
"mode": "name",
"value": "njogued"
},
"filePath": "={{ $('Edit Fields1').item.json.file_name }}",
"resource": "file",
"repository": {
"__rl": true,
"mode": "list",
"value": "automation",
"cachedResultUrl": "https://github.com/njogued/automation",
"cachedResultName": "automation"
},
"fileContent": "={{ JSON.stringify($('Get many workflows1').item.json, null, 2) }}",
"commitMessage": "={{ $json.output[0].content[0].text.commit_message }}"
},
"credentials": {
"githubApi": {
"id": "95qFLriSOUXwIi39",
"name": "GitHub account"
}
},
"typeVersion": 1.1
},
{
"id": "326ae4c6-457e-407b-bd2d-736d3852b199",
"name": "Edit Fields1",
"type": "n8n-nodes-base.set",
"position": [
192,
1664
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "22311fda-25e7-4585-b07e-e60e14a4b812",
"name": "file_name",
"type": "string",
"value": "=n8n/{{ $json.name.replaceAll(' ','_') }}.json"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "87c4e234-e8fa-4ba6-b866-300f8a64cc12",
"name": "List files1",
"type": "n8n-nodes-base.github",
"position": [
544,
1376
],
"webhookId": "1c17a39c-7667-4705-bf7c-a4dd7983f02e",
"parameters": {
"owner": {
"__rl": true,
"mode": "list",
"value": "njogued",
"cachedResultUrl": "https://github.com/njogued",
"cachedResultName": "njogued"
},
"filePath": "n8n",
"resource": "file",
"operation": "list",
"repository": {
"__rl": true,
"mode": "list",
"value": "automation",
"cachedResultUrl": "https://github.com/njogued/automation",
"cachedResultName": "automation"
}
},
"credentials": {
"githubApi": {
"id": "95qFLriSOUXwIi39",
"name": "GitHub account"
}
},
"typeVersion": 1.1
},
{
"id": "8a5ea247-2507-4ac2-adb5-47e9a6951139",
"name": "Aggregate1",
"type": "n8n-nodes-base.aggregate",
"position": [
864,
1376
],
"parameters": {
"options": {},
"fieldsToAggregate": {
"fieldToAggregate": [
{
"fieldToAggregate": "path"
}
]
}
},
"typeVersion": 1
},
{
"id": "bf094d19-7d25-4f5c-8563-52968bb62c98",
"name": "Switch1",
"type": "n8n-nodes-base.switch",
"position": [
544,
1664
],
"parameters": {
"rules": {
"values": [
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2cf86146-b19c-4f32-8d46-d866fc11c320",
"operator": {
"type": "array",
"operation": "contains",
"rightType": "any"
},
"leftValue": "={{ $('Aggregate1').item.json.path }}",
"rightValue": "={{ $('Edit Fields1').item.json.file_name }}"
}
]
}
},
{
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "be043fd5-e728-471c-8a06-ed4fbd815035",
"operator": {
"type": "array",
"operation": "notContains",
"rightType": "any"
},
"leftValue": "={{ $('Aggregate1').item.json.path }}",
"rightValue": "={{ $('Edit Fields1').item.json.file_name }}"
}
]
}
}
]
},
"options": {}
},
"typeVersion": 3.3
},
{
"id": "25c56de7-787a-44ec-aca2-651113a003e7",
"name": "Get a file1",
"type": "n8n-nodes-base.github",
"position": [
880,
1648
],
"webhookId": "3040be33-3e0b-47d7-aabe-49814827f32c",
"parameters": {
"owner": {
"__rl": true,
"mode": "list",
"value": "njogued",
"cachedResultUrl": "https://github.com/njogued",
"cachedResultName": "njogued"
},
"filePath": "={{ $('Edit Fields1').item.json.file_name }}",
"resource": "file",
"operation": "get",
"repository": {
"__rl": true,
"mode": "list",
"value": "automation",
"cachedResultUrl": "https://github.com/njogued/automation",
"cachedResultName": "automation"
},
"additionalParameters": {}
},
"credentials": {
"githubApi": {
"id": "95qFLriSOUXwIi39",
"name": "GitHub account"
}
},
"typeVersion": 1.1
},
{
"id": "eb91b6c4-18cc-4789-8745-4fe0d123e75e",
"name": "Message a model3",
"type": "@n8n/n8n-nodes-langchain.openAi",
"maxTries": 5,
"position": [
208,
2176
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini",
"cachedResultName": "GPT-4.1-MINI"
},
"options": {
"textFormat": {
"textOptions": {
"type": "json_schema",
"schema": "{\n \"type\": \"object\",\n \"properties\": {\n \"commit_message\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\"commit_message\"]\n}"
}
}
},
"responses": {
"values": [
{
"content": "=Extract this n8n workflow and prepare a short commit message related the automation.\n\nWorkflow Name: {{ $('Get many workflows1').item.json.name }}\n\nWorkflow: {{ $('Get many workflows1').item.json.nodes.toJsonString() }}"
}
]
},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"id": "tjf9ytf3xLEqDCRr",
"name": "OpenAi account"
}
},
"retryOnFail": true,
"typeVersion": 2,
"waitBetweenTries": 5000
},
{
"id": "d4d25d30-96fb-453e-9391-e571ad49bd2a",
"name": "Get many workflows1",
"type": "n8n-nodes-base.n8n",
"position": [
1152,
1376
],
"parameters": {
"filters": {},
"requestOptions": {}
},
"credentials": {
"n8nApi": {
"id": "O5eUF4InQFmNoPB5",
"name": "n8n account"
}
},
"typeVersion": 1
},
{
"id": "320cac2f-e904-449a-884b-1535663234dc",
"name": "When clicking ‘Execute workflow’",
"type": "n8n-nodes-base.manualTrigger",
"position": [
192,
1376
],
"parameters": {},
"typeVersion": 1
},
{
"id": "29d4f1c9-f6fb-486b-af3a-eaf632be0453",
"name": "Edit a file1",
"type": "n8n-nodes-base.github",
"position": [
1200,
1920
],
"webhookId": "0c6f49d9-0eb4-4c45-a86c-e1d9bf203d38",
"parameters": {
"owner": {
"__rl": true,
"mode": "list",
"value": "njogued",
"cachedResultUrl": "https://github.com/njogued",
"cachedResultName": "njogued"
},
"filePath": "={{ $('Edit Fields1').item.json.file_name }}",
"resource": "file",
"operation": "edit",
"repository": {
"__rl": true,
"mode": "list",
"value": "automation",
"cachedResultUrl": "https://github.com/njogued/automation",
"cachedResultName": "automation"
},
"fileContent": "={{ JSON.stringify($('Get many workflows1').item.json, null, 2) }}",
"commitMessage": "={{ $('Message a model2').item.json.output[0].content[0].text.commit_message }}"
},
"credentials": {
"githubApi": {
"id": "95qFLriSOUXwIi39",
"name": "GitHub account"
}
},
"typeVersion": 1.1
},
{
"id": "4dd2c29e-d060-4f9d-81f8-6bdf10db3a2f",
"name": "Message a model2",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
208,
1920
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini",
"cachedResultName": "GPT-4.1-MINI"
},
"options": {
"textFormat": {
"textOptions": {
"type": "json_schema",
"schema": "{\n \"type\": \"object\",\n \"properties\": {\n \"commit_message\": {\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\"commit_message\"]\n}"
}
}
},
"responses": {
"values": [
{
"content": "=#TASK\n\nI would like you to prepare a short commit message related the automation below. There is older version and an updated version of the automation. I would like you to identify the differences/updates made to the automation by comparing differences in the Old and Updated versions, then use that comparison to write the commit message to add the Updated Workflow into Github.\n\nWorkflow Name: {{ $('Get many workflows1').item.json.name }}\n\n## UPDATED WORKFLOW\n{{ $('Get many workflows1').item.json.nodes.toJsonString() }}\n\n## OLD WORKFLOW\n{{ $json.data.nodes.toJsonString() }}"
}
]
},
"builtInTools": {}
},
"credentials": {
"openAiApi": {
"id": "tjf9ytf3xLEqDCRr",
"name": "OpenAi account"
}
},
"typeVersion": 2
},
{
"id": "55fbc447-4195-4d0f-adff-ea266ab3e13d",
"name": "Extract from File1",
"type": "n8n-nodes-base.extractFromFile",
"position": [
1168,
1648
],
"parameters": {
"options": {},
"operation": "fromJson"
},
"typeVersion": 1
},
{
"id": "6989444d-8acc-411f-ace4-8f57e4f14e1b",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
48,
1232
],
"parameters": {
"color": 6,
"width": 1312,
"height": 1152,
"content": "## First Time\n* Run this to send all your workflows to Github. \n* Update Github parameters to get started"
},
"typeVersion": 1
},
{
"id": "d68e397b-b0f8-488b-a30d-8311cfa05b2a",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
48,
-80
],
"parameters": {
"color": 3,
"width": 1296,
"height": 1136,
"content": "## Periodic Workflows\n* Runs with defined intervals (currently set to 4 hours) and makes any changes to Github files\n* Does not delete files, just updates existing ones or creates new ones"
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Filter": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Switch": {
"main": [
[
{
"node": "Get a file",
"type": "main",
"index": 0
}
],
[
{
"node": "Message a model1",
"type": "main",
"index": 0
}
]
]
},
"Switch1": {
"main": [
[
{
"node": "Get a file1",
"type": "main",
"index": 0
}
],
[
{
"node": "Message a model3",
"type": "main",
"index": 0
}
]
]
},
"Aggregate": {
"main": [
[
{
"node": "Get many workflows",
"type": "main",
"index": 0
}
]
]
},
"Aggregate1": {
"main": [
[
{
"node": "Get many workflows1",
"type": "main",
"index": 0
}
]
]
},
"Get a file": {
"main": [
[
{
"node": "Extract from File",
"type": "main",
"index": 0
}
]
]
},
"List files": {
"main": [
[
{
"node": "Aggregate",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"Get a file1": {
"main": [
[
{
"node": "Extract from File1",
"type": "main",
"index": 0
}
]
]
},
"List files1": {
"main": [
[
{
"node": "Aggregate1",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields1": {
"main": [
[
{
"node": "Switch1",
"type": "main",
"index": 0
}
]
]
},
"Message a model": {
"main": [
[
{
"node": "Edit a file",
"type": "main",
"index": 0
}
]
]
},
"Message a model1": {
"main": [
[
{
"node": "Create a file",
"type": "main",
"index": 0
}
]
]
},
"Message a model2": {
"main": [
[
{
"node": "Edit a file1",
"type": "main",
"index": 0
}
]
]
},
"Message a model3": {
"main": [
[
{
"node": "Create a file1",
"type": "main",
"index": 0
}
]
]
},
"Schedule Trigger": {
"main": [
[
{
"node": "List files",
"type": "main",
"index": 0
}
]
]
},
"Extract from File": {
"main": [
[
{
"node": "Message a model",
"type": "main",
"index": 0
}
]
]
},
"Extract from File1": {
"main": [
[
{
"node": "Message a model2",
"type": "main",
"index": 0
}
]
]
},
"Get many workflows": {
"main": [
[
{
"node": "Filter",
"type": "main",
"index": 0
}
]
]
},
"Get many workflows1": {
"main": [
[
{
"node": "Edit Fields1",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Execute workflow’": {
"main": [
[
{
"node": "List files1",
"type": "main",
"index": 0
}
]
]
}
}
}