通过API链接NocoDB记录🔗
这是一个Engineering领域的自动化工作流,包含 12 个节点。主要使用 Set, NocoDb, HttpRequest, ManualTrigger 等节点。 通过API链接NocoDB记录🔗
- •可能需要目标 API 的认证凭证
分类
{
"id": "2Pm4HYVtOrq8H0EK",
"meta": {
"instanceId": "bcc0fe85b176c2837affb21bb7d7397fad2549880e73dc1f7a42e76ae94fd996",
"templateCredsSetupCompleted": true
},
"name": "通过 API 链接 NocoDB 记录 🔗",
"tags": [
{
"id": "8AEG2zFZndeg1imh",
"name": "nocodb",
"createdAt": "2025-05-14T02:58:20.883Z",
"updatedAt": "2025-05-14T02:58:20.883Z"
},
{
"id": "Y3u7fuGgTL5xyaVG",
"name": "database db",
"createdAt": "2025-03-13T10:14:54.572Z",
"updatedAt": "2025-04-07T06:12:25.593Z"
}
],
"nodes": [
{
"id": "1285cb8b-45ab-4a87-9155-af8e06a195aa",
"name": "当点击“测试工作流”时",
"type": "n8n-nodes-base.manualTrigger",
"position": [
0,
0
],
"parameters": {},
"typeVersion": 1
},
{
"id": "1888e045-284f-4b1d-b3fd-8ddecc2d5bc2",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-320,
-140
],
"parameters": {
"color": 3,
"width": 260,
"height": 580,
"content": "# NocoDB 多对多链接记录"
},
"typeVersion": 1
},
{
"id": "6f9aac5b-e767-44bc-aba9-12b80500da78",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
380,
-460
],
"parameters": {
"width": 220,
"height": 620,
"content": "### 目标表"
},
"typeVersion": 1
},
{
"id": "6adaeec0-ab7b-4dca-8147-0801f0a215f8",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
600,
-120
],
"parameters": {
"width": 220,
"height": 280,
"content": "### 源表(多)"
},
"typeVersion": 1
},
{
"id": "8c028f2f-840c-4287-b6cc-fc6123eff6a7",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
1340,
-140
],
"parameters": {
"color": 3,
"width": 440,
"height": 440,
"content": "## 换句话说"
},
"typeVersion": 1
},
{
"id": "2d86e7fb-936d-4f4c-8d1d-c6e50fa90a38",
"name": "获取目标表行",
"type": "n8n-nodes-base.nocoDb",
"position": [
440,
0
],
"parameters": {
"id": "={{ $json.target_table_row_id }}",
"table": "mc5ihmltcqfco2v",
"projectId": "p82se8ug6ui5lt0",
"authentication": "nocoDbApiToken"
},
"credentials": {
"nocoDbApiToken": {
"id": "Lrr0RsBkym1lNmzu",
"name": "NocoDB Token account"
}
},
"typeVersion": 3
},
{
"id": "699ea454-8841-465b-90d7-d093c4086cff",
"name": "设置变量",
"type": "n8n-nodes-base.set",
"position": [
220,
0
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "9dd187fd-3957-4549-81ff-1d2190efd711",
"name": "my_nocodb",
"type": "string",
"value": "<Your NocoDB URL, example: nocodb.myserver.com>"
},
{
"id": "cc3e739a-d2ed-498c-bbc4-0f24b1134a87",
"name": "target_table_id",
"type": "string",
"value": "<the ID of TARGET Table, see Video>"
},
{
"id": "dcfdd5d4-4114-46b2-988a-2c10676ceae2",
"name": "target_table_row_id",
"type": "string",
"value": "<the Record-ID of TARGET Table that you want to link to, see Video, example: 5>"
},
{
"id": "e4962b5b-9c62-4c98-ab01-44f7142bf7e3",
"name": "source_table_row_id",
"type": "string",
"value": "<the Record-ID of SOURCE Table that you want to link from, see Video, example: 23>"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "a2c900e3-4515-4e9b-a99c-d62014f70c6c",
"name": "获取目标表元数据",
"type": "n8n-nodes-base.httpRequest",
"position": [
880,
0
],
"parameters": {
"url": "=https://{{ $('Set Variables').item.json.my_nocodb }}/api/v2/meta/tables/{{ $('Set Variables').item.json.target_table_id }}",
"options": {},
"sendHeaders": true,
"authentication": "predefinedCredentialType",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
}
]
},
"nodeCredentialType": "nocoDbApiToken"
},
"credentials": {
"nocoDbApiToken": {
"id": "Lrr0RsBkym1lNmzu",
"name": "NocoDB Token account"
}
},
"typeVersion": 4.2
},
{
"id": "ece698e5-29d1-493a-97d3-4ea66ef36e15",
"name": "获取源表行",
"type": "n8n-nodes-base.nocoDb",
"position": [
660,
0
],
"parameters": {
"id": "={{ $('Set Variables').item.json.source_table_row_id }}",
"table": "mm94d1xdbfrn1oe",
"projectId": "p82se8ug6ui5lt0",
"authentication": "nocoDbApiToken"
},
"credentials": {
"nocoDbApiToken": {
"id": "Lrr0RsBkym1lNmzu",
"name": "NocoDB Token account"
}
},
"typeVersion": 3
},
{
"id": "bf318290-c151-4eb0-944e-37b66cb69d8e",
"name": "将源记录链接到目标",
"type": "n8n-nodes-base.httpRequest",
"position": [
1100,
0
],
"parameters": {
"url": "=https://{{ $('Set Variables').item.json.my_nocodb }}/api/v2/tables/{{ $('Set Variables').item.json.target_table_id }}/links/{{ $('Get Target Table Meta Data').item.json.columns[11].id }}/records/{{ $('Grab Target Table Row').item.json['Record ID'] }}",
"method": "POST",
"options": {},
"jsonBody": "=[ { \"Id\": {{ $('Get Source Table Row').item.json['Record ID'] }} } ]",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "predefinedCredentialType",
"headerParameters": {
"parameters": [
{
"name": "accept",
"value": "application/json"
},
{
"name": "content-type",
"value": "application/json"
}
]
},
"nodeCredentialType": "nocoDbApiToken"
},
"credentials": {
"nocoDbApiToken": {
"id": "Lrr0RsBkym1lNmzu",
"name": "NocoDB Token account"
}
},
"typeVersion": 4.2
},
{
"id": "993d1c7c-c7fc-49af-b046-4a9a87351799",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
360,
280
],
"parameters": {
"color": 5,
"width": 560,
"height": 80,
"content": "## 视频指南:https://youtu.be/-srzNushUsk"
},
"typeVersion": 1
},
{
"id": "3eaf41c0-235f-4f29-82a4-d875d1dcb9d0",
"name": "便利贴5",
"type": "n8n-nodes-base.stickyNote",
"position": [
190,
-40
],
"parameters": {
"color": 2,
"width": 160,
"height": 200,
"content": "### 设置这些!"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "0c26a980-72d0-4c49-941a-8c555ca94b08",
"connections": {
"Set Variables": {
"main": [
[
{
"node": "Grab Target Table Row",
"type": "main",
"index": 0
}
]
]
},
"Get Source Table Row": {
"main": [
[
{
"node": "Get Target Table Meta Data",
"type": "main",
"index": 0
}
]
]
},
"Grab Target Table Row": {
"main": [
[
{
"node": "Get Source Table Row",
"type": "main",
"index": 0
}
]
]
},
"Get Target Table Meta Data": {
"main": [
[
{
"node": "Link Record from Source to Target",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Test workflow’": {
"main": [
[
{
"node": "Set Variables",
"type": "main",
"index": 0
}
]
]
}
}
}如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 工程
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
Max aka Mosheh
@aiwithapexMax is an IBM-certified AI developer with a BS in Computer Science and 20+ years in software, AI consulting, and leadership. He founded several modest ventures and serves as Board President of RedeemTheOppressed.org. Married with five children, he’s raised over $3.5M for persecuted minorities. Ventures: Motivate-Mate.com | | MusicWithMax.com | VoiceAIBonanza.com | ApexWebServices.com | HeimishGiving.org | ForAfricanJews.org | AI Automation community - https://www.skool.com/ai-with-apex/about
分享此工作流