Registry / messaging / n8n-nodes-websocket-ws-reconnect

n8n-nodes-websocket-ws-reconnect

JSON →
library1.0.2jsnpmunverified

An n8n community node (v1.0.2) that adds a WebSocket trigger with support for Bearer token and query parameter authentication and automatic reconnection. Designed for n8n workflow automation, it connects to any WebSocket endpoint and uses incoming messages as workflow triggers. The package has no regular release cadence yet but is actively maintained. Key differentiators: built-in auth and reconnect handling, unlike generic WebSocket clients. Peer dependency on n8n-workflow, requires Node >=18.10.

npm install n8n-nodes-websocket-ws-reconnect
INSTALL
IMPORT
SIG · N8N-NODES-WEBSOCKE
N
n8n-nodes-websocket-ws-reconnect
messagingjavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WebSocketTrigger
import { WebSocketTrigger } from 'n8n-nodes-websocket-ws-reconnect'
import WebSocketTrigger from 'n8n-nodes-websocket-ws-reconnect'
Named export only; default import is not available.
WebSocket
import { WebSocket } from 'ws'
import { WebSocket } from 'n8n-nodes-websocket-ws-reconnect'
The package does not re-export the 'ws' WebSocket class; you must use the 'ws' package directly for low-level usage.
INodeTypeDescription
import type { INodeTypeDescription } from 'n8n-workflow'
import { INodeTypeDescription } from 'n8n-nodes-websocket-ws-reconnect'
Type definitions come from n8n-workflow, not from this package.

Shows how to import the WebSocketTrigger class and access its description for n8n node registration.

// No standalone usage; install as n8n community node // Ensure n8n is installed and node_modules linked correctly // Package peer depends on n8n-workflow import { WebSocketTrigger } from 'n8n-nodes-websocket-ws-reconnect'; const trigger = new WebSocketTrigger(); const nodeType = trigger.description; console.log('Node type name:', nodeType.name);
Debug
Known issues
gotchaThe package name is 'n8n-nodes-websocket-ws-reconnect' but the npm package is 'n8n-nodes-websocket-ws' - ensure you install the correct one.
fix
npm install n8n-nodes-websocket-ws-reconnect
affects: >=1.0.0
breakingv1.0.0 changed the trigger name from 'websocketTrigger' to 'webSocketTrigger' (camelCase refactor). Workflows using old name will break.
fix
Update workflow node type to 'webSocketTrigger' (capital S).
affects: >=1.0.0
deprecatedThe property 'reconnectInterval' was deprecated in v0.9.0 in favor of 'reconnectDelay'.
fix
Use 'reconnectDelay' instead of 'reconnectInterval'.
affects: >=0.9.0 <1.0.0
gotchaAuthentication header 'Authorization' is set in the node parameters, but if the websocket server expects a different header name, you must modify the node source code - it is not configurable.
fix
Fork the package or submit a PR to customize header name.
affects: >=1.0.0
breakingNode requires n8n-workflow as a peer dependency; if not installed, n8n will throw 'Cannot find module 'n8n-workflow'' at startup.
fix
Ensure n8n-workflow is installed in the same node_modules (handled automatically if using n8n community node installer).
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'n8n-workflow'
Missing peer dependency n8n-workflow.
fix
Run 'npm install n8n-workflow' in the n8n node_modules directory.
The trigger 'websocketTrigger' is not registered.
Old trigger name used before v1.0.0.
fix
Use 'webSocketTrigger' (with capital S) as the node type.
TypeError: Cannot read properties of undefined (reading 'reconnectInterval')
Using deprecated 'reconnectInterval' in node parameters.
fix
Replace 'reconnectInterval' with 'reconnectDelay' in the node configuration.
WebSocket connection failed: Unexpected server response: 401
Authentication header not sent or wrong credentials.
fix
Check that the Bearer token or query parameter is correctly set in the node credentials or parameters.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
n8n-workflowrequiredPeer dependency required to integrate with n8n workflow system
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
n8n-nodes-websocket-ws-reconnect — npm install n8n-nodes-websocket-ws-reconnect · libregistry