Skip to content

使用工作流差异比较更改#

¥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.

Feature availability

  • 企业版可用

¥Available on Enterprise

¥Workflow diffs are only available when you enable the environments features on an instance

访问工作流差异#

¥Accessing workflow diffs

你可以从两个位置访问工作流差异:

¥You can access workflow diffs from two locations:

  1. 推送更改时:在要查看的工作流旁边的提交窗口中,点击工作流差异图标。

¥When pushing changes: Click the workflow diff icon in the commit modal alongside the workflow you want to review 2. 拉取更改时:在要查看的工作流旁边的修改更改窗口中,点击工作流差异图标。

¥When pulling changes: Click the workflow diff icon in the modified changes modal alongside the workflow you want to review

了解工作流差异视图#

¥Understanding the workflow diff view

打开工作流差异时,n8n 会垂直堆叠显示两个工作流:

¥When you open a workflow diff, n8n displays two workflows stacked vertically:

何时推送数据#

¥When pushing

  • 顶部面板(远程分支):Git 仓库中的最新版本

¥Top panel (Remote branch): Latest version in your Git repository

  • 底部面板(本地):当前本地保存的工作流版本

¥Bottom panel (Local): Current locally saved version of the workflow

何时拉取数据#

¥When pulling

  • 顶部面板(本地):n8n 实例上的当前版本

¥Top panel (Local): Current version on your n8n instance

  • 底部面板(远程分支):你正在从 Git 仓库拉取的版本

¥Bottom panel (Remote branch): Version you're pulling from the Git repository

在这两种情况下,顶部面板始终显示将随更改而更新的工作流。

¥In both cases, the top panel always displays the workflow that will update with changes.

差异视图高亮三种类型的更改:

¥The diff view highlights three types of changes:

  • 已添加节点和连接器:新添加的节点或连接器将显示为绿色,并带有 "N" 图标。

¥Added nodes and connectors: New node additions or connectors will show as green along with an "N" icon

  • 已修改的节点和连接器:对现有节点或连接器的修改将显示为橙色,并带有 "M" 图标。

¥Modified nodes and connectors: Modifications to existing nodes or connectors will show as orange along with a "M" icon

  • 已删除的节点和连接器:删除的节点或连接器将显示为红色,并带有 "D" 图标。

¥Deleted nodes and connectors: Node or connector deletions will show as red along with a "D" icon

审核节点更改#

¥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:

  • 实例所有者

¥instance owners

  • 实例管理员

¥instance admins

  • 项目管理员

¥project admins