使用工作流差异比较更改(Compare changes with workflow diffs)#
工作流差异使你能够直观地比较实例上的工作流与连接的 Git 仓库中保存的最新版本之间的更改。这可以帮助你在决定将工作流在不同环境之间推送或拉取之前,准确了解具体的更改内容。
🌐 Workflow diffs allow you to visually compare changes between the workflow you have on an instance and the most recent version saved in your connected Git repository. This helps you understand the exact changes to the workflow before you decide to either push or pull it across different environments.
功能可用性
- 企业版可用
- 仅当你在实例上启用环境功能时,工作流差异才可用
访问工作流差异(Accessing workflow diffs)#
你可以从两个位置访问工作流差异:
🌐 You can access workflow diffs from two locations:
- 在推送更改时:点击提交模态框中所选工作流旁边的工作流差异图标,以查看你想要审查的工作流
- 拉取更改时:在修改的更改弹窗中,点击你想要查看的工作流程旁边的工作流程差异图标
了解工作流差异视图(Understanding the workflow diff view)#
打开工作流差异时,n8n 会垂直堆叠显示两个工作流:
🌐 When you open a workflow diff, n8n displays two workflows stacked vertically:
何时推送数据(When pushing)#
- 顶部面板(远程分支):你 Git 仓库中的最新版本
- 底部面板(本地):当前本地保存的工作流版本
何时拉取数据(When pulling)#
- 顶部面板(本地):你 n8n 实例上的当前版本
- 底部面板(远程分支):你从 Git 仓库中拉取的版本
在这两种情况下,顶部面板始终显示将随更改而更新的工作流。
🌐 In both cases, the top panel always displays the workflow that will update with changes.
差异视图高亮三种类型的更改:
🌐 The diff view highlights three types of changes:
- 已添加的节点和连接器:新增的节点或连接器将显示为绿色,并带有“N”图标
- 已修改的节点和连接器:对现有节点或连接器的修改将显示为橙色,并带有“M”图标
- 已删除的节点和连接器:节点或连接器被删除时将显示为红色,并带有“D”图标
审核节点更改(Reviewing node changes)#
对于被修改的节点,你还可以比较具体的更改。点击被修改的节点以显示更改的 JSON 差异。你可以在给定更改前后查看该节点的精确配置。
🌐 For modified nodes, you can also compare the specific changes. Click modified nodes to show a JSON diff of the changes. You can review the exact configuration for that node before and after the given change.
查看变更摘要(Viewing the summary of changes)#
在右上角,更改按钮显示更改的数量。这表示节点和节点连接器的总更改数,以及工作流一般设置的更新。
🌐 In the top-right corner, the changes button shows the number of changes. This represents the total number of changes across node and node connectors, as well as general workflow settings updates.
导航每次更改(Navigating through each change)#
你可以使用右上角的下一步和上一步箭头按逻辑顺序浏览你的更改。使用左上角的返回按钮可以回到提交或拉取窗口,以选择不同的工作流程来查看更改。
🌐 You can use the next and previous arrows in the upper-right corner to cycle through your changes in a logical order. Use the back button in the top-left corner to return to the commit or pull modal to select a different workflow to review changes on.
谁可以使用工作流差异?(Who can use workflow diffs)#
只有能够为实例推送或拉取提交的用户才能访问工作流差异:
🌐 Only users who can push or pull commits for an instance can access workflow diffs:
- 实例所有者
- 实例管理员
- 项目管理员