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

Node Properties

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": "666666666666ffffffffffff",
  "deviceId": "222222222222bbbbbbbbbbbb",
  "flowId": "333333333333cccccccccccc",
  "flowName": "My Great Workflow",
  "flowVersion": "myFlowVersion",
  "globals": {
    "aJsonGlobal": {
      "key": "value"
    },
    "aNumberGlobal": 42,
    "aStringGlobal": "My value"
  },
  "isConnectedToLosant": true,
  "time": 1455902760000,
  "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.

Resources

Was this page helpful?


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