feat(governance): per-entity workflow trigger fields#28935
Conversation
Move the set of fields that can trigger a governance workflow from a
single global enum to a per-entity declaration in each entity's JSON
Schema, making the trigger surface entity-specific and the schema the
single source of truth.
- Add a top-level `workflowTriggerFields` array to 39 workflow-target
entity schemas. Seeded as the intersection of the existing global set
with each entity's own fields, so existing behavior is preserved (a
field can only appear in a changeDescription if the entity has it).
- Add WorkflowTriggerFieldsRegistry: scans the entity schemas once and
caches an entityType -> trigger-field-set map, with a global-enum
fallback for entities that declare none.
- FilterEntityImpl now gates changed fields per entity type via the
registry instead of iterating the global enum.
- Expose GET /v1/metadata/types/fields/{entityType}/workflowTriggerFields
so the workflow builder can fetch fields per entity.
- NodeConfigSidebar fetches trigger fields per selected data asset
(mirroring the existing custom-properties flow) instead of the static
global enum.
- Add entity-relevant structural/definition fields as triggers where
applicable (columns, table constraints/partition, schema definitions,
message/request/response schemas, search index fields, ML features,
pipeline tasks, stored procedure code, metric expression, retention
period, data contract).
- Remove lifeCycle and deleted from the trigger fields.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
There was a problem hiding this comment.
Pull request overview
This PR makes governance workflow trigger fields entity-specific by declaring them in each entity’s JSON Schema (workflowTriggerFields), then wiring backend + UI to consume those per-entity declarations (with a safe fallback to the legacy global enum).
Changes:
- Added
workflowTriggerFieldsdeclarations across workflow-target schemas and removeddeleted/lifeCyclefrom the legacy globalWorkflowTriggerFieldsenum. - Backend: introduced
WorkflowTriggerFieldsRegistry, updatedFilterEntityImplto gate triggers per entity type, and added an API to fetch trigger fields by entity type. - UI: updated the workflow builder sidebar to fetch per-entity trigger fields instead of using the static enum.
Reviewed changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| openmetadata-ui/src/main/resources/ui/src/rest/metadataTypeAPI.ts | Adds REST helper to fetch workflow trigger fields per entity type. |
| openmetadata-ui/src/main/resources/ui/src/components/WorkflowDefinitions/WorkflowBuilder/NodeConfigSidebar.tsx | Fetches trigger fields per selected data asset and uses them for exclude-field options. |
| openmetadata-ui/src/main/resources/ui/src/components/WorkflowDefinitions/WorkflowBuilder/forms/ConditionBuilder/ConditionBuilder.constants.ts | Removes deleted boolean handling after deleted is removed from global trigger fields enum. |
| openmetadata-spec/src/main/resources/json/schema/type/workflowTriggerFields.json | Removes deleted and lifeCycle from the global enum list. |
| openmetadata-spec/src/main/resources/json/schema/tests/testSuite.json | Declares workflowTriggerFields for testSuite. |
| openmetadata-spec/src/main/resources/json/schema/tests/testCase.json | Declares workflowTriggerFields for testCase (excluding internal-only fields). |
| openmetadata-spec/src/main/resources/json/schema/entity/teams/user.json | Declares workflowTriggerFields for user. |
| openmetadata-spec/src/main/resources/json/schema/entity/teams/team.json | Declares workflowTriggerFields for team. |
| openmetadata-spec/src/main/resources/json/schema/entity/services/storageService.json | Declares workflowTriggerFields for storageService. |
| openmetadata-spec/src/main/resources/json/schema/entity/services/searchService.json | Declares workflowTriggerFields for searchService. |
| openmetadata-spec/src/main/resources/json/schema/entity/services/pipelineService.json | Declares workflowTriggerFields for pipelineService. |
| openmetadata-spec/src/main/resources/json/schema/entity/services/mlmodelService.json | Declares workflowTriggerFields for mlmodelService. |
| openmetadata-spec/src/main/resources/json/schema/entity/services/metadataService.json | Declares workflowTriggerFields for metadataService. |
| openmetadata-spec/src/main/resources/json/schema/entity/services/messagingService.json | Declares workflowTriggerFields for messagingService. |
| openmetadata-spec/src/main/resources/json/schema/entity/services/databaseService.json | Declares workflowTriggerFields for databaseService. |
| openmetadata-spec/src/main/resources/json/schema/entity/services/dashboardService.json | Declares workflowTriggerFields for dashboardService. |
| openmetadata-spec/src/main/resources/json/schema/entity/services/apiService.json | Declares workflowTriggerFields for apiService. |
| openmetadata-spec/src/main/resources/json/schema/entity/domains/domain.json | Declares workflowTriggerFields for domain. |
| openmetadata-spec/src/main/resources/json/schema/entity/domains/dataProduct.json | Declares workflowTriggerFields for dataProduct (incl. lifecycleStage, SLA, relationships). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/topic.json | Declares workflowTriggerFields for topic (incl. messageSchema). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/table.json | Declares workflowTriggerFields for table (incl. structural fields like columns/constraints/partition). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/storedProcedure.json | Declares workflowTriggerFields for storedProcedure (incl. code fields). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/searchIndex.json | Declares workflowTriggerFields for searchIndex (incl. fields). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/report.json | Declares workflowTriggerFields for report. |
| openmetadata-spec/src/main/resources/json/schema/entity/data/query.json | Declares workflowTriggerFields for query. |
| openmetadata-spec/src/main/resources/json/schema/entity/data/pipeline.json | Declares workflowTriggerFields for pipeline (incl. tasks). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/page.json | Declares workflowTriggerFields for page. |
| openmetadata-spec/src/main/resources/json/schema/entity/data/mlmodel.json | Declares workflowTriggerFields for mlmodel (incl. mlFeatures/hyperparameters). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/metric.json | Declares workflowTriggerFields for metric (incl. metricExpression). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/glossaryTerm.json | Declares workflowTriggerFields for glossaryTerm (incl. synonyms/relationships). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/glossary.json | Declares workflowTriggerFields for glossary. |
| openmetadata-spec/src/main/resources/json/schema/entity/data/dataContract.json | Declares workflowTriggerFields for dataContract (schema/semantics/quality/etc). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/databaseSchema.json | Declares workflowTriggerFields for databaseSchema. |
| openmetadata-spec/src/main/resources/json/schema/entity/data/database.json | Declares workflowTriggerFields for database. |
| openmetadata-spec/src/main/resources/json/schema/entity/data/dashboardDataModel.json | Declares workflowTriggerFields for dashboardDataModel (incl. columns/sql). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/dashboard.json | Declares workflowTriggerFields for dashboard. |
| openmetadata-spec/src/main/resources/json/schema/entity/data/container.json | Declares workflowTriggerFields for container (incl. hierarchy + retention). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/chart.json | Declares workflowTriggerFields for chart. |
| openmetadata-spec/src/main/resources/json/schema/entity/data/apiEndpoint.json | Declares workflowTriggerFields for apiEndpoint (incl. request/response schema). |
| openmetadata-spec/src/main/resources/json/schema/entity/data/apiCollection.json | Declares workflowTriggerFields for apiCollection. |
| openmetadata-spec/src/main/resources/json/schema/entity/classification/tag.json | Declares workflowTriggerFields for tag (incl. hierarchy/style). |
| openmetadata-spec/src/main/resources/json/schema/entity/classification/classification.json | Declares workflowTriggerFields for classification. |
| openmetadata-spec/src/main/resources/json/schema/dataInsight/dataInsightChart.json | Declares workflowTriggerFields for dataInsightChart. |
| openmetadata-service/src/test/java/org/openmetadata/service/governance/workflows/elements/triggers/impl/FilterEntityImplTest.java | Expands tests to validate per-entity trigger behavior + removal of deleted/lifeCycle. |
| openmetadata-service/src/main/java/org/openmetadata/service/resources/types/TypeResource.java | Adds API endpoint to retrieve workflow trigger fields by entity type. |
| openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/WorkflowTriggerFieldsRegistry.java | New registry that scans schemas once and caches trigger fields per entity type (fallback to global enum). |
| openmetadata-service/src/main/java/org/openmetadata/service/governance/workflows/elements/triggers/impl/FilterEntityImpl.java | Switches runtime trigger gating to use per-entity trigger fields via the registry. |
✅ TypeScript Types Auto-UpdatedThe generated TypeScript types have been automatically updated based on JSON schema changes in this PR. |
Address PR review feedback: - WorkflowTriggerFieldsRegistry: scan only the canonical entity schema roots (entity, tests, dataInsight) and keep-first + log on basename collisions, so the entityType mapping can never become order-dependent if a same-named schema elsewhere later declares workflowTriggerFields. - NodeConfigSidebar: use Promise.allSettled so one failed request does not clear the whole exclude-field list, and guard setState with a cancel flag to avoid stale updates after unmount / dependency change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The scan-root selection does not by itself prevent basename collisions (entity/ still contains same-named schemas such as entity/feed/domain.json); determinism on a clash is provided by the keep-first + error guard in readSchema. Reword the comment to reflect that and the broad-scan / auto-discovery intent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🟡 Playwright Results — all passed (14 flaky)✅ 4270 passed · ❌ 0 failed · 🟡 14 flaky · ⏭️ 88 skipped
🟡 14 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Code Review ✅ Approved 3 resolved / 3 findingsRefactors governance workflow triggers to use per-entity schemas as the source of truth, replacing the rigid global enum. This change resolves potential UI fetch failures and registry key collisions, with no outstanding issues. ✅ 3 resolved✅ Quality: UI exclude-field list empties when trigger-fields fetch fails
✅ Edge Case: Registry keys entity type by filename, risking basename collisions
✅ Bug: workflowTriggerFields references non-existent inputPorts/outputPorts
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|
|



