State Machines

Define finite state machines per entity type. Transitions fire on data conditions, with entry/exit actions and full audit trail. Integrates with the Kanban pane for visual tracking.

StateMachineSpec

yaml StateMachineSpec auto-generated

Field Type Default Description
id* String State machine identifier.
initial String "" Initial state ID.
states Vec<SmState> [] All states.
transitions Vec<TransitionSpec> [] All transitions.

TransitionSpec

  • from / to: Source and destination StateId
  • condition: Data-driven trigger (field comparisons, expressions)
  • entry_actions: Actions on entering the destination state
  • exit_actions: Actions on leaving the source state
  • Actions: SendAlert, SetField, CallWebhook, LogEvent

Kanban Integration

Each state maps to a Kanban column. Entities move between columns automatically as transitions fire. Manual drag-and-drop triggers forced transitions with audit logging.

Audit Trail

Every transition is recorded with timestamp, entity ID, from/to states, trigger condition, and user (if manual). Stored in ClickHouse state_transitions table.

YAML Example

YAML
state_machines:
  - name: hvac_unit_lifecycle
    initial_state: idle
    states:
      - id: idle
        label: Idle
        color: "#6b7280"
      - id: heating
        label: Heating
        color: "#ef4444"
      - id: cooling
        label: Cooling
        color: "#3b82f6"
      - id: fault
        label: Fault
        color: "#f59e0b"
    transitions:
      - from: idle
        to: heating
        condition: { field: demand, op: Gt, value: 0.5 }
        entry_actions:
          - SendAlert: { severity: Info, message: "Unit heating" }
      - from: heating
        to: fault
        condition: { field: temp_delta, op: Lt, value: -2.0 }
        entry_actions:
          - SendAlert: { severity: Critical, message: "Heating fault" }
          - CallWebhook: { url: "https://ops.example.com/fault" }
      - from: fault
        to: idle
        condition: { type: Manual }

Questions?

Reach out for help with integration, deployment, or custom domain codecs.