Overview
This node is designed to send data back through an existing WebSocket connection within an n8n workflow. It is typically used in scenarios where a WebSocket trigger node has received a message, and you want to respond or push data back to the client over the same WebSocket connection.
Practical examples include:
- Real-time chat applications where the server sends messages back to clients.
- Live data feeds where updates are pushed to connected clients.
- Interactive dashboards that require immediate feedback via WebSocket.
The node requires a preceding WebSocket trigger node in the workflow to provide the WebSocket connection resource.
Properties
| Name | Meaning |
|---|---|
| Send Content | The string content to send back through the WebSocket connection. |
| Websocket Resource Field (Parameter Name) | The name of the field in the incoming data that holds the WebSocket connection resource. Default is "ws". |
Output
The node does not produce any JSON output data; its primary function is to send data through the WebSocket connection. The output is an empty array indicating no further data is passed downstream.
If the node were to handle binary data, it would be sent through the WebSocket connection as well, but this implementation only supports sending string content.
Dependencies
- Requires a WebSocket trigger node earlier in the workflow to provide the WebSocket connection resource.
- No external API keys or services are needed.
- The WebSocket connection object must be accessible under the specified resource field name in the input data.
Troubleshooting
Error: "No Websocket node found in the workflow"
This error occurs if there is no WebSocket trigger node present before this node in the workflow. To fix, add a WebSocket trigger node and configure it properly.Error: "Execution error: No websocket resource received"
This means the node could not find the WebSocket connection object in the input data under the specified resource field name. Verify that the field name matches the one set in the WebSocket trigger node and that the trigger node is correctly passing the connection.Ensure the "Send Content" property is not empty, as sending empty messages may cause unexpected behavior depending on the WebSocket client.
Links and References
- WebSocket RFC 6455 – Protocol specification for WebSockets.
- n8n Documentation - WebSocket Trigger Node – For setting up the WebSocket trigger node that works with this node.