AutomationFlowsDevOps › Github

Github

github. Uses github, itemLists, n8n, moveBinaryData. Event-driven trigger; 18 nodes.

Event trigger★★★★☆ complexity18 nodesGitHubItem Listsn8nMove Binary Data
DevOps Trigger: Event Nodes: 18 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "updatedAt": "2025-12-14T17:07:46.000Z",
  "createdAt": "2025-12-14T16:27:32.148Z",
  "id": "4yjVDXXeLFkPGIqP",
  "name": "github",
  "active": false,
  "isArchived": false,
  "nodes": [
    {
      "parameters": {},
      "id": "67466d2c-77f3-4d98-b9e4-1f6fa10d968e",
      "name": "Execute workflow",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        48,
        416
      ]
    },
    {
      "parameters": {
        "options": {}
      },
      "id": "e5942837-328e-4049-92c4-5851d2ddfbe9",
      "name": "Set date",
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 2,
      "position": [
        240,
        416
      ]
    },
    {
      "parameters": {
        "operation": "formatDate",
        "date": "={{ $json.currentDate }}",
        "format": "custom",
        "customFormat": "dd-MM-yyyy/H:mm",
        "options": {}
      },
      "id": "de6ef028-03e6-4447-9997-af1b4b8b8184",
      "name": "Format date",
      "type": "n8n-nodes-base.dateTime",
      "typeVersion": 2,
      "position": [
        448,
        416
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "commitDate",
              "value": "={{ $json.formattedDate }}"
            }
          ]
        },
        "options": {}
      },
      "id": "ab873041-98c1-456b-a4a3-6235e46ced7a",
      "name": "Set commit date",
      "type": "n8n-nodes-base.set",
      "typeVersion": 2,
      "position": [
        640,
        416
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "file",
        "operation": "list",
        "owner": {
          "__rl": true,
          "value": "https://github.com/vignesh-potharaj",
          "mode": "url"
        },
        "repository": {
          "__rl": true,
          "value": "n8n",
          "mode": "list",
          "cachedResultName": "n8n",
          "cachedResultUrl": "https://github.com/vignesh-potharaj/n8n"
        },
        "filePath": "="
      },
      "id": "773477fc-f803-42d8-9166-2fd41f0843b6",
      "name": "List files from repository [GITHUB]",
      "type": "n8n-nodes-base.github",
      "typeVersion": 1,
      "position": [
        848,
        416
      ],
      "alwaysOutputData": true,
      "credentials": {
        "githubOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "aggregateItems",
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "name"
            }
          ]
        },
        "options": {}
      },
      "id": "ad0ff2dc-708c-49cd-97d7-01a93bc25a5a",
      "name": "Combine file names [GITHUB]",
      "type": "n8n-nodes-base.itemLists",
      "typeVersion": 2.1,
      "position": [
        1040,
        416
      ]
    },
    {
      "parameters": {
        "filters": {},
        "requestOptions": {}
      },
      "id": "8d7dbd42-6181-43d2-bb9b-078663926da5",
      "name": "Retrieve workflows [N8N]",
      "type": "n8n-nodes-base.n8n",
      "typeVersion": 1,
      "position": [
        1248,
        416
      ],
      "credentials": {
        "n8nApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "mode": "jsonToBinary",
        "options": {
          "fileName": "={{ $json.name.replace(/\\s+/g, '-').toLowerCase() }}-{{ $json.id }}.json"
        }
      },
      "id": "40b3d6b9-a34f-426d-949d-de07c48909d8",
      "name": "Move JSON to binary",
      "type": "n8n-nodes-base.moveBinaryData",
      "typeVersion": 1,
      "position": [
        1440,
        416
      ]
    },
    {
      "parameters": {
        "batchSize": 1,
        "options": {}
      },
      "id": "1cb756d7-077e-4abb-a55a-bf0e067f6c20",
      "name": "Split to single items",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 2,
      "position": [
        1680,
        416
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $node['Combine file names [GITHUB]'].json.name }}",
              "operation": "contains",
              "value2": "={{ $binary.data.fileName }}"
            }
          ]
        }
      },
      "id": "af2de69d-209a-4d5e-9e87-26e0efdc9e50",
      "name": "Check if file exists in repository",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1920,
        336
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "file",
        "operation": "edit",
        "owner": {
          "__rl": true,
          "value": "https://github.com/vignesh-potharaj",
          "mode": "url"
        },
        "repository": {
          "__rl": true,
          "value": "n8n",
          "mode": "list",
          "cachedResultName": "n8n",
          "cachedResultUrl": "https://github.com/vignesh-potharaj/n8n"
        },
        "filePath": "={{ $binary.data.fileName }}",
        "binaryData": true,
        "commitMessage": "=backup-{{ $node['Set commit date'].json.commitDate }}"
      },
      "id": "78f7d684-c16e-459e-9d2d-1d14f2d9a759",
      "name": "Update file [GITHUB]",
      "type": "n8n-nodes-base.github",
      "typeVersion": 1,
      "position": [
        2144,
        144
      ],
      "credentials": {
        "githubOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "resource": "file",
        "owner": {
          "__rl": true,
          "value": "https://github.com/vignesh-potharaj",
          "mode": "url"
        },
        "repository": {
          "__rl": true,
          "value": "n8n",
          "mode": "list",
          "cachedResultName": "n8n",
          "cachedResultUrl": "https://github.com/vignesh-potharaj/n8n"
        },
        "filePath": "={{ $binary.data.fileName }}",
        "binaryData": true,
        "commitMessage": "=backup-{{ $node['Set commit date'].json.commitDate }}"
      },
      "id": "b419ab0b-d870-49a4-bcb5-c216a586ebcd",
      "name": "Upload file [GITHUB]",
      "type": "n8n-nodes-base.github",
      "typeVersion": 1,
      "position": [
        2144,
        544
      ],
      "credentials": {
        "githubOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "## Trigger\nYou can change it to [\"Schedule\" trigger](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.scheduletrigger/) to make backups on regular basis.",
        "height": 339.51767272727324,
        "width": 182.4715262478496
      },
      "id": "ceae67c1-5d52-438f-934f-bfa84060f18e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        256
      ]
    },
    {
      "parameters": {
        "content": "## Set and format date/time\nThose nodes are responsible for setting a current date and time in format `dd-MM-yyyy/H:mm`. Date and time are used to compose commit messages in GitHub, for example: `backup-12-07-2023/14:18`.",
        "height": 339.42690909090965,
        "width": 585.4045090909088
      },
      "id": "ab454265-a9cb-4e40-9bd7-3f77ef297562",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        208,
        256
      ]
    },
    {
      "parameters": {
        "content": "## Make a list of existing files\nReturn a list of existing files (backups) in GitHub repository. Data returned by those nodes is used by \"IF\" node (later in workflow) to check whether the backup files should be created or updated.",
        "height": 339.42690909090965,
        "width": 389.89265454545443
      },
      "id": "64501ccc-976e-4225-88d2-7cf7a27d316e",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        800,
        256
      ]
    },
    {
      "parameters": {
        "content": "## Retrieve workflows\nGet all workflows form your n8n instance. Remember that **your credentials need to point to the instance that you want to backup.**",
        "height": 339.42690909090965,
        "width": 384.14708363636373
      },
      "id": "df8aadf9-9fa9-4b71-ab56-aa25aa183bec",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1216,
        256
      ]
    },
    {
      "parameters": {
        "content": "## Upload backup\nSplit JSON files into batches of 1, check if they were uploaded to repository before. If yes (true), upload the new version of the file. Otherwise (false) create the file in repository.",
        "height": 731.633426614796,
        "width": 703.8733020263451
      },
      "id": "a9a708ed-1416-4be8-a982-0e15fd7ac357",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        1616,
        0
      ]
    },
    {
      "parameters": {
        "content": "## \u26a0\ufe0f Note\n\n1. Complete video guide for this workflow is available [on my YouTube](https://www.youtube.com/watch?v=dNuVuoPD0Jo). \n2. Remember to add your credentials and configure GitHub nodes (covered in the video guide).\n3. If you like this workflow, please subscribe to [my YouTube channel](https://www.youtube.com/@workfloows) and/or [my newsletter](https://workfloows.com/).\n\n**Thank you for your support!**",
        "height": 234.82946582693546,
        "width": 508.8662091091177
      },
      "id": "75ac5e3a-35f8-480a-a897-ff7f517af61e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    }
  ],
  "connections": {
    "Execute workflow": {
      "main": [
        [
          {
            "node": "Set date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set date": {
      "main": [
        [
          {
            "node": "Format date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format date": {
      "main": [
        [
          {
            "node": "Set commit date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set commit date": {
      "main": [
        [
          {
            "node": "List files from repository [GITHUB]",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List files from repository [GITHUB]": {
      "main": [
        [
          {
            "node": "Combine file names [GITHUB]",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine file names [GITHUB]": {
      "main": [
        [
          {
            "node": "Retrieve workflows [N8N]",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve workflows [N8N]": {
      "main": [
        [
          {
            "node": "Move JSON to binary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move JSON to binary": {
      "main": [
        [
          {
            "node": "Split to single items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split to single items": {
      "main": [
        [
          {
            "node": "Check if file exists in repository",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if file exists in repository": {
      "main": [
        [
          {
            "node": "Update file [GITHUB]",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload file [GITHUB]",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update file [GITHUB]": {
      "main": [
        [
          {
            "node": "Split to single items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file [GITHUB]": {
      "main": [
        [
          {
            "node": "Split to single items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "versionId": "4f5171f3-3475-4bb5-82f3-5bc6f9bb3691",
  "triggerCount": 0,
  "shared": [
    {
      "updatedAt": "2025-12-14T16:27:32.158Z",
      "createdAt": "2025-12-14T16:27:32.158Z",
      "role": "workflow:owner",
      "workflowId": "4yjVDXXeLFkPGIqP",
      "projectId": "U9gNtcfNPVWYu387"
    }
  ],
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

github. Uses github, itemLists, n8n, moveBinaryData. Event-driven trigger; 18 nodes.

Source: https://github.com/vignesh-potharaj/n8n/blob/330399d72a812fa7dadf18142cbd24ca02303fd1/workflows/github.json — original creator credit. Request a take-down →

More DevOps workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

DevOps

backup. Uses github, itemLists, moveBinaryData, n8n. Scheduled trigger; 17 nodes.

GitHub, Item Lists, Move Binary Data +1
DevOps

[bck-fluxos]. Uses github, itemLists, n8n, moveBinaryData. Scheduled trigger; 16 nodes.

GitHub, Item Lists, n8n +1
DevOps

Backup_Fluxos. Uses github, itemLists, n8n, moveBinaryData. Manual trigger; 11 nodes.

GitHub, Item Lists, n8n +1
DevOps

This template lets you selectively import n8n workflows from a GitHub repository, even when your repository uses deeply nested folder structures.

Form Trigger, GitHub, n8n +1
DevOps

Code Github. Uses manualTrigger, stickyNote, n8n, httpRequest. Event-driven trigger; 25 nodes.

n8n, HTTP Request, GitHub +1