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 dynamic action targets a kind of message (by name) and carries its own rules, optional requiredFields, and tags. 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. Navigate to Services
  2. Click Delete on the service
  3. Confirm the deletion

Entities that were using the deleted service will fall back to the default service (if configured) or accept messages without validation.

Next Steps