Embedded 1.0.0

Direct Trigger Node

The Direct Trigger fires an Embedded Workflow whenever the eea_direct_trigger method is invoked within the Embedded Edge Agent.

Direct Trigger

Configuration

The trigger only takes one argument: an ID assigned to the specific instance of the Direct Trigger. Whenever eea_direct_trigger is invoked on your Embedded Device, this trigger will fire if the ID passed in as the first argument matches the ID provided within the trigger’s configuration.

The ID does not need to be unique across multiple Direct Triggers in the same workflow, nor in Direct Triggers across other Embedded Workflows deployed to the device. Invoking eea_direct_trigger with an ID that is used in multiple places will fire each of the Direct Triggers targeting that ID.

Direct Trigger Configuration

Payload

The initial payload for a Direct Trigger resembles the following:

{
  "data": <payload provided to eea_direct_trigger>,
  "deploymentId": <ID of the device's deployment bundle>,
  "deviceId": <ID of the device running the workflow>,
  "flowId": <ID of the current workflow>,
  "flowName": <name of the current workflow>,
  "flowVersion": <version of the current workflow>,
  "globals": <object of workflow globals>,
  "isConnectedToLosant": <true|false>,
  "time": <time of the message>,
  "triggerId": <ID assigned to the Direct Trigger>,
  "triggerType": "direct"
}

There are two properties that are worth pointing out:

  • data is the value passed as the payload (second argument) to eea_direct_trigger. Its shape will depend on the shape of the value passed as that argument.
  • triggerId is the ID provided in the Direct Trigger’s configuration; in other words, it is the string passed as the first argument to the Direct Trigger.

Was this page helpful?


Still looking for help? You can also search the Losant Forums or submit your question there.