Websockets Send Node

Websockets Send

Overview

The Websockets Send Node is designed to send data through an existing WebSocket connection within an n8n workflow. It is typically used in scenarios where real-time communication or live updates are required, such as chat applications, live notifications, or streaming data feeds. This node works in conjunction with a WebSocket trigger node that establishes and manages the WebSocket connection.

For example, after receiving a message via a WebSocket trigger node, this node can send a response or broadcast a message to connected clients by sending content over the same WebSocket resource.

Properties

Name Meaning
Send Content The string content to be sent through the WebSocket connection.
Websocket Resource Field (Parameter Name) The name of the field in the incoming data that holds the WebSocket resource object. Default is "ws".

Output

This node does not produce any JSON output data; its output is an empty array indicating no further data is passed downstream. Its primary function is side-effectual—sending data over a WebSocket connection.

No binary data output is generated.

Dependencies

  • Requires a WebSocket trigger node earlier in the workflow to provide the WebSocket resource.
  • The WebSocket resource must be accessible in the input data under the specified field name.
  • No external API keys or credentials are needed beyond what the WebSocket trigger node requires.

Troubleshooting

  • Error: "No Websocket node found in the workflow"
    This error occurs if there is no WebSocket trigger node present in the workflow. To fix it, add a WebSocket trigger node configured to respond using the WebSocket resource.

  • Error: "Execution error: No websocket resource received"
    This indicates that the expected WebSocket resource was not found in the input data under the specified field name. Verify that the WebSocket trigger node outputs the resource correctly and that the "Websocket Resource Field" property matches the field name used.

  • Ensure the WebSocket connection is active before attempting to send data; otherwise, sending will fail silently or throw errors depending on the underlying WebSocket implementation.

Links and References

Discussion