Delete Relation
Use this node to clean up entity graph edges at runtime — for example, removing a device’s LocatedIn relation when it is moved to a new location, or clearing all ConnectedTo relations from a gateway that goes offline. The relation type and target entity identifier support templatization.
Configuration
Section titled “Configuration”- Direction — required. The direction of relations to delete relative to the message originator:
From originator— relations where the originator is thefromentity.To originator— relations where the originator is thetoentity.
- Relation type — required. The type of relation(s) to delete. Supports templatization.
- Delete relation with specific entity — toggle:
- Enabled — delete only the relation between the originator and a specific target entity (configured below).
- Disabled — delete all relations of the specified type and direction involving the originator.
When targeting a specific entity:
- Type — entity type of the target. Supported:
TENANT,DEVICE,ASSET,CUSTOMER,ENTITY_VIEW,DASHBOARD,USER,EDGE,CONVERTER,ROLE. - Entity identifier — name, title, or email of the target entity (depends on type). Supports templatization.
TENANTrequires no identifier.
Message processing algorithm
Section titled “Message processing algorithm”- Resolve the relation type by substituting patterns from message data and metadata.
- If Delete relation with specific entity is enabled:
- Resolve the target entity identifier.
- Look up the target entity. If not found, route via
Failure. - Delete the specific relation between the originator and the target.
- If Delete relation with specific entity is disabled:
- Delete all relations of the specified type and direction involving the originator.
- Route via
Successon completion, orFailureon error.
Output connections
Section titled “Output connections”| Connection | Condition |
|---|---|
Success | Relation(s) deleted successfully. |
Failure | Target entity not found, or an unexpected error occurred. |
Examples
Section titled “Examples”Example 1 — Delete all relations of a type
Section titled “Example 1 — Delete all relations of a type”{ "direction": "FROM", "relationType": "Contains", "deleteForSingleEntity": false}State: originator has Contains relations to devices A, B, and C; also a Uses relation to asset D.
Result: all Contains relations deleted. Uses relation preserved.
Example 2 — Delete specific relation using patterns
Section titled “Example 2 — Delete specific relation using patterns”Incoming data: { "targetAssetName": "Building" } | Metadata: { "relationType": "LocatedIn" }
{ "direction": "FROM", "relationType": "${relationType}", "deleteForSingleEntity": true, "entityType": "ASSET", "entityNamePattern": "$[targetAssetName]"}Result: only the LocatedIn relation between the originator device and asset Building is deleted.
Example 3 — Delete relation with current tenant
Section titled “Example 3 — Delete relation with current tenant”{ "direction": "TO", "relationType": "Owns", "deleteForSingleEntity": true, "entityType": "TENANT"}Result: the Owns relation from the tenant to the originator is deleted. No entity identifier is needed.
Example 4 — Target entity not found → Failure
Section titled “Example 4 — Target entity not found → Failure”{ "direction": "FROM", "relationType": "Contains", "deleteForSingleEntity": true, "entityType": "ASSET", "entityNamePattern": "nonexistent_asset"}Result: no asset named nonexistent_asset — routes via Failure. No relations modified.
JSON schema
Section titled “JSON schema”{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "TbDeleteRelationNodeConfiguration", "type": "object", "properties": { "direction": { "type": "string", "enum": ["FROM", "TO"] }, "relationType": { "type": "string" }, "deleteForSingleEntity": { "type": "boolean" }, "entityType": { "type": "string", "enum": ["TENANT", "DEVICE", "ASSET", "CUSTOMER", "ENTITY_VIEW", "DASHBOARD", "USER", "EDGE", "CONVERTER", "ROLE"] }, "entityNamePattern": { "type": "string" } }}