AutomationFlowsData & Sheets › Restore n8n Credentials from GitHub

Restore n8n Credentials from GitHub

Original n8n title: Restore Your Credentials From Github

Restore your credentials from GitHub. Uses manualTrigger, stickyNote, httpRequest, splitOut. Event-driven trigger; 11 nodes.

Event trigger★★★★☆ complexity11 nodesHTTP RequestGitHubn8n
Data & Sheets Trigger: Event Nodes: 11 Complexity: ★★★★☆ Added:

This workflow follows the GitHub → HTTP Request recipe pattern — see all workflows that pair these two integrations.

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
{
  "id": "7zRCNv7B5WFRg7ux",
  "name": "Restore your credentials from GitHub",
  "tags": [
    {
      "id": "2RWIfLUVCa0bnmGX",
      "name": "N8n",
      "createdAt": "2025-03-06T09:58:39.214Z",
      "updatedAt": "2025-03-06T09:58:39.214Z"
    }
  ],
  "nodes": [
    {
      "id": "f8aff38c-3e40-4820-b8f5-50e3e1f878c8",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -640,
        -120
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f838e0c6-36aa-4c0b-bdd2-ef096ffd3d1d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1020,
        -140
      ],
      "parameters": {
        "width": 320,
        "height": 420,
        "content": "## Restore from GitHub \nThis workflow will restore all instance credentials from GitHub backups.\n\n\n### Setup\nOpen `Globals` node and update the values below \ud83d\udc47\n\n- **repo.owner:** your Github username\n- **repo.name:** the name of your repository\n- **repo.path:** the folder to use within the repository.\n\n\nIf your username was `john-doe` and your repository was called `n8n-backups` and you wanted the credentials to go into a `credentials` folder you would set:\n\n- repo.owner - john-doe\n- repo.name - n8n-backups\n- repo.path - credentials/\n"
      },
      "typeVersion": 1
    },
    {
      "id": "8f59b7b0-ea9d-4209-8c6b-d48fe9d8cf7b",
      "name": "Globals",
      "type": "n8n-nodes-base.set",
      "position": [
        -380,
        -120
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "6cf546c5-5737-4dbd-851b-17d68e0a3780",
              "name": "repo.owner",
              "type": "string",
              "value": "BeyondspaceStudio"
            },
            {
              "id": "452efa28-2dc6-4ea3-a7a2-c35d100d0382",
              "name": "repo.name",
              "type": "string",
              "value": "n8n-backup"
            },
            {
              "id": "81c4dc54-86bf-4432-a23f-22c7ea831e74",
              "name": "repo.path",
              "type": "string",
              "value": "credentials"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d72bf1a6-f3a0-4dc0-afc0-e39c7e8b16f3",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -440,
        -240
      ],
      "parameters": {
        "color": 4,
        "width": 150,
        "height": 80,
        "content": "## Edit this node \ud83d\udc47"
      },
      "typeVersion": 1
    },
    {
      "id": "4eeb0ed5-7e90-4f09-8296-04c0349de49b",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        100,
        20
      ],
      "parameters": {
        "color": 4,
        "content": "## Skip credential\n- The empty json files\n- The n8n account api\n- ...edit this node at will"
      },
      "typeVersion": 1
    },
    {
      "id": "40856ade-3ff7-43ef-8c45-ec5a126a5787",
      "name": "Get all files in given path",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -160,
        -120
      ],
      "parameters": {
        "url": "=https://api.github.com/repos/{{ $json.repo.owner }}/{{ $json.repo.name }}/contents/{{ $json.repo.path }}",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "githubApi"
      },
      "credentials": {
        "githubApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "4284aadd-4840-4754-9416-6bb74a1df192",
      "name": "Split the result",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -600,
        200
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "path"
      },
      "typeVersion": 1
    },
    {
      "id": "48a04e72-5f9e-4dc3-863d-a8bb30f1c8c2",
      "name": "Get file content from GitHub",
      "type": "n8n-nodes-base.github",
      "position": [
        -360,
        200
      ],
      "parameters": {
        "owner": {
          "__rl": true,
          "mode": "name",
          "value": "BeyondspaceStudio"
        },
        "filePath": "={{ $('Get all files in given path').item.json.path }}",
        "resource": "file",
        "operation": "get",
        "repository": {
          "__rl": true,
          "mode": "name",
          "value": "n8n-backup"
        },
        "additionalParameters": {}
      },
      "credentials": {
        "githubApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1,
      "alwaysOutputData": true
    },
    {
      "id": "507c8514-6acf-4568-83cc-bb07f06e6a96",
      "name": "Convert files to JSON",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -140,
        200
      ],
      "parameters": {
        "options": {},
        "operation": "fromJson"
      },
      "typeVersion": 1
    },
    {
      "id": "084e7306-4c7b-4a9b-8f3e-f844ab340f6a",
      "name": "Restore n8n Credentials",
      "type": "n8n-nodes-base.n8n",
      "position": [
        380,
        200
      ],
      "parameters": {
        "data": "={{ JSON.stringify($json.data.data) }}",
        "name": "={{ $json.data.name }}",
        "resource": "credential",
        "requestOptions": {},
        "credentialTypeName": "={{ $json.data.type }}"
      },
      "credentials": {
        "n8nApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f8267df1-eb0a-491e-bed4-01480583a535",
      "name": "Check for skipped Credentials",
      "type": "n8n-nodes-base.if",
      "position": [
        100,
        200
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "ad031296-4ac0-4087-bc35-7975a2cc25e6",
              "operator": {
                "type": "object",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json.data }}",
              "rightValue": ""
            },
            {
              "id": "ca912a57-6a4b-4b9a-be0e-37b69d3e4917",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.data.name }}",
              "rightValue": "n8n account"
            }
          ]
        }
      },
      "typeVersion": 2.2
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8a89a054-697f-4705-89a8-5d3288936206",
  "connections": {
    "Globals": {
      "main": [
        [
          {
            "node": "Get all files in given path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split the result": {
      "main": [
        [
          {
            "node": "Get file content from GitHub",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert files to JSON": {
      "main": [
        [
          {
            "node": "Check for skipped Credentials",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all files in given path": {
      "main": [
        [
          {
            "node": "Split the result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get file content from GitHub": {
      "main": [
        [
          {
            "node": "Convert files to JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for skipped Credentials": {
      "main": [
        [],
        [
          {
            "node": "Restore n8n Credentials",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Globals",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

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

How this works

Quickly recover lost API credentials or configuration files by pulling them directly from your GitHub repository, saving hours of manual recreation and reducing errors in your automation setups. This workflow suits developers and ops teams who version-control sensitive data in encrypted form within private repos, ensuring secure access without exposing keys. The key step involves using the GitHub node to fetch and decode the specific file contents after an event trigger, seamlessly integrating with n8n's HTTP requests for path navigation.

Use this workflow when you've accidentally deleted credentials in n8n or need to sync them across environments during deployments, especially for event-driven restores. Avoid it for highly sensitive production secrets better managed via dedicated vaults like AWS Secrets Manager, or if your repo lacks proper encryption. Common variations include adapting it to restore from other Git providers or chaining it with email notifications for audit trails.

About this workflow

Restore your credentials from GitHub. Uses manualTrigger, stickyNote, httpRequest, splitOut. Event-driven trigger; 11 nodes.

Source: https://github.com/Zie619/n8n-workflows — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

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

Data & Sheets

Restore your workflows from GitHub. Uses manualTrigger, stickyNote, httpRequest, splitOut. Event-driven trigger; 9 nodes.

HTTP Request, GitHub, n8n
Data & Sheets

Workflow Importer. Uses extractFromFile, executeCommand, readWriteFile, httpRequest. Event-driven trigger; 58 nodes.

Execute Command, Read Write File, HTTP Request +3
Data & Sheets

Retrieves workflows directly from an n8n instance using the n8n API Dynamically generates a form to select which workflows to import Supports both fixed instance configuration and dynamic source/targe

Form Trigger, Form, Notion +2
Data & Sheets

Splitout Limit. Uses httpRequest, splitOut, removeDuplicates, splitInBatches. Event-driven trigger; 40 nodes.

HTTP Request, n8n, Form Trigger +1
Data & Sheets

Clone n8n Workflows between Instances using n8n API. Uses manualTrigger, n8n, httpRequest, splitInBatches. Event-driven trigger; 17 nodes.

n8n, HTTP Request