Events Reference

Events are data payloads published by devices. Each device definition declares the event types it can emit, along with the schema for each event’s payload. Events flow from devices through RabbitMQ to Vesbite, where they can trigger workflows or be viewed in the UI.

Event Structure

Every event defined on a device has the following properties:

PropertyTypeDescription
namestringMachine-readable identifier (e.g., tagread)
displayNamestringHuman-readable label shown in the UI (e.g., “Tag Read”)
descriptionstringExplanation of what this event represents
payloadSchemaJSONJSON Schema describing the event’s data fields

Event Flow

Device              RabbitMQ                 Vesbite Server          Workflows
  |                    |                          |                      |
  |-- publish event -->|                          |                      |
  |                    |-- route to queue -------->|                      |
  |                    |                          |-- publish MassTransit |
  |                    |                          |   DeviceEvent ------->|
  |                    |                          |                      |-- trigger matching
  |                    |                          |                      |   workflow instances
  1. The device publishes an event to RabbitMQ on the topic exchange vesbite.devices with routing key devices.{deviceId}.events.{eventType}.
  2. The Vesbite event listener consumes the message from the vesbite-device-events queue.
  3. The listener extracts the tenantId and payload from the message, wraps them in a DeviceEvent, and publishes it to MassTransit.
  4. Any workflow with a matching Device Event trigger evaluates and, if conditions are met, begins execution.

Event Payload Envelope

The raw message the device publishes contains an envelope:

{
  "tenantId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "deviceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "payload": {
    "epc": "E2801170000002145A8B6021",
    "rssi": -52,
    "antenna": 1
  }
}

The payload field contains the event-specific data defined by the device’s payloadSchema. Vesbite extracts this inner payload before passing it to workflows.

Common RFID Reader Events

tagread

Emitted when a single RFID tag is read by the reader.

Payload:

FieldTypeDescription
epcstringElectronic Product Code of the tag
tidstringTag Identifier (unique hardware ID)
rssinumberReceived Signal Strength Indicator in dBm
antennanumberAntenna port number that read the tag
readCountnumberNumber of times this tag was seen in the reporting interval
timestampstringISO 8601 timestamp of the read

Example payload:

{
  "epc": "E2801170000002145A8B6021",
  "tid": "E2801170200060A714011811",
  "rssi": -52,
  "antenna": 1,
  "readCount": 3,
  "timestamp": "2026-03-20T10:30:00.123Z"
}

tagreads

Emitted as a batch when the reader reports multiple tags at once. This is the more common event for high-throughput reading.

Payload:

FieldTypeDescription
tagsarrayArray of tag read objects
tags[].epcstringElectronic Product Code
tags[].tidstringTag Identifier
tags[].rssinumberSignal strength in dBm
tags[].antennanumberAntenna port number
tags[].readCountnumberRead count in reporting interval
countnumberTotal number of tags in this batch
timestampstringISO 8601 timestamp of the batch

Example payload:

{
  "tags": [
    { "epc": "E2801170000002145A8B6021", "tid": "E2801170200060A714011811", "rssi": -52, "antenna": 1, "readCount": 3 },
    { "epc": "E280117000000214CC405F22", "tid": "E2801170200060A714011812", "rssi": -48, "antenna": 2, "readCount": 1 }
  ],
  "count": 2,
  "timestamp": "2026-03-20T10:30:01.000Z"
}

gpiochange

Emitted when a General Purpose Input (GPI) pin changes state.

Payload:

FieldTypeDescription
pinnumberGPI pin number
statebooleantrue for high, false for low
previousStatebooleanPrevious state of the pin
timestampstringISO 8601 timestamp of the state change

Example payload:

{
  "pin": 1,
  "state": true,
  "previousState": false,
  "timestamp": "2026-03-20T10:30:05.000Z"
}

Consuming Events in Workflows

As a Trigger

Add a Device Event trigger node to your workflow. Select the device definition and event type. When that event fires, the workflow starts and the event payload is available as the trigger’s output.

Optionally filter to a specific device by selecting it in the Device dropdown. Leave it empty to trigger on events from any device of that type.

Accessing Event Data

In downstream workflow nodes, access the event payload via expressions:

{{ output("triggerActivityId").epc }}
{{ output("triggerActivityId").rssi }}
{{ output("triggerActivityId").antenna }}

For batch events:

{{ output("triggerActivityId").tags }}
{{ output("triggerActivityId").count }}

The trigger output contains the unwrapped payload fields directly – there is no extra payload wrapper in the expression context.

See Also