Defining relationship types
Relationship types allow you to define, manage, and visualize relationships between entities within your Cortex workspace, ensuring your organization's structures and dependencies are accurately represented.
Understanding relationship types in Cortex
A relationship type defines how two entities relate to either other, and constrains the types of entities that can be the source and destination entities within the relationship.
Cortex provides multiple options for defining a relationship:
Entity relationship: As described on this page, you can customize a relationship type (hierarchical or cyclical) between any entity type.
Domain hierarchy: You can define a hierarchical relationship between domain entities. You can also configure inheritance; the owner of an entity can be inherited from entities higher in the domain hierarchy. Learn more in Add domains.
Dependencies: You can define a cyclical relationship between non-team entities. Learn more in Defining dependencies.
Common use cases of custom relationship types
Repository
Mapping services to repositories to view the hierarchy of repos and the services they contain. For example, a service is linked to its code repository.
Service
Repository
Cloud account to resource
Associating cloud accounts (like AWS, Google Cloud Project, or Azure subscription) with their respective resources (such as EC2 instances or other cloud resources).
AWS account
GCP
Azure subscription
AWS resources (e.g., EC2)
Google Cloud resources
Azure resources
Service to environment
Linking services to their deployment environments.
Service
Environment
Monorepo
Mapping multiple services to a single repository.
Repository
Service
Service to endpoint
Associating services with their endpoints.
Service
Endpoint
Data center modeling
epresenting data centers and their relationships to other infrastructure components.
Data center
Component
Note that you should not create custom relationship types to represent ownership; teams can be designated as owners of entities.
View relationship types
View all configured relationship types
To view all relationship types, go to Catalogs > All entities then click the Relationship types tab.

To view the details of a specific relationship type, click its name from the list.
View relationships on entity pages
If an entity is part of a relationship, you can view this information on its entity details page. Click Relationships in the left sidebar to see the different relationship types that the entity belongs to.
In the example entity below, there are three destination entities in an "App Components" relationship:

Manage relationship types
Create relationship types and relationship connections
Create relationship types in the Cortex UI
Navigate to Catalogs > All entities then click the Relationship types tab.
In the upper right corner, click Create > Create new relationship type. \

Configure the details and entity types:
Name: Enter a name for the relationship type.
Identifier: Enter a unique identifier, used to specify this relationship in YAML definitions for this relationship type.
Description: Add a description of the relationship to help others understand its purpose.
Create relationship type catalog: Enable this option to create a catalog for this relationship type.
Source entity types: Search for and select the entity types which will be the source for this relationship. Selecting no entity type means that all entity types are available as sources.
You can also customize the singular and plural wording of the entity types and the cardinality.
Destination entity types: Search for and select the entity types which will be the destination for this relationship. Selecting no entity type means that all entity types are available as destinations.
You can also customize the singular and plural wording of the entity types and the cardinality.
Configure the relationship constraints:
Architecture: If you are configuring hierarchical data, such as an org chart, we recommend choosing Acyclical. If you are configuring graph-like data, such as dependencies, we recommend choosing Cyclical.
Definition location: Configure where relationships can be defined — from destination entities, from source entities, or from either.
Configure metadata inheritance.
Enable the Ownership toggle to configure inheritance for the relationship type, then select how metadata will be inherited:
Fallback: This option uses the source's data only if the destination does not have anything defined.
Append: This option appends the source's data to the destination, even if it already has data defined.
Learn more about inheritance in Defining ownership.
Click Create.
Create relationship connections between entities in the UI
After creating the relationship type, you can configure connections between entities in a relationship. You can do this via the entity descriptor or in the UI, as described below:
Navigate to an entity details page. In the upper right corner, click Configure entity.
Click the Relationships link on the left.
At the top of the Relationship Type section, click the dropdown to select which relationship type you are configuring connections for.\

After selecting the relationship type, you can search for and select entities in the Sources dropdown and in the Destinations dropdown.

At the bottom of the page, click Save changes.
Create relationship connections between entities in the entity descriptor
Relationship types must be created in the Cortex UI or via the API. You can configure relationship connections between entities in the entity YAML.
In a source entity's YAML, you can use the x-cortex-relationships tag to define its destination entities.
In the example below, a source entity's YAML has a defined relationship type called app-components and has destination entities production-ui and backend-app.
x-cortex-relationships:
- type: app-components
destinations:
- tag: production-ui
- tag: backend-appThe relationship between entities in Cortex is based on the relationship being defined in the entity's YAML file; Cortex does not set hierarchies or relationships based on a YAML file's location in your repository.
Create relationship types via the API
Documentation is coming soon for managing relationship types via the Cortex API. Please reach out to your Cortex Customer Success Manager with any questions.
Edit relationship types
Delete relationship types
Entity relationship CQL
You can create Scorecard rules and write CQL queries based on entity relationships.
See more examples in the CQL Explorer in Cortex.
Last updated
Was this helpful?

