Triggers, Events, and Actions
Triggers will start a Relay workflow instance. Common triggers include:
- Spoken phrase (voice command).
- Button press sequence (double tap, etc).
- Tap on an NFC tag.
- HTTP invocation.
- Timer (e.g., in 10 minutes) that was previously set in the Relay server.
- In the future, a geofence crossing may also be supported.
Once a workflow instance is started, you'll likely want to interact with your enterprise system if the trigger came from a HTTP invocation or timer, or a set of your Relay devices if the trigger came from a device. Within your workflow, there are many different actions available in the SDK that you can ask the Relay device or Relay server to perform, including:
- Speak from a text string (text to speech). Optionally, the speech can be a language translation (e.g., English text to Spanish speech).
- Listen for a set of spoken phrases (speech to text) and return which one was found.
- Perform haptic vibration in a desired pattern.
- Control the LEDs (full RGB color, individually addressable, optional effects like rotation / flash / breathe).
- Get information about the device, including:
- Device name (usually the user's name).
- Device outdoor location (street address or latitude/longitude).
- Device indoor location (position identifier / room).
- Battery level (percentage).
- Read any query parameters from a HTTP trigger.
- Move the device to a specified audio channel.
- Get the list of members in the channel.
- Store and retrieve your custom data in the workflow (i.e., your state information).
- Send a notification or broadcast message to other Relay devices.
- Pull other Relay devices into this channel.
- Create or resolve an incident.
- Make a full-duplex audio "phone call" to another Relay device.
- Invoke a webhook to an external system.
- Set a timer to fire in the future as a trigger for a workflow.
Your workflow will need to respond to different events sent to it by the Relay server while a workflow instance is running, such as:
- Subsequent button sequence was pressed.
- Incoming notification or broadcast message.
- Timer fired.
- Incoming full-duplex audio "phone call".
- An error in the workflow execution.
When you want to interact with a Relay device, your workflow should call the SDK API to create an interaction relationship with desired Relay devices. You get to choose the participants to interact with. When you do so, a temporary channel is dynamically created, and interactions with those devices will be in the context of that temporary channel. When your workflow is completed, the temporary channel goes away.
Updated 7 months ago