从 GitHub 恢复凭据
中级
这是一个Other领域的自动化工作流,包含 11 个节点。主要使用 If, N8n, Set, Github, SplitOut 等节点。 从GitHub恢复您的凭据
前置要求
- •GitHub Personal Access Token
- •可能需要目标 API 的认证凭证
分类
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "7zRCNv7B5WFRg7ux",
"meta": {
"instanceId": "e634e668fe1fc93a75c4f2a7fc0dad807ca318b79654157eadb9578496acbc76"
},
"name": "从 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": "当点击\"测试工作流\"时",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-640,
-120
],
"parameters": {},
"typeVersion": 1
},
{
"id": "f838e0c6-36aa-4c0b-bdd2-ef096ffd3d1d",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1020,
-140
],
"parameters": {
"width": 320,
"height": 420,
"content": "## 从 GitHub 恢复"
},
"typeVersion": 1
},
{
"id": "8f59b7b0-ea9d-4209-8c6b-d48fe9d8cf7b",
"name": "全局变量",
"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": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-440,
-240
],
"parameters": {
"color": 4,
"width": 150,
"height": 80,
"content": "## 编辑此节点 👇"
},
"typeVersion": 1
},
{
"id": "4eeb0ed5-7e90-4f09-8296-04c0349de49b",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
100,
20
],
"parameters": {
"color": 4,
"content": "## 跳过凭据"
},
"typeVersion": 1
},
{
"id": "40856ade-3ff7-43ef-8c45-ec5a126a5787",
"name": "获取指定路径中的所有文件",
"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": {
"id": "3FYHiPFtycAFT8V0",
"name": "GitHub account"
}
},
"typeVersion": 4.2
},
{
"id": "4284aadd-4840-4754-9416-6bb74a1df192",
"name": "拆分结果",
"type": "n8n-nodes-base.splitOut",
"position": [
-600,
200
],
"parameters": {
"options": {},
"fieldToSplitOut": "path"
},
"typeVersion": 1
},
{
"id": "48a04e72-5f9e-4dc3-863d-a8bb30f1c8c2",
"name": "从 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": {
"id": "3FYHiPFtycAFT8V0",
"name": "GitHub account"
}
},
"typeVersion": 1,
"alwaysOutputData": true
},
{
"id": "507c8514-6acf-4568-83cc-bb07f06e6a96",
"name": "将文件转换为 JSON",
"type": "n8n-nodes-base.extractFromFile",
"position": [
-140,
200
],
"parameters": {
"options": {},
"operation": "fromJson"
},
"typeVersion": 1
},
{
"id": "084e7306-4c7b-4a9b-8f3e-f844ab340f6a",
"name": "恢复 n8n 凭据",
"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": {
"id": "dzYjDgtEXtpRPKhe",
"name": "n8n account"
}
},
"typeVersion": 1
},
{
"id": "f8267df1-eb0a-491e-bed4-01480583a535",
"name": "检查跳过的凭据",
"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,
"pinData": {},
"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 ‘Test workflow’": {
"main": [
[
{
"node": "Globals",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 其他
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
从GitHub恢复您的工作流
从GitHub恢复您的工作流
N8n
Set
Github
+5
9 节点bangank36
其他
将Shopify所有订单获取到Google表格
将Shopify所有订单获取到Google表格
If
Set
Code
+6
11 节点bangank36
其他
同步 Shopify 客户到 Google Sheets + Squarespace 兼容 CSV
将 Shopify 客户数据同步到 Google Sheets 并生成 Squarespace 兼容的 CSV
If
Set
Code
+7
13 节点bangank36
销售
Squarespace 订单自动履行流程
Squarespace 订单自动履行流程
Set
Filter
Split Out
+5
12 节点bangank36
销售
INST安装程序
打包部署多个n8n工作流 - 含自动凭证映射
If
N8n
Set
+12
31 节点Wyeth
开发运维
Clockify 备份模板
基于月度报告将 Clockify 备份到 Github
If
Set
Filter
+9
21 节点Mario
其他
工作流信息
难度等级
中级
节点数量11
分类1
节点类型9
作者
bangank36
@bangank36Automation specialist with 10+ years of experience helping SME website owners streamline their workflows—specializing in Squarespace, Shopify, and WordPress. Book an initial consultation for custom n8n automation using my link.
外部链接
在 n8n.io 查看 →
分享此工作流