Tenant Attributes
Use this node to inject tenant-level configuration into messages — for example, fetching a tenant-wide alertEmail server attribute or a global threshold that applies to all devices in the tenant. This is useful when you want to avoid duplicating configuration across many device profiles or customer attributes.
Configuration
Section titled “Configuration”- Mapping type — what to fetch from the tenant:
Attributes— fetches server-side attributes.Latest telemetry— fetches the latest time series value.
- Attributes/Latest telemetry mapping — a list of source → target key pairs:
- Source key — the attribute or telemetry key on the Tenant entity. Supports templatization — use
${metadataKey}or$[dataKey]. - Target key — the key to write the value under in the outgoing message. Also supports templatization.
- Source key — the attribute or telemetry key on the Tenant entity. Supports templatization — use
- Add mapped data to — destination for the fetched values:
Message— adds to message data. Fails if message data is not a valid JSON object.Metadata— adds to message metadata.
Message processing algorithm
Section titled “Message processing algorithm”- Identify the Tenant associated with the message originator.
- Resolve templates in source and target key names using message data and metadata.
- Fetch the specified attributes or latest telemetry from the Tenant entity asynchronously.
- Add the fetched key–value pairs to message data or metadata per the destination setting.
- Forward via
Success. Route viaFailureon error (e.g., data destination isMessagebut payload is not a JSON object).
Output connections
Section titled “Output connections”| Connection | Condition |
|---|---|
Success | Message enriched successfully. |
Failure | Error occurred — for example, Message destination selected but message data is not a valid JSON object. |
Examples
Section titled “Examples”Example 1 — Tenant attribute to metadata
Section titled “Example 1 — Tenant attribute to metadata”{ "dataToFetch": "ATTRIBUTES", "fetchTo": "METADATA", "dataMapping": { "exampleSourceKey": "exampleTargetKey" }}Tenant has server attribute exampleSourceKey = "exampleValue". Outgoing metadata gains "exampleTargetKey": "exampleValue".
Example 2 — Tenant attribute to message data (dynamic source key)
Section titled “Example 2 — Tenant attribute to message data (dynamic source key)”Device type is boiler. Tenant has server attribute boilerSourceKey = "exampleValue".
{ "dataToFetch": "ATTRIBUTES", "fetchTo": "DATA", "dataMapping": { "${deviceType}SourceKey": "exampleTargetKey" }}${deviceType} resolves to boiler → fetches boilerSourceKey → adds "exampleTargetKey": "exampleValue" to message data.
JSON schema
Section titled “JSON schema”{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "TbGetTenantAttributeNodeConfiguration", "type": "object", "required": ["dataToFetch", "fetchTo", "dataMapping"], "additionalProperties": false, "properties": { "dataToFetch": { "type": "string", "enum": ["ATTRIBUTES", "LATEST_TELEMETRY"] }, "fetchTo": { "type": "string", "enum": ["DATA", "METADATA"] }, "dataMapping": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Map of source key on the tenant to target key in the message." } }}