8
n8n 中文网amn8n.com

将 Zendesk 知识库文章同步到 Airtable 并转换 Markdown

高级

这是一个Document Extraction领域的自动化工作流,包含 21 个节点。主要使用 Set, Airtable, Markdown, SplitOut, HttpRequest 等节点。 将 Zendesk 知识库文章同步到 Airtable 并转换 Markdown 格式

前置要求
  • Airtable API Key
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "f4f5d195bb2162a0972f737368404b18be694648d365d6c6771d7b4909d28167",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "d3490654-2438-4d56-95ef-95a7c49b58a0",
      "name": "点击\"执行工作流\"时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -100,
        0
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b555382d-1794-46aa-89b3-69c07e39a7d4",
      "name": "分离",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        920,
        240
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "articles"
      },
      "typeVersion": 1
    },
    {
      "id": "3d30de50-21ac-42f4-b8a3-84cc80d954c7",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -120,
        480
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "daysInterval": 30
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9beaf0bf-e3fb-4958-a355-50d91c58988c",
      "name": "设置要存储的字段",
      "type": "n8n-nodes-base.set",
      "position": [
        1140,
        240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "a8ea7db7-cc9c-47d1-b20b-061e04e4c2cb",
              "name": "id",
              "type": "number",
              "value": "={{ $json.id }}"
            },
            {
              "id": "9fd07686-f023-490f-98f1-fc579559be0d",
              "name": "url",
              "type": "string",
              "value": "={{ $json.url }}"
            },
            {
              "id": "09cf7488-d957-48c5-9f5d-fe5ea534ab12",
              "name": "title",
              "type": "string",
              "value": "={{ $json.title }}"
            },
            {
              "id": "d004df48-3e18-4c3e-a2ec-8ebb96d32927",
              "name": "body",
              "type": "string",
              "value": "={{ $json.body }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "fa14f526-72f3-4bf8-a892-3a7c1e13edcd",
      "name": "将 Zendesk 文章存储到 Airtable",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1720,
        240
      ],
      "parameters": {
        "base": {
          "__rl": true,
          "mode": "list",
          "value": "apptzJnbB6FphIprO",
          "cachedResultUrl": "https://airtable.com/apptzJnbB6FphIprO",
          "cachedResultName": "Zendesk KB"
        },
        "table": {
          "__rl": true,
          "mode": "list",
          "value": "tblaOi8NYGKPMvPof",
          "cachedResultUrl": "https://airtable.com/apptzJnbB6FphIprO/tblaOi8NYGKPMvPof",
          "cachedResultName": "Articles"
        },
        "columns": {
          "value": {
            "URL": "={{ $json.url }}",
            "Title": "={{ $json.title }}",
            "Content": "={{ $json.markdown }}",
            "Article ID": "={{ $json.id }}"
          },
          "schema": [
            {
              "id": "id",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "id",
              "defaultMatch": true
            },
            {
              "id": "Article ID",
              "type": "number",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Article ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Title",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Title",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Content",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "Content",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "URL",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": false,
              "required": false,
              "displayName": "URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Last Update",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Last Update",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Created At",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "Created At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Article ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "upsert"
      },
      "credentials": {
        "airtableTokenApi": {
          "id": "C8zNgAdz8w8ZVNqM",
          "name": "Airtable Agent Studio"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "e5cf0e34-4279-4596-845a-9debdb36fdcc",
      "name": "设置 base_url",
      "type": "n8n-nodes-base.set",
      "position": [
        140,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "10377b7b-b613-4e1c-a338-804e23c646a0",
              "name": "base_url",
              "type": "string",
              "value": "https://agentstudiohelp.zendesk.com"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3d7c2245-ed86-4a69-b4e6-fe4050e1e59e",
      "name": "设置基础 URL",
      "type": "n8n-nodes-base.set",
      "position": [
        140,
        480
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "10377b7b-b613-4e1c-a338-804e23c646a0",
              "name": "base_url",
              "type": "string",
              "value": "https://agentstudiohelp.zendesk.com"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c7af46d1-f9ea-4300-bc52-56eaf1647336",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1140,
        -580
      ],
      "parameters": {
        "color": 7,
        "width": 860,
        "height": 1700,
        "content": "# 同步 Zendesk 知识库文章到 Airtable"
      },
      "typeVersion": 1
    },
    {
      "id": "d57bedfe-ba62-448f-8e2b-b5f590477ee8",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -180
      ],
      "parameters": {
        "color": 4,
        "width": 920,
        "height": 380,
        "content": "## 初始同步"
      },
      "typeVersion": 1
    },
    {
      "id": "ee70ed91-ad63-4709-bdee-d9bbf0e26625",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -120
      ],
      "parameters": {
        "color": 4,
        "width": 220,
        "height": 280,
        "content": "启动完整同步"
      },
      "typeVersion": 1
    },
    {
      "id": "a08100e4-9d8d-4833-8ddb-485836060b6a",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -120
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 760,
        "content": "设置您的 Zendesk 域名。"
      },
      "typeVersion": 1
    },
    {
      "id": "b803d8da-78c3-44ec-9917-0bba7ea5098f",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        -120
      ],
      "parameters": {
        "color": 4,
        "width": 280,
        "height": 280,
        "content": "#### 完整获取:获取文章"
      },
      "typeVersion": 1
    },
    {
      "id": "36877a5a-afc0-4f91-ade3-4648ade23736",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        320
      ],
      "parameters": {
        "color": 5,
        "width": 280,
        "height": 320,
        "content": "#### 增量获取:获取自上次运行以来的文章"
      },
      "typeVersion": 1
    },
    {
      "id": "0b082080-6cef-4672-b0c8-9ce0bfd6dcdb",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -180,
        320
      ],
      "parameters": {
        "color": 5,
        "height": 320,
        "content": "按计划自动运行工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "c12804e1-d2fc-47db-95e7-eca226395d59",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        260
      ],
      "parameters": {
        "color": 5,
        "width": 920,
        "height": 400,
        "content": "## 增量同步"
      },
      "typeVersion": 1
    },
    {
      "id": "a6024af3-0a29-4fdc-85e7-19ee8292ad6b",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        860,
        120
      ],
      "parameters": {
        "color": 7,
        "width": 680,
        "height": 320,
        "content": "#### 准备数据"
      },
      "typeVersion": 1
    },
    {
      "id": "5ee117d9-c294-4a6b-ad52-ce709bb12d66",
      "name": "便签 10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1580,
        120
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 320,
        "content": "#### 存储文章"
      },
      "typeVersion": 1
    },
    {
      "id": "a73345d0-cc39-4a5d-9407-8cefaa0082b3",
      "name": "获取自上次运行以来的文章",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        420,
        480
      ],
      "parameters": {
        "url": "={{ $json.base_url }}/api/v2/help_center/incremental/articles.json?start_time={{ $now.minus($('Schedule Trigger').params.rule.interval.first().daysInterval, 'days').toSeconds().round() }}",
        "options": {
          "pagination": {
            "pagination": {
              "nextURL": "={{ $response.body.next_page }}",
              "paginationMode": "responseContainsNextURL",
              "requestInterval": 1000,
              "completeExpression": "={{ $response.body.next_page.isEmpty() }}",
              "paginationCompleteWhen": "other"
            }
          }
        },
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "zendeskApi"
      },
      "credentials": {
        "zendeskApi": {
          "id": "fLpWOCOisAwS9cK2",
          "name": "Zendesk account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "96968991-0f63-4c53-bbc3-b5b22d88cd54",
      "name": "获取所有文章",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        400,
        0
      ],
      "parameters": {
        "url": "={{$json.base_url}}/api/v2/help_center/articles",
        "options": {
          "pagination": {
            "pagination": {
              "nextURL": "={{ $response.body.next_page }}",
              "paginationMode": "responseContainsNextURL",
              "requestInterval": 1000,
              "completeExpression": "={{ $response.body.next_page.isEmpty() }}",
              "paginationCompleteWhen": "other"
            }
          }
        },
        "sendQuery": true,
        "authentication": "predefinedCredentialType",
        "queryParameters": {
          "parameters": [
            {
              "name": "sort_by",
              "value": "created_at"
            },
            {
              "name": "sort_order",
              "value": "desc"
            }
          ]
        },
        "nodeCredentialType": "zendeskApi"
      },
      "credentials": {
        "zendeskApi": {
          "id": "fLpWOCOisAwS9cK2",
          "name": "Zendesk account"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "b3ecd6a3-616d-4a7f-8db9-fd8eb88ddae8",
      "name": "正文转换为 Markdown",
      "type": "n8n-nodes-base.markdown",
      "position": [
        1360,
        240
      ],
      "parameters": {
        "html": "={{ $json.body }}",
        "options": {},
        "destinationKey": "markdown"
      },
      "typeVersion": 1
    },
    {
      "id": "70e66adc-d38f-40b2-8bef-245df759b2de",
      "name": "便签12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1140,
        -900
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 300,
        "content": "## 归属"
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "Split Out": {
      "main": [
        [
          {
            "node": "Set fields to store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set base url": {
      "main": [
        [
          {
            "node": "Get articles since last run",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set base_url": {
      "main": [
        [
          {
            "node": "Get all articles",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Body to Markdown": {
      "main": [
        [
          {
            "node": "Store Zendesk articles to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all articles": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set base url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set fields to store": {
      "main": [
        [
          {
            "node": "Body to Markdown",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get articles since last run": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Set base_url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 文档提取

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量21
分类1
节点类型8
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Agent Studio

Agent Studio

@agentstudio

We are a product studio that helps organizations leverage no-code and generative AI to automate internal processes and launch new digital products. LinkedIn: https://www.linkedin.com/in/baptistej/

外部链接
在 n8n.io 查看

分享此工作流