Check Relation Presence
Use this node to branch processing based on whether a relation exists between the message originator and another entity. For example, you can check whether a device Contains a specific asset before triggering an action, or verify that any Manages relation exists from the originator before applying a policy.
Configuration
Section titled “Configuration”Relation search parameters
Section titled “Relation search parameters”- Direction — required. The direction of the relation relative to the message originator:
From originatororTo originator. - Relation type — required. The type of relation to match (e.g.,
Contains,Manages). - Check relation to specific entity — toggle.
- Enabled: the node checks for a relation matching the configured direction and type that points to a specific entity. Two additional fields appear:
- Type — required. The entity type of the target (e.g.,
DEVICE,ASSET,CUSTOMER). - Entity selector — required. Select the specific target entity by name.
- Type — required. The entity type of the target (e.g.,
- Disabled: the node checks for any relation matching the configured direction and type, regardless of the target entity.
- Enabled: the node checks for a relation matching the configured direction and type that points to a specific entity. Two additional fields appear:
Message processing algorithm
Section titled “Message processing algorithm”- If Check relation to specific entity is enabled:
- Search for a direct relation that matches the configured direction, type, and target entity.
- If found, route via
True; otherwise, route viaFalse.
- If Check relation to specific entity is disabled:
- Search for any direct relation that matches the configured direction and type.
- If at least one matching relation exists, route via
True; otherwise, route viaFalse.
Output connections
Section titled “Output connections”| Connection | Condition |
|---|---|
True | A matching relation was found. |
False | No matching relation was found. |
Failure | An unexpected error occurred during processing. |
Examples
Section titled “Examples”Example 1 — Relation to specific entity exists → True
Section titled “Example 1 — Relation to specific entity exists → True”{ "direction": "FROM", "relationType": "Contains", "checkForSingleEntity": true, "entityType": "ASSET", "entityId": "8c67e3b0-1234-4e9a-9b8c-781be214172f"}State: a Contains relation exists from the originator to the specified asset.
Result: True.
Example 2 — Relation to specific entity does not exist → False
Section titled “Example 2 — Relation to specific entity does not exist → False”{ "direction": "FROM", "relationType": "Manages", "checkForSingleEntity": true, "entityType": "ASSET", "entityId": "3b4f2d90-7891-4b2d-88d7-d3cfb90ec501"}State: no Manages relation from the originator to the specified asset.
Result: False.
Example 3 — Any matching relation exists → True
Section titled “Example 3 — Any matching relation exists → True”{ "direction": "FROM", "relationType": "Connected", "checkForSingleEntity": false}State: the originator has at least one Connected relation in the FROM direction.
Result: True.
Example 4 — No matching relation → False
Section titled “Example 4 — No matching relation → False”{ "direction": "TO", "relationType": "Contains", "checkForSingleEntity": false}State: no Contains relations in the TO direction exist for the originator.
Result: False.
Example 5 — Multi-level relation is not considered → False
Section titled “Example 5 — Multi-level relation is not considered → False”{ "direction": "FROM", "relationType": "Contains", "checkForSingleEntity": true, "entityType": "DEVICE", "entityId": "de305d54-75b4-431b-adb2-eb6b9e546013"}State: the originator has a Contains relation to an intermediate asset, which in turn has a Contains relation to the target device — but no direct relation from the originator to the device.
Result: False — only direct relations are checked.
JSON schema
Section titled “JSON schema”{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "TbCheckRelationNodeConfiguration", "type": "object", "additionalProperties": false, "required": ["direction", "relationType", "checkForSingleEntity"], "properties": { "direction": { "type": "string", "description": "Direction of the relation relative to the originator.", "enum": ["FROM", "TO"] }, "relationType": { "type": "string", "description": "Type of the relation to match." }, "checkForSingleEntity": { "type": "boolean", "description": "When true, the relation must match a specific target entity." }, "entityType": { "type": "string", "description": "Type of the target entity. Required if 'checkForSingleEntity' is true." }, "entityId": { "type": "string", "format": "uuid", "description": "UUID of the specific target entity. Required if 'checkForSingleEntity' is true." } }}