Overview
The Websockets Send Node is designed to send a message over an existing WebSocket connection within an n8n workflow. It is typically used in conjunction with a Websocket trigger node, allowing you to respond to incoming WebSocket messages or events by sending data back through the same connection.
Common scenarios:
- Sending real-time responses to clients connected via WebSockets.
- Implementing chatbots, live notifications, or interactive dashboards where immediate feedback is required.
- Relaying processed data or acknowledgments back to the source of a WebSocket event.
Example:
A user sends a message to your server via WebSocket; after processing the message in your workflow, this node sends a reply back to the user.
Properties
Name | Type | Meaning |
---|---|---|
Send Content | string | The actual content/message that will be sent over the WebSocket connection. |
Websocket Resource Field (Parameter Name) | string | The name of the field in the input data that contains the WebSocket resource object. This should match the field provided by the Websocket trigger node. |
Output
- The node does not output any new JSON fields or data. Its primary function is to send data over the WebSocket connection. The output is always an empty array (
[[]]
), indicating no further data is passed along the workflow from this node.
Dependencies
- n8n Websocket Trigger Node: This node requires a Websocket trigger node earlier in the workflow to provide the WebSocket resource.
- No external API keys or environment variables are required for this node itself, but the workflow must include a properly configured Websocket trigger node.
Troubleshooting
"No Websocket node found in the workflow":
- Cause: The node could not find a parent Websocket trigger node.
- Resolution: Ensure your workflow includes a Websocket trigger node and that it precedes this node in the execution order.
"Execution error: No websocket resource received":
- Cause: The expected WebSocket resource was not found in the input data under the specified field name.
- Resolution: Check that the "Websocket Resource Field (Parameter Name)" matches the field provided by your Websocket trigger node. Also, ensure the trigger node is correctly configured to pass the resource.