Metadata entity lifecycle
Catalog entities are the server’s shared records for data assets, services, people, governance objects, and knowledge objects. The domain layer turns requests into valid current state, connects that state to other entities, preserves the changes that matter, and publishes committed state to search and related views. For the service boundary, see Metadata platform service. For resource contracts, see Service API resources. For access and governance rules, see Platform security and governance.
Entity model
An entity combines stored attributes with references to other entities. A fully qualified name (FQN) is the stable name used for name lookup and hierarchy work. An entity reference is the small link used to connect one entity to another without copying the full record.
| State | Purpose | Source of truth |
|---|---|---|
| Attributes | Names, descriptions, status, schema, and lifecycle data | Current entity record |
| Relationships | Ownership, tags, domains, containment, membership, lineage, and type-specific links | Relationship records resolved to entity references |
| Extensions | Custom properties, field references, samples, and type-specific data | Extension records |
| Derived fields | Inherited values, links, counts, summaries, and metrics | Built when the entity is read |
| History | Earlier entity states and field changes | Version records and current state |
| Observations | Profiles, test results, usage, incidents, pipeline state, and other time-based facts | Time-series records keyed by entity identity or FQN hash |
| Activity and audit state | User-facing activity and durable change records | Activity and audit event records |
| Semantic state | Ontology definitions, references, releases, and relationship types | Ontology records and retained release records |
Entity preparation
Preparation turns an incoming entity into a valid domain object before persistence. It resolves references, derives FQNs, applies type rules, and prepares relationship fields so direct, patch, bulk, import, and restore paths produce the same kind of valid state.
The rules depend on the entity’s role. Hierarchical assets prepare parent chains and child FQNs. Tags and glossary terms validate where labels may be applied. Services and pipelines protect connection values. Personas normalize context rules and validate their search filters. Tasks fill target-derived domains and workflow data. Ontology concepts reject client writes to fields derived from axioms or releases.
Large writes are prepared item by item and committed in bounded groups. This gives callers per-item conflict results and limits lock time. An AI governance framework fork creates a new framework and copies its controls as new records, while the original remains unchanged.
References: openmetadata-service/…/EntityRepository.java• L909-930 openmetadata-service/…/PersonaRepository.java• L130-175 openmetadata-service/…/PersonaRepository.java• L305-375 openmetadata-service/…/OntologyConceptRepository.java• L61-73 openmetadata-service/…/OntologyConceptRepository.java• L102-120 openmetadata-service/…/TaskRepository.java• L384-432
Entity identity
The server uses an ID for direct lookup and an FQN for name lookup and hierarchy operations. A create assigns identity. An update keeps the identity. A rename or parent move changes the FQN while keeping the identity, then refreshes descendants and dependent views. Tasks use their generated task ID as their stable FQN even when their display name changes.
References use identity rather than copied entity documents. This lets a rename update one entity and then propagate the new name to affected descendants, tags, conversations, field links, and projections. The propagation scope is based on captured descendant identities and FQN boundaries, not raw text replacement. Flat hierarchies such as metrics can change parent edges without changing descendant FQNs.
References: openmetadata-service/…/EntityRepository.java• L378-501 openmetadata-service/…/TaskRepository.java• L377-382 openmetadata-service/…/FqnKeyedRowCleanup.java• L21-28
Entity lifecycle
The lifecycle moves an entity from an external request to validated current state. The resource layer checks access and request limits. The repository layer prepares the entity, compares it with current state, writes its related state, records history, and starts effects that depend on the committed result.
The main path is:
flowchart LR
A[Create, replace, patch, bulk, import, or restore] --> B[Authorize and limit]
B --> C[Prepare and validate]
C --> D[Resolve current state]
D --> E[Compare attributes and relationships]
E --> F[Write current state and history]
F --> G[Commit transaction]
G --> H[Refresh caches and projections]
H --> I[Return current entity]
Entity creation
Creation validates and completes the new entity before it writes the entity record and its related state. The entity record, extensions, and relationship edges are treated as one domain result, so a successful create represents a usable catalog object.
The shared lifecycle assigns an initial status on every create path. A request cannot skip a review stage owned by a workflow. Some types start in Draft when reviewers or a review playbook applies. Others start Approved when no review is needed. Tasks also establish their target, creator, participants, and target-derived domain state. A failed test result can create an incident task instead of only writing an observation.
References: openmetadata-service/…/EntityRepository.java• L6395-6415 openmetadata-service/…/TaskRepository.java• L399-432 openmetadata-service/…/TestCaseResolutionStatusRepository.java• L887-945
Entity update
Replace and patch operations compare incoming state with a stored baseline. They preserve server-owned identity and omitted partial fields. A meaningful change records the affected fields and updates the current version. A stale version or timestamp rejects the write instead of replacing newer state.
Repository-specific rules protect state owned by another process. Persona default changes invalidate all affected user contexts. A task update keeps its target identity and derives its domains again. A table read and write keep parent, column, extension, and inherited metadata aligned. A test case result refreshes the test case only when it is still the newest result, using optimistic retries when another result wins the race.
Comments and similar task activity update the task record while describing the activity in the event delta. They do not turn every user-facing activity record into a separate governed entity version.
References: openmetadata-service/…/EntityRepository.java• L945-968 openmetadata-service/…/PersonaRepository.java• L501-546 openmetadata-service/…/TableRepository.java• L613-625 openmetadata-service/…/TaskRepository.java• L632-678 openmetadata-service/…/TestCaseResultRepository.java• L317-376
Entity retrieval
Retrieval starts with the stored entity record and builds the view requested by the caller. Relationship fields, inherited values, counts, time-series summaries, and other derived data are loaded only when requested. Normal reads exclude soft-deleted records and references unless the caller asks for another view.
Single and bulk reads share the same field contract. Batch reads resolve relationship references in groups and then apply the same inherited-field and field-clearing rules as a single read. Tables rebuild container and inherited metadata when legacy or partial rows do not contain it. Personas and tasks load participant references and counts only as requested.
List filters also carry product rules. Task lists can use creation or update time as a stable cursor order, while free-text task search uses a matching set before it applies that order. Ontology lists can scope records by ontology, change-set state, or source memory. Time-dependent announcement filters bypass count caching because their result changes as time passes.
References: openmetadata-service/…/EntityRepository.java• L892-906 openmetadata-service/…/TableRepository.java• L207-247 openmetadata-service/…/PersonaRepository.java• L116-128 openmetadata-service/…/TaskRepository.java• L214-239 openmetadata-service/…/TaskListOrder.java• L33-44 openmetadata-service/…/ListFilter.java• L198-260 openmetadata-service/…/ListFilter.java• L661-729
Entity deletion and restoration
Soft delete marks a record as deleted and keeps enough state for restoration. Hard delete removes the record and dependent domain state. Recursive operations walk true containment and parent-child links. Membership and reference links do not automatically mean ownership.
FQN-keyed rows need ownership checks during hard delete. A name can be shared across entity types or can equal a child field FQN. Cleanup therefore removes only rows owned by the deleted entity and leaves rows held by surviving entities. Large recursive deletes process bounded groups so a wide hierarchy does not require one full tree in memory.
References: openmetadata-service/…/EntityRepository.java• L667-693 openmetadata-service/…/FqnKeyedRowCleanup.java• L43-90 openmetadata-service/…/FqnKeyedRowCleanup.java• L119-171
Relationship management
Relationships are first-class catalog state. The domain layer validates the referenced entities, stores a directed edge with its types and relationship kind, and rebuilds entity references when a caller requests the related field. This keeps shared links consistent instead of copying them into many entity documents.
Relationship storage
An edge identifies its source, target, source type, target type, relationship kind, and optional context. The full edge identity matters because the same endpoints can have more than one named relationship.
Create and update flows write entity state and relationship edges in one unit. An update removes only changed edges and adds their replacements. Containment defines placement and often ownership. Other edges represent ownership, labels, domains, membership, editors, source documents, related entities, and lineage.
Tasks use distinct edges for domains, assignees, reviewers, watchers, creator, and the entity they are about. Ontology concept bindings are a separate asset-to-concept store because one concept can apply to many assets and columns. A binding update replaces the association without copying the concept into the asset record.
References: openmetadata-service/…/TaskRepository.java• L680-711 openmetadata-service/…/OntologyConceptBindingDAO.java• L43-111 openmetadata-service/…/EntityRepository.java• L962-968
Relationship retrieval
Relationship retrieval resolves only the fields requested by the caller. Batch reads group edges by direction and type, load references in groups, and attach them to their owning entities. This makes related data available without making every entity read unbounded.
Inherited values are rebuilt from the nearest valid parent chain. Tables can recover service and database references from containment edges and then apply inherited owners, domains, tags, and retention values. Task domains come from the target entity, not from the task author. Ontology concept hierarchy and lifecycle status are derived from axioms and retained releases rather than from client-supplied fields.
Time-series readers select observations by entity key, extension, timestamp, and cursor. Ontology serving reads use members of the active release. Binding reads can return live assets by type and exclude deleted assets from the serving view.
References: openmetadata-service/…/TableRepository.java• L331-369 openmetadata-service/…/TaskRepository.java• L562-604 openmetadata-service/…/OntologyConceptRepository.java• L220-293 openmetadata-service/…/OntologyConceptBindingDAO.java• L84-96 openmetadata-service/…/OntologyReleaseDAO.java• L84-96
Relationship propagation
A relationship change can affect many records beyond its two endpoints. The domain layer invalidates entity and relationship views, refreshes inherited values, and updates search, lineage, RDF, policy, or other projections when needed.
Hierarchy changes cascade through child FQNs and dependent projections. Persona assignment changes invalidate user context views. Ontology concept deletion removes its bindings and refreshes the bound assets. Test case incidents and results refresh graph and search projections from the newest committed observation.
Downstream work follows committed state. Search, RDF, lineage, policy snapshots, alerts, scheduler work, extraction, and external cleanup are deferred or retried after the transaction is safe. A rollback clears deferred work so a retry does not publish a result for state that never committed.
References: openmetadata-service/…/PersonaRepository.java• L415-429 openmetadata-service/…/OntologyConceptRepository.java• L122-132 openmetadata-service/…/TestCaseResolutionStatusRepository.java• L190-210 openmetadata-service/…/TestCaseResultRepository.java• L226-242 openmetadata-service/…/EntityRepository.java• L6318-6358
Semantic release state
Ontology editing adds a publication lifecycle beside ordinary entity history. Working definitions are captured as immutable releases. Review decisions and activation events change release state, while semantic content changes require a new capture.
Release members retain the source version and a payload digest. A release can be sealed only after its member set is complete. The active release is the serving view for live ontologies, while earlier activated releases remain available for history and comparison. Operational concept bindings remain separate from release members.
References: openmetadata-service/…/OntologyReleaseDAO.java• L40-57 openmetadata-service/…/OntologyReleaseDAO.java• L183-206 openmetadata-service/…/OntologyReleaseDAO.java• L240-298
Versioning and change history
Versioning gives each meaningful entity state a numeric version and a description of the fields that changed. Current state stays in the entity record. Older snapshots are retained separately so a caller can inspect an earlier state without changing the current entity.
Version progression
The updater compares the original and prepared entities. An effective change advances the version and records field-level changes. A request with no effective change keeps the current version. Compatible edits can be consolidated in one user session, while the request-level change description remains available to downstream consumers.
Routine observations use separate time-series models. Profiles, test results, usage, incident status, execution, and pipeline state do not create a new governed entity version for every event. A test case row instead reflects its newest result through an optimistic refresh, while the full result history remains in the time-series store.
Ontology releases provide a second history model. A release is a retained snapshot of a semantic working view. Its members remain stable after the working ontology changes.
References: openmetadata-service/…/EntityRepository.java• L10985-11014 openmetadata-service/…/TestCaseResultRepository.java• L339-376 openmetadata-service/…/OntologyReleaseDAO.java• L122-166
Version retrieval
An entity version request reads stored history for the requested version. A request for the current version returns the current entity after normal field hydration. A history request returns current and older snapshots. A time-range request pages through changes across current and history records.
Profile and test result requests use timestamp ranges instead of governed entity versions. Profile reads can return table, column, or system observations. Column profiles are masked when the caller lacks permission to view sensitive data. Incident history uses timestamp-and-ID cursors and skips orphaned records whose parent test case no longer exists.
References: openmetadata-service/…/EntityDAO.java• L192-220 openmetadata-service/…/EntityProfileRepository.java• L42-59 openmetadata-service/…/EntityProfileRepository.java• L151-165 openmetadata-service/…/TestCaseResolutionStatusRepository.java• L267-333
Workflow and activity state
Workflow instance state records stage execution and outcomes. Activity stream state records user-facing events and reactions. Neither is the governed entity version.
Tasks are the durable work record for approvals, data access, incidents, and other governed actions. A task can be reopened only when its task type allows it. A resolved test incident is final; a later test failure creates a new incident. Legacy incident status writes can drive the task workflow, while task transitions can write a matching time-series status record.
References: openmetadata-service/…/TaskRepository.java• L1020-1085 openmetadata-service/…/TestCaseResolutionStatusRepository.java• L727-785 openmetadata-service/…/TestCaseResolutionStatusRepository.java• L1074-1140
Persistence and downstream state
Persistence separates the current entity document from relationship edges, extensions, history, and time-series data. The entity document stores the attributes needed to rebuild the entity. Relationship fields and response-only views are restored during reads.
Transaction boundary
The domain layer writes current state, extensions, and relationships in a database transaction. Deadlock retry repeats the complete unit of work in a fresh transaction. Bulk create and large delete paths use bounded work units to limit lock time and memory use.
Cache invalidation, search, RDF, lineage, activity, audit, and repair work wait until commit or rollback is known. External systems converge from committed rows. A result, profile, or incident observation can refresh a projection without changing the governed entity’s version.
Credentials and settings use stricter boundaries. Service and pipeline secrets are encrypted during storage and protected while ownership changes. Runtime values are masked in responses, history, and events where needed.
References: openmetadata-service/…/EntityRepository.java• L355-377 openmetadata-service/…/EntityRepository.java• L6318-6358 openmetadata-service/…/TestCaseResolutionStatusRepository.java• L623-647
Entity storage
Normal entity types have a current record and a type-specific data access definition. JSON holds core attributes. Relationship and extension stores hold shared, inherited, or separately managed state. Time-series stores hold observations that are not part of the current entity document.
Tables keep sample data, profiler settings, pipeline observability, custom metrics, and column extensions outside the main record. Profiles store table, column, and system measurements by timestamp. Ontology releases keep member payloads beside the release row, while concept bindings keep asset associations in their own rows.
Tasks store their core payload in JSON and keep participants, domains, creator, and target as relationships. Incident status records keep a parent relationship to the test case. Test results keep dimensional results separate from the main result so both the latest summary and detailed history can be served.
References: openmetadata-service/…/TableRepository.java• L627-694 openmetadata-service/…/EntityProfileRepository.java• L61-89 openmetadata-service/…/OntologyReleaseDAO.java• L219-258 openmetadata-service/…/TaskRepository.java• L637-677 openmetadata-service/…/TestCaseResultRepository.java• L438-461
Cache and index visibility
Reads can use local and distributed caches. Writes invalidate ID, FQN, relationship, read-bundle, and lineage views that may contain old state. Cache loaders read outside the cache lock and compare a write epoch before installing a value, so a read that races a write cannot publish stale state.
Search and graph projection failures remain repair or retry work after commit. A fresh-read scope bypasses cached state when workflow, approval, or gate logic needs the current record. FQN cleanup and projection refreshes use entity type and ownership boundaries so a shared name does not remove or overwrite a surviving entity’s view.
References: openmetadata-service/…/EntityRepository.java• L396-448 openmetadata-service/…/EntityRepository.java• L486-501 openmetadata-service/…/FqnKeyedRowCleanup.java• L94-125 openmetadata-service/…/TestCaseResultRepository.java• L383-397
Change checklist
When these files or sections are changed, remember to consider these:
- Keep preparation rules aligned across direct, patch, bulk, import, restore, and approval paths. A rule in one path can leave invalid lifecycle or relationship state in another.
- Keep partial-read baselines complete for relationship-backed fields, child schema, extraction state, machine status, persona rules, and credentials before a replace or patch.
- Keep relationship kind separate from ownership. Task target, membership, binding, and containment edges must not gain an unintended delete cascade.
- Keep task status groups, duplicate-request checks, workflow transitions, and incident status records on the same terminal-state contract.
- Keep time-series latest-row projections protected against older observations and concurrent entity updates.
- Keep ontology working fields, release members, active-release serving reads, and operational bindings as separate contracts.
- Keep FQN cleanup identity-aware across entity types, nested assets, inline fields, tags, conversations, caches, and search.
- Keep task cursors tied to the selected timestamp and ID order. Do not reuse name cursors for timestamp-ordered lists.
- Keep deferred effects tied to the final committed transaction and clear them after rollback or retry.
- Keep secrets and sensitive profiles encrypted or masked before storage, history, change events, cache values, and external projections.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A cache loader installs a value after a concurrent entity write | A read serves stale entity state until eviction | Compare the read epoch before caching and discard raced loads |
| A task list uses a name cursor for timestamp ordering | Pages skip or repeat tasks when IDs and creation time differ | Encode the selected timestamp and ID in the cursor |
| A test result older than the newest result updates the test case | The entity shows an old status or reopens an old incident | Compare timestamps before incident handling and status refresh |
| A partial entity write treats derived ontology or relationship fields as client state | Server-derived hierarchy, lifecycle, or links are overwritten | Strip derived fields and reject patches to them |
| A hard delete removes every row sharing an FQN hash | Tags or field links for another entity type disappear | Check entity ownership and preserve namesake or field-holder rows |
| A concept binding survives concept deletion without refreshing assets | Serving projections keep a deleted semantic link | Read affected bindings before deletion, remove rows, and refresh assets |
| A resolved incident is reopened through a legacy status write | One incident has multiple active workflows or histories | Reject reopening and create a new incident on a later failure |
| A task takes domains from its author instead of its target | Domain isolation returns a task in the wrong scope | Rebuild task domains from the target entity on every write |
| A profile or column result is returned without PII masking | Sensitive values leave the server to an unauthorized caller | Apply profile masking after time-series reads |
| A downstream projection runs before commit | Search or graph state describes a write that rolled back | Defer projection work until commit is known |
Key files
| File | Why to read it |
|---|---|
| openmetadata-service/…/EntityRepository.java | Defines the shared preparation, create, update, read, version, delete, restore, cache, and transaction lifecycle. |
| openmetadata-service/…/TableRepository.java | Shows hierarchical asset reads, inherited fields, extensions, profiles, and table-specific relationships. |
| openmetadata-service/…/TaskRepository.java | Shows task identity, target relationships, domain inheritance, workflow state, and activity changes. |
| openmetadata-service/…/FeedDAOs.java | Defines task persistence, target-FQN repointing, task counts, and list query boundaries. |
| openmetadata-service/…/TaskListOrder.java | Defines timestamp-based task list ordering and cursor semantics. |
| openmetadata-service/…/PersonaRepository.java | Shows validated context definitions, user assignments, default persona changes, and context cache invalidation. |
| openmetadata-service/…/EntityProfileRepository.java | Shows profile observations, typed profile data, timestamp storage, and PII masking. |
| openmetadata-service/…/TestCaseResultRepository.java | Shows newest-result projection, dimensional result storage, incident linking, and race-safe status refresh. |
| openmetadata-service/…/TestCaseResolutionStatusRepository.java | Shows incident history, task-first status transitions, parent relationships, and orphan handling. |
| openmetadata-service/…/OntologyConceptRepository.java | Shows derived ontology hierarchy, lifecycle reads, binding cleanup, and deletion impact checks. |
| openmetadata-service/…/OntologyConceptBindingDAO.java | Shows the separate contract for concept-to-asset and concept-to-column bindings. |
| openmetadata-service/…/OntologyReleaseDAO.java | Shows retained release members, active-release reads, sealing, publication events, and release history. |
| openmetadata-service/…/FqnKeyedRowCleanup.java | Shows ownership-aware cleanup for FQN-keyed tag and field rows during hard delete. |
| openmetadata-service/…/ListFilter.java | Shows the shared filter contract for lifecycle states, ontology scope, task scope, and time-dependent lists. |