WebSocket Trigger Node

The WebSocket Trigger fires a workflow whenever the selected WebSocket integration receives a message.

WebSocket Trigger

Node Properties

The WebSocket Trigger takes a single configuration property: the WebSocket integration for which the workflow should trigger when the integration receives a message.

Payload

The payload will include the received message in the data field. In the general case, a WebSocket Trigger workflow payload will look like the following:

{
  "applicationId": "555555555555eeeeeeeeeeee",
  "applicationName": "My Great Application",
  "data": "{ \"hello\": \"world\" }",
  "flowId": "333333333333cccccccccccc",
  "flowName": "My Great Workflow",
  "flowVersion": "myFlowVersion",
  "globals": {
    "aJsonGlobal": {
      "key": "value"
    },
    "aNumberGlobal": 42,
    "aStringGlobal": "My value"
  },
  "relayId": "<ID of the integration>",
  "relayType": "integration",
  "time": Fri Feb 19 2016 17:26:00 GMT-0500 (EST),
  "triggerId": "<ID of the integration>",
  "triggerType": "integration"
}

Note: The value in the data field will always be a string. If you are expecting structured data (objects or arrays) through a WebSocket integration, you must follow up the trigger with a JSON: Decode Node to convert the value at data.message to a structured format, and your workflow should be resilient to cases where the decoding of the data fails.

Differences from Webhook Trigger

The WebSocket Trigger should not be confused with the Webhook Trigger. The WebSocket Trigger only fires for messages received through a WebSocket integration, whereas the Webhook Trigger fires for messages received from clients connecting to a WebSocket-type Webhook.

Was this page helpful?


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