Check Fields Presence
Use this node to guard downstream processing against messages that are missing required fields. For example, before saving attributes you can verify that both firmware_version and serial_number are present in the payload, or that a token metadata key exists before making an authenticated API call.
Configuration
Section titled “Configuration”- Message field names — optional. A set of top-level JSON field names to check in the message data.
- Metadata field names — optional. A set of metadata key names to check in the message metadata.
At least one of the two lists must contain at least one entry.
- Check that all specified fields are present — toggle (default: enabled).
- Enabled: route
Trueonly if all listed fields are present in both data and metadata. - Disabled: route
Trueif at least one listed field exists anywhere in data or metadata.
- Enabled: route
Message processing algorithm
Section titled “Message processing algorithm”- Extract message data as a JSON object and metadata as key–value pairs.
- Evaluate presence based on the toggle:
- All fields required: route
Trueif every field inmessageNamesexists in data and every field inmetadataNamesexists in metadata. - Any field sufficient: route
Trueif any listed field exists in data or metadata.
- All fields required: route
- If the condition is not satisfied, route
False. - If the payload is not a JSON object or another error occurs, route
Failure.
Output connections
Section titled “Output connections”| Connection | Condition |
|---|---|
True | The configured presence condition is satisfied. |
False | The configured presence condition is not satisfied. |
Failure | The message data cannot be parsed as a JSON object, or an unexpected error occurred. |
Examples
Section titled “Examples”Example 1 — All required data fields present → True
Section titled “Example 1 — All required data fields present → True”{ "messageNames": ["temp", "humidity"], "metadataNames": [], "checkAllKeys": true}Incoming data: { "temp": 22.5, "humidity": 55 }
Result: True — both temp and humidity exist.
Example 2 — Missing one required field → False
Section titled “Example 2 — Missing one required field → False”{ "messageNames": ["temp", "humidity"], "metadataNames": [], "checkAllKeys": true}Incoming data: { "temp": 22.5 }
Result: False — humidity is absent.
Example 3 — At least one metadata field → True
Section titled “Example 3 — At least one metadata field → True”{ "messageNames": [], "metadataNames": ["token", "tenantId"], "checkAllKeys": false}Incoming metadata: { "deviceName": "Pump-42", "token": "abc123" }
Result: True — token is present.
Example 4 — Mixed check, data field present → True
Section titled “Example 4 — Mixed check, data field present → True”{ "messageNames": ["temperature"], "metadataNames": ["token", "tenantId"], "checkAllKeys": false}Incoming data: { "temperature": 123, "humidity": 42 }
Incoming metadata: { "deviceName": "Sensor-1" }
Result: True — temperature is found in data.
Example 5 — Non-object payload → Failure
Section titled “Example 5 — Non-object payload → Failure”{ "messageNames": ["temp"], "metadataNames": [], "checkAllKeys": true}Incoming data: "not a JSON object"
Result: Failure — data cannot be parsed as a JSON object.
JSON schema
Section titled “JSON schema”{ "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "TbCheckMessageNodeConfiguration", "type": "object", "additionalProperties": false, "properties": { "messageNames": { "description": "Field names to check in the message data.", "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }, "metadataNames": { "description": "Field names to check in the message metadata.", "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }, "checkAllKeys": { "description": "If true, require all listed fields. If false, require at least one.", "type": "boolean", "default": true } }, "anyOf": [ { "properties": { "messageNames": { "minItems": 1 } } }, { "properties": { "metadataNames": { "minItems": 1 } } } ]}