WebSocket Send

The WebSocket Send node opens an outbound client connection to an external WebSocket server, sends one message, and closes the connection.

The WebSocket Send node opens an outbound client connection to an external WebSocket server, sends one message, and closes the connection. Use it when a workflow needs to push events to a realtime system without exposing a Heym-owned socket endpoint.

Overview

PropertyValue
Inputs1
Outputs1
Output$nodeLabel.status, $nodeLabel.url, $nodeLabel.message_type, $nodeLabel.size_bytes

Parameters

ParameterTypeDescription
websocketUrlstring / expressionExternal ws:// or wss:// URL
websocketHeadersJSON object string / expressionOptional handshake headers
websocketSubprotocolsstringOptional comma-separated subprotocol list
websocketMessageexpressionPayload to send

Message Serialization Rules

  • If websocketMessage resolves to a string, Heym sends a text frame.
  • If it resolves to an object, array, number, boolean, or null, Heym serializes it as JSON text.
  • If it resolves to bytes, Heym sends a binary frame.
  • Full expressions such as $input preserve native types before serialization.

Output Fields

ExpressionDescription
$nodeLabel.status"sent" on success
$nodeLabel.urlResolved destination URL
$nodeLabel.message_typetext, json, or binary
$nodeLabel.size_bytesPayload size in bytes
$nodeLabel.subprotocolNegotiated subprotocol when present
$nodeLabel.sent_atISO timestamp

Example Workflow

HTTP request → transform → publish over WebSocket

input → set → websocketSend → output
  • Set creates a payload object such as { "type": "user.updated", "user": $input.body }
  • WebSocket Send uses $payloadNode as websocketMessage
  • Output can return $socketSend.status

Example Node JSON

{
  "type": "websocketSend",
  "data": {
    "label": "socketSend",
    "websocketUrl": "wss://stream.example.com/publish",
    "websocketHeaders": "{\"Authorization\": \"Bearer $vars.socketToken\"}",
    "websocketSubprotocols": "json",
    "websocketMessage": "$payloadBuilder"
  }
}

Notes

  • No credential is required for this node.
  • If the remote server expects auth or tenant headers, pass them via websocketHeaders.
  • Use HTTP when the remote system is request/response based instead of socket based.