UDP Trigger Node

The UDP Trigger will trigger a workflow whenever the Edge Compute device receives a UDP datagram on the configured port.

UDP Trigger

Node Properties

UDP Port

The UDP Trigger has one piece of configuration, the port to listen on. When a workflow with this trigger is deployed to an Edge Compute device, the Gateway Edge Agent will open a UDP server on this port. When that UDP server receives a datagram, the workflow will trigger.

Payload

The payload will include the triggering datagram data field. In the general case, a UDP workflow payload will look like the following:

{
  "applicationId": <id of the current application>,
  "applicationName": <name of the current application>,
  "data": {
    "sourcePort": <source port of incoming datagram>,
    "sourceAddress": <source address of incoming datagram>,
    "message": <contents of the incoming datagram>
  },
  "deviceId": <id of the edge device>,
  "deviceName": <the edge device name>,
  "deviceTags": {<any tags for the edge device>},
  "flowId": <id of the current workflow>,
  "flowName": <name of the current workflow>,
  "flowVersion": <name of the current workflow version>,
  "globals": <object of workflow globals>,
  "isConnectedToLosant": <if the agent is connected to Losant>,
  "agentEnvironment": <object of environment variables>,
  "time": <time the command arrived>,
  "triggerId": <udp port>,
  "triggerType": "udp"
}

Was this page helpful?


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