Docs / Contact / services/creating-services

Creating Services

Build services with validation rules to enforce data quality for your entities.

Create a New Service#

  1. Navigate to Services in the sidebar
  2. Click Create Service
  3. Provide a name for the service (e.g., "Temperature Sensor", "Motion Detector")
  4. Add validation rules for each expected field
  5. Save the service

Adding Validation Rules#

The service rule builder: a list of saved rules above the Field, Operator, and Value inputs for adding another Each saved rule reads back as Field · Operator · Value; the builder below adds another.

Each rule consists of:

A service holds one or more dynamic actions. Each carries its own rules, optional requiredFields, and tags. Every dynamic action is evaluated against every publish message the entity sends: the name labels the results, it does not select which messages the action applies to. Rules live inside a dynamic action; a top-level rules array is not part of the service shape and is ignored.

Example: Weather Station#

Field Operator Value
temperature between [-50, 60]
humidity between [0, 100]
pressure between [300, 1100]
station_id startsWith "WS-"

JSON Example#

json

{
  "name": "Weather Station",
  "dynamicActions": [
    {
      "name": "message:weather:reading",
      "requiredFields": ["temperature", "humidity"],
      "rules": [
        { "field": "temperature", "operator": "between", "value": [-50, 60], "message": "Temperature out of range" },
        { "field": "humidity", "operator": "between", "value": [0, 100], "message": "Humidity out of range" },
        { "field": "pressure", "operator": "between", "value": [300, 1100], "message": "Pressure out of range" },
        { "field": "station_id", "operator": "startsWith", "value": "WS-", "message": "Station ID must start with WS-" }
      ],
      "tags": ["weather-invalid"]
    }
  ]
}

Per dynamic action:

Validation is passive

Validation never rejects a message. A message that fails its rules is still stored: it is marked validation_status: "failed" and the per-rule outcomes are attached as actionResults. To act on failures, route on the action's injected tags rather than expecting a rejected request. See Validation Rules.

Assigning a Service to an Entity#

  1. Navigate to Entities
  2. Edit the entity
  3. Select the service from the Service dropdown
  4. Save

All subsequent messages from that entity will be validated against the service's rules.

Editing a Service#

  1. Navigate to Services
  2. Click the service name to open its detail page
  3. Modify rules as needed
  4. Save
Info

Changes to a service take effect immediately for all entities using that service. Existing messages are not re-validated.

Deleting a Service#

  1. Clear the Service field on every entity that references the service
  2. Navigate to Services
  3. Click Delete on the service
  4. Confirm the deletion

While any entity still references the service, the delete is refused with 409 and the message Service is in use by one or more entities. There is no fallback to a default service.

Next Steps#