Actions Reference

Actions are commands sent from Vesbite to a device. Each device definition declares the actions it supports, including the parameters each action accepts and the shape of its response. Actions are delivered to devices over RabbitMQ using routing keys of the form devices.{deviceId}.actions.{actionName}.

Action Structure

Every action defined on a device has the following properties:

PropertyTypeDescription
namestringMachine-readable identifier (e.g., startreading)
displayNamestringHuman-readable label shown in the UI (e.g., “Start Reading”)
descriptionstringExplanation of what the action does
requestSchemaJSONJSON Schema describing the parameters the action accepts
responseSchemaJSONJSON Schema describing the data the action returns

How Actions Are Invoked

From the Device Page

  1. Navigate to Devices and select a device.
  2. Open the Actions tab.
  3. Choose an action from the list.
  4. Fill in any required parameters.
  5. Click Execute.

From a Workflow

Add an Invoke Device Action node to your flow. Select the target device and action, then configure the parameters. Parameters support Vex expressions for dynamic values.

Via the API

Send an InvokeDeviceAction command through the API gateway. The request is routed to the Devices service, which publishes it to RabbitMQ with the routing key devices.{deviceId}.actions.{actionName}.

Request Format

When an action is invoked, Vesbite publishes the following payload to RabbitMQ:

{
  "deviceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "action": "startreading",
  "parameters": {
    "duration": 30,
    "antennas": [1, 2]
  }
}

The parameters field matches the action’s requestSchema. If the action accepts no parameters, this field is null.

Response Format

The device replies with a structured response:

{
  "success": true,
  "result": {
    "startedAt": "2026-03-20T10:30:00Z",
    "activeAntennas": [1, 2]
  },
  "error": null
}

On failure:

{
  "success": false,
  "result": null,
  "error": "Reader is already in an active reading session"
}

If the device does not respond within 30 seconds, the action times out and returns:

{
  "success": false,
  "result": {},
  "error": "Request timed out"
}

Common RFID Reader Actions

startreading

Begins an inventory session on the reader.

Parameters:

ParameterTypeRequiredDescription
durationnumberNoDuration in seconds. Omit for continuous reading.
antennasarrayNoAntenna port numbers to use (e.g., [1, 2]). Omit for all.

Response:

FieldTypeDescription
startedAtstringISO 8601 timestamp when reading began
activeAntennasarrayAntenna ports activated

Example:

// Request
{ "duration": 60, "antennas": [1, 2, 3, 4] }

// Response
{ "startedAt": "2026-03-20T10:30:00Z", "activeAntennas": [1, 2, 3, 4] }

stopreading

Stops an active inventory session.

Parameters: None.

Response:

FieldTypeDescription
stoppedAtstringISO 8601 timestamp when reading stopped
tagsReadnumberTotal tags read during the session

Example:

// Request
{}

// Response
{ "stoppedAt": "2026-03-20T10:31:00Z", "tagsRead": 247 }

encodetag

Writes data to an RFID tag’s EPC memory bank.

Parameters:

ParameterTypeRequiredDescription
epcstringYesTarget tag’s current EPC
newEpcstringYesNew EPC value to write
accessPasswordstringNoAccess password if the tag is locked

Response:

FieldTypeDescription
successbooleanWhether the write succeeded
previousEpcstringThe tag’s EPC before the write
newEpcstringThe tag’s EPC after the write

Example:

// Request
{ "epc": "E2801170000002145A8B6021", "newEpc": "E28011700000AABB11223344" }

// Response
{ "success": true, "previousEpc": "E2801170000002145A8B6021", "newEpc": "E28011700000AABB11223344" }

setgpio

Sets the state of a General Purpose Output (GPO) pin.

Parameters:

ParameterTypeRequiredDescription
pinnumberYesGPO pin number
statebooleanYestrue for high, false for low

Response:

FieldTypeDescription
pinnumberThe GPO pin that was set
statebooleanThe new state of the pin

Example:

// Request
{ "pin": 1, "state": true }

// Response
{ "pin": 1, "state": true }

readtagmemory

Reads data from a specific memory bank on an RFID tag.

Parameters:

ParameterTypeRequiredDescription
epcstringYesTarget tag’s EPC
memoryBankstringYesMemory bank: reserved, epc, tid, or user
wordOffsetnumberYesStarting word offset
wordCountnumberYesNumber of 16-bit words to read
accessPasswordstringNoAccess password if required

Response:

FieldTypeDescription
datastringHex-encoded data read from the tag
memoryBankstringThe memory bank that was read

Example:

// Request
{ "epc": "E2801170000002145A8B6021", "memoryBank": "user", "wordOffset": 0, "wordCount": 4 }

// Response
{ "data": "48656C6C6F576F726C6421", "memoryBank": "user" }

writetagmemory

Writes data to a specific memory bank on an RFID tag.

Parameters:

ParameterTypeRequiredDescription
epcstringYesTarget tag’s EPC
memoryBankstringYesMemory bank: reserved, epc, tid, or user
wordOffsetnumberYesStarting word offset
datastringYesHex-encoded data to write
accessPasswordstringNoAccess password if required

Response:

FieldTypeDescription
successbooleanWhether the write succeeded
wordsWrittennumberNumber of words written

Example:

// Request
{ "epc": "E2801170000002145A8B6021", "memoryBank": "user", "wordOffset": 0, "data": "48656C6C6F" }

// Response
{ "success": true, "wordsWritten": 3 }

Using Action Responses in Workflows

When you use an Invoke Device Action node in a workflow, the response data is available through expressions:

{{ output("actionActivityId").success }}
{{ output("actionActivityId").payload }}
{{ output("actionActivityId").deviceId }}

See Also