What
Moves the set of fields that can trigger a governance workflow from a single global enum (
WorkflowTriggerFields) to a per-entity declaration in each entity's JSON Schema (workflowTriggerFields). The schema becomes the single source of truth and the trigger surface is now entity-specific.Why
The global enum was an allowlist shared across all entities:
testCaseResolutionStatusis a real field on a test case but should not trigger governance workflows; a single global list cannot exclude it for one entity without removing it for all.How
workflowTriggerFieldsarray to the 39 workflow-target entity schemas. Seeded asglobalEnum ∩ entityProperties, which is behavior-preserving: a field can only appear in achangeDescriptionif it is a serialized property of the entity, so intersecting against the global set never drops a field that could actually occur.WorkflowTriggerFieldsRegistryscans the entity schemas once and cachesentityType -> Set<field>, with a fallback to the global enum for entities that declare none.FilterEntityImplnow resolves trigger fields per entity type via the registry instead of iterating the global enum.GET /v1/metadata/types/fields/{entityType}/workflowTriggerFields.NodeConfigSidebarfetches trigger fields per selected data asset (mirroring the existing custom-properties flow) instead of using the static enum.Field changes
columns,tableConstraints,tablePartition,schemaDefinition,messageSchema,requestSchema/responseSchema,fields(search index),mlFeatures,algorithm,mlHyperParameters,tasks,sql,storedProcedureCode/code,metricExpression,retentionPeriod,dataContract.lifeCycleanddeletedfrom the trigger fields entirely.Testing
FilterEntityImplTestextended for per-entity behavior (e.g.tabletriggers oncolumns,glossaryTermonsynonyms;testCasedoes not trigger ontestCaseResolutionStatus; structural fields are entity-specific and not global) and for thelifeCycle/deletedremovals.governance.workflowspackage: 240 tests pass.WorkflowConfigFormV1test passes; eslint + prettier clean on changed files.Follow-ups (not in this PR)
lifeCycle/deleted). Making it per-entity needs the trigger node'sdataAssetsthreaded into that form (cross-node). Harmless today since the backend enforces per-entity.🤖 Generated with Claude Code