Docs / Contact / services/validation-rules

Validation Rules

Services use validation rules to check message data. Each rule applies an operator to a specific field in the message payload.

Rule Format

Each rule consists of:

Available Operators

Equality

Operator Description Example
eq Equal to temperature eq 22.5
ne Not equal to status ne "error"

Comparison

Operator Description Example
gt Greater than temperature gt 0
lt Less than temperature lt 100
ge Greater than or equal count ge 1
le Less than or equal humidity le 100
between Within a range (inclusive) temperature between [-50, 150]

String

Operator Description Example
startsWith Starts with substring device_id startsWith "SN-"
endsWith Ends with substring filename endsWith ".json"
contains Contains substring name contains "sensor"

Set Membership

Operator Description Example
in Value is in the set unit in ["C", "F", "K"]
notIn Value is not in the set status notIn ["disabled", "deleted"]
hasAll Array contains all values tags hasAll ["active", "monitored"]
hasAny Array contains at least one capabilities hasAny ["mqtt", "http"]

Type

Operator Description Example
isTimestamp Value is a valid timestamp created_at isTimestamp true

Rule Evaluation

Validation is passive, not blocking

Failing validation does not reject the message. The message is still stored regardless of outcome; it is simply marked validation_status: "failed", with the per-rule results attached as actionResults. To handle failures, route on the tags the failing dynamic action injects (see Creating Services) rather than expecting an error response.

Next Steps