Branching action types(分支操作类型)¶
Ontology actions integrate with Global Branching, enabling you to test action types on a branch without affecting your production environment. You can run actions, validate their configurations, and observe edits in an isolated branch context before merging changes to main.
For general information on Global Branching concepts and workflows, refer to the Global Branching documentation.
Running actions on a branch¶
You can test actions in a Workshop module on a branch to validate that they have been configured correctly. When all relevant object types are indexed on a branch, you can run the action type and see the resulting edits on the branch.
Prerequisites¶
To run an action on a branch, all object types that are edited by the action type must be indexed on that branch. You can index object types through the individual object type page or through the action type page in Ontology Manager.

:::callout{theme="neutral"}
Running actions on a branch is intended as a testing mechanism. Action edits on a branch will not be merged back into main.
:::
Working with function-backed actions on a branch¶
Function-backed actions on a branch behave differently depending on whether they are branch-aware. Branch-aware functions can be modified on the branch and read schemas from it, while non-branch-aware functions only read schemas from main. Regardless of branch-awareness, all function-backed actions execute only on the branch and do not write changes back to main. See supported function types in the Global Branching documentation.
Managing side effects on branches¶
:::callout{theme="neutral"} The following information applies specifically to webhooks, functions with external calls, and notifications that are applied via actions on branches. Side effects applied through other means will behave as defined by those consumers. :::
Webhooks¶
By default, webhooks do not execute when an action is applied on a branch. This behavior is to prevent accidentally writing to external systems while in a testing environment.
In such cases, you will see a toast notification indicating this behavior.

However, there are some cases where testing a webhook on a branch is desirable, for instance when hitting a READ endpoint.
To override the default behavior, configure the action type's Security and submission criteria tab in Ontology Manager to enable webhook executions on branches.

:::callout{theme="neutral"}
If webhooks on branches are enabled, the webhook will run exactly as it would on main. Consequently, if the webhook is configured to hit an external production environment, it will continue to do that even if the action is executed on a branch.
:::
Functions with external calls¶
By default, function-backed action logic with external calls does not execute when an action is applied on a branch; the action fails entirely. This behavior is to prevent accidentally writing to external systems while in a testing environment.
In such cases, you will see a toast notification indicating failure, with an explanation of the behavior.

However, testing on branches is sometimes necessary, for example, when calling READ endpoints. You can override this restriction by enabling functions with external calls on branches in the action type's Security and submission criteria tab in Ontology Manager.

:::callout{theme="neutral"}
If functions with external calls on branches are enabled, the function will make the same external calls as it would on main. Consequently, if the function is configured to hit an external production environment, it will continue to do that even if the action is executed on a branch.
:::
Notifications¶
By default, notifications do not execute when an action is applied on a branch. This behavior is to prevent accidentally notifying recipients while in a testing environment.
In such cases, you will see a toast notification indicating this behavior.

However, there are some cases where testing notifications on a branch is desirable.
To override the default behavior, you can enable notifications on branches in the action type's Security and submission criteria tab in Ontology Manager.
Additionally, you can specify the notification recipients when the action runs on a branch:
- Branch owner: Send all notifications to the branch owner.
- Default recipients: Notify the recipients configured on the original notifications.

Known limitations¶
- Action edits on a branch are for testing only and will not be merged back into
main. - Webhooks and email notifications are not executed by default when an action is run on a branch.
- Functions that make calls to external systems will fail by default when an action is run on a branch.
中文翻译¶
分支操作类型¶
本体论(Ontology)操作与全局分支(Global Branching)功能集成,使您能够在分支上测试操作类型,而不会影响生产环境。您可以在隔离的分支环境中运行操作、验证其配置并观察编辑结果,然后再将更改合并到 main 分支。
有关全局分支概念和工作流程的通用信息,请参阅全局分支文档。
在分支上运行操作¶
您可以在 Workshop 模块的分支上测试操作,以验证其配置是否正确。当所有相关对象类型在分支上建立索引后,您可以运行该操作类型并查看分支上的编辑结果。
前提条件¶
要在分支上运行操作,该操作类型所编辑的所有对象类型必须在该分支上建立索引。您可以通过单个对象类型页面或通过 Ontology Manager 中的操作类型页面来建立对象类型索引。

:::callout{theme="neutral"}
在分支上运行操作用于测试目的。分支上的操作编辑结果不会合并回 main 分支。
:::
在分支上使用函数支持的操作¶
分支上的函数支持操作根据其是否具有分支感知能力而表现不同。具有分支感知能力的函数可以在分支上修改并从分支读取模式(Schema),而非分支感知函数仅从 main 分支读取模式。无论是否具有分支感知能力,所有函数支持的操作仅在分支上执行,不会将更改写回 main 分支。请参阅全局分支文档中支持的函数类型。
管理分支上的副作用¶
:::callout{theme="neutral"} 以下信息专门适用于通过分支上的操作应用的 Webhook、带有外部调用的函数以及通知。通过其他方式应用的副作用将按照这些消费者的定义行为。 :::
Webhook¶
默认情况下,当在分支上应用操作时,Webhook 不会执行。此行为旨在防止在测试环境中意外写入外部系统。
在这种情况下,您将看到一个提示此行为的 Toast 通知。

然而,在某些情况下,在分支上测试 Webhook 是可取的,例如在访问 READ 端点时。
要覆盖默认行为,请在 Ontology Manager 中配置操作类型的安全和提交标准选项卡,以启用分支上的 Webhook 执行。

:::callout{theme="neutral"}
如果启用了分支上的 Webhook,Webhook 将完全按照在 main 分支上的方式运行。因此,如果 Webhook 配置为访问外部生产环境,即使操作在分支上执行,它仍将继续访问该环境。
:::
带有外部调用的函数¶
默认情况下,当在分支上应用操作时,带有外部调用的函数支持操作逻辑不会执行;操作会完全失败。此行为旨在防止在测试环境中意外写入外部系统。
在这种情况下,您将看到一个指示失败的 Toast 通知,并附有行为说明。

然而,在某些情况下,在分支上进行测试是必要的,例如在调用 READ 端点时。您可以通过在 Ontology Manager 的操作类型安全和提交标准选项卡中启用分支上带有外部调用的函数来覆盖此限制。

:::callout{theme="neutral"}
如果启用了分支上带有外部调用的函数,该函数将进行与在 main 分支上相同的外部调用。因此,如果函数配置为访问外部生产环境,即使操作在分支上执行,它仍将继续访问该环境。
:::
通知¶
默认情况下,当在分支上应用操作时,通知不会执行。此行为旨在防止在测试环境中意外通知收件人。
在这种情况下,您将看到一个提示此行为的 Toast 通知。

然而,在某些情况下,在分支上测试通知是可取的。
要覆盖默认行为,您可以在 Ontology Manager 的操作类型安全和提交标准选项卡中启用分支上的通知。
此外,您可以指定当操作在分支上运行时的通知收件人:
- 分支所有者: 将所有通知发送给分支所有者。
- 默认收件人: 通知原始通知中配置的收件人。

已知限制¶
- 分支上的操作编辑仅用于测试,不会合并回
main分支。 - 当在分支上运行操作时,Webhook 和电子邮件通知默认不会执行。
- 当在分支上运行操作时,调用外部系统的函数默认会失败。