> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Governance Workflow Triggers and Conditions

> Trigger governance workflows for relevant entity changes and route Data Products by their asset and output port counts.

# Configure Governance Workflow Triggers and Conditions

Governance workflows can respond to changes on specific data assets and route an entity based on its metadata. OpenMetadata 2.1 adds entity-specific trigger fields, support for column custom-property changes, and Data Product count conditions.

You need permission to create or edit a Workflow Definition. You also need the `Deploy` operation to deploy the completed workflow.

## Choose Which Changes Trigger a Workflow

For an event-based start node, the **Include Fields** and **Exclude Fields** lists contain only fields that apply to the selected data asset types. The lists combine:

* Common fields, such as `description`, `owners`, and `tags`.
* Fields for the selected entity type, such as `columns` for a Table or `outputPorts` for a Data Product.
* Custom properties defined for the selected entity type. The selector marks these entries as **Custom Property**.

This keeps a workflow from offering fields that cannot change on the selected entity type.

![Include Fields list showing the columns field for a Table workflow trigger](https://mintcdn.com/openmetadata/hS4_qNyozrR_5tDT/public/images/how-to-guides/governance/workflows/workflow-trigger-fields.png?fit=max\&auto=format\&n=hS4_qNyozrR_5tDT\&q=85\&s=0552ebf8d0afbedba1cd569398638c4c)

> [!NOTE]
>
> If **Include Fields** is empty, any supported common or entity-specific field can trigger the workflow. Use **Include Fields** when the workflow should respond only to a smaller set of changes.

### Trigger a Workflow When a Column Custom Property Changes

Use the Table `columns` field to respond when a custom property on any column changes.

1. Go to **Govern** > **Workflows**, create or edit a workflow, and select the start node.
2. Under **Data Asset**, select **Table**. Select **Dashboard Data Model** instead when the custom property belongs to a dashboard data model column.
3. Set **Trigger Type** to **Event Based**.
4. Under **Include Fields**, select `columns`.
5. Complete the workflow, save it, and deploy it.

![Start node configured to monitor the columns field on Tables](https://mintcdn.com/openmetadata/hS4_qNyozrR_5tDT/public/images/how-to-guides/governance/workflows/workflow-column-trigger-config.png?fit=max\&auto=format\&n=hS4_qNyozrR_5tDT\&q=85\&s=b0a427e31af718b53dbbf3399b0501e2)

Changing a column custom property now creates a column change on the parent entity and starts the workflow. One update to a table starts the workflow at most once, even when the update changes multiple columns.

> [!NOTE]
>
> The trigger watches the `columns` field as a whole. It cannot be limited to one column or one column custom property. The condition builder does not offer `columns` because it is an array of column objects and cannot be compared as a single value.

## Negative Operators on List Fields

The condition builder for the **Data Asset Filter** and the **Check Condition** node treats the **Is Not**, **Not in**, and **Is Not Set** operators on list fields as a check on the whole list. List fields include **Tags**, **Owners**, **Reviewers**, **Domains**, and **Data Products**. For these fields, the **Operator** list also includes **Is**, **Any in**, and **Is Set**.

* **Is Not**: The asset is not tagged with the selected value. An asset with no tags passes. An asset with the selected tag fails, even if it has other tags too.
* **Not in**: The asset has none of the selected values.
* **Is Not Set**: The asset has no value in the field, for example no tags.

![Check Condition node with the Operator list for the Tags field showing Is, Is Not, Any in, Not in, Is Not Set, and Is Set](https://mintcdn.com/openmetadata/b1bnXfK-eK4XujGx/public/images/how-to-guides/governance/check-condition-tags-operators.png?fit=max\&auto=format\&n=b1bnXfK-eK4XujGx\&q=85\&s=b82080a59f78efda4c0496dc8f925835)

![Check Condition node with the rule Tags Is Not PII.Sensitive](https://mintcdn.com/openmetadata/b1bnXfK-eK4XujGx/public/images/how-to-guides/governance/check-condition-tags-is-not.png?fit=max\&auto=format\&n=b1bnXfK-eK4XujGx\&q=85\&s=0f88fc39ff263cb7bdde7427345e3c38)

A condition group that shows a **NOT** badge is negated as a whole. Its helper text explains the effect, for example "At least one condition must not match" or "No condition can match". This happens, for example, with a rule created through the API that negates several conditions.

## Route Data Products by Asset or Output Port Count

The **Check Condition** node provides two numeric fields when the workflow evaluates a Data Product:

| Field | Internal name | What it counts |
| - | - | - |
| **Asset Count** | `assetsCount` | Assets assigned to the Data Product |
| **Output Port Count** | `outputPortsCount` | Assets configured as output ports |

For example, use `Asset Count > 0` to continue only when the Data Product contains an asset, or `Output Port Count > 0` to require at least one output port.

1. Configure the start node with **Data Product** selected under **Data Asset**. The count fields are not available when the start node processes Tables or another entity type.
2. Add a **Check Condition** node. If you changed the start node after adding this node, close and reopen its configuration so the field list refreshes.
3. In the condition builder's **Field** list, select **Asset Count** or **Output Port Count**. Do not select **Data Product**. That option represents an entity relationship and provides operators such as **Is** and **Is Not**.
4. Select `>` and enter `0` to require at least one item.
5. Connect the true and false branches to the appropriate next steps.
6. Save and deploy the workflow.

![Check Condition configured with Asset Count greater than zero](https://mintcdn.com/openmetadata/hS4_qNyozrR_5tDT/public/images/how-to-guides/governance/workflows/data-product-asset-count-condition.png?fit=max\&auto=format\&n=hS4_qNyozrR_5tDT\&q=85\&s=ad96545ca57ef8e1d4037e32d0a33cf7)

![Check Condition configured with Output Port Count greater than zero](https://mintcdn.com/openmetadata/hS4_qNyozrR_5tDT/public/images/how-to-guides/governance/workflows/data-product-output-port-count-condition.png?fit=max\&auto=format\&n=hS4_qNyozrR_5tDT\&q=85\&s=3df926f04fb49db650e4aea5fd85c137)

OpenMetadata calculates these counts when the condition runs. They are available for workflow evaluation but are not stored as fields on the Data Product.

> [!TIP]
>
> To validate both requirements, add conditions for `assetsCount > 0` and `outputPortsCount > 0`, then use the branch that matches your approval process.

## Hold Edits for Approval

An event-based start node has an **Approval Mode** setting with two options. **Default** publishes edits immediately and runs the workflow afterward. **Enforce** holds each edit as a change request until a reviewer approves it.

In an Enforce workflow, add a **User Approval** task. Approving the task publishes the held edit, and rejecting it discards the edit. For the requester and reviewer experience, see [Approval-Gated Changes](https://docs.open-metadata.org/v2.1.x/how-to-guides/data-governance/approval-gated-changes.md).

## Approval Task Thresholds and Voting

A **User Approval** task can require more than one approver. The **Approval Threshold** is the number of approvals the task needs, and the **Rejection Threshold** is the number of rejections that closes it as rejected.

### Thresholds Are Capped at the Users Who Can Vote

OpenMetadata never lets a threshold exceed the number of users who can vote on the task. When the task is created:

* **Requester excluded**: The person who made the change cannot approve it, so OpenMetadata removes them from the assignees. If that leaves fewer assignees than the threshold, OpenMetadata lowers the threshold to the number of remaining assignees. For example, a threshold of 2 with an owner and a reviewer who is also the requester becomes 1.
* **Both thresholds**: The cap applies to the **Approval Threshold** and the **Rejection Threshold**.
* **Teams**: If the assignees include a team, OpenMetadata does not cap the threshold, because any member of the team can vote.
* **Open tasks**: The cap applies when a task is created. A task that is already open keeps the threshold it started with.

> [!NOTE]
>
> When the requester is one of two eligible approvers, a two-approval rule becomes one independent approval. To require two independent approvals, name enough approvers, for example a team or a third reviewer.

### Who Can Approve and What the Task Shows

* **Assignees only**: Only an assignee of the task, directly or through a team, can approve or reject it. A user who is not an assignee sees the message "You can't approve or reject this task because it isn't assigned to you". This applies to admins too.
* **Counted votes**: A task with several approvers shows who has approved or rejected it, for example "Alex approved", for the current stage of the task.
* **After you vote**: Once you vote, the **Approve** and **Reject** actions are hidden, and the task shows "Your vote is recorded. Waiting for the other approvers." until the threshold is reached. Other actions, such as reassigning the task, stay available.
* **Where it applies**: These rules apply on the asset's task tab, in the review panel in the inbox and the glossary, and in the activity feed card.

## Naming Rules

OpenMetadata uses some names you enter to build the variables that the workflow runs on, so they accept only letters, digits, and underscores (`_`):

* **Node name**: The name of a **User Approval** task node, and of a node that creates and runs an ingestion pipeline.
* **Expiry timer variables**: The `durationVariable` and `dateVariable` of an approval task's `expiryTimer`.

OpenMetadata rejects a workflow definition that uses other characters when you save it, including a definition created through the API. Other node types accept a wider set of characters in their names. Use **Display Name** for a readable label.

## Verify the Workflow

Test the deployed workflow with a non-production entity:

1. Change a selected trigger field on the entity.
2. Confirm that a workflow instance starts.
3. For a Data Product condition, test once with an empty collection and once after adding an asset or output port.
4. Confirm that each instance follows the expected true or false branch.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.