Tutorial

WebSocket Client Automation: Send and Receive Live Messages

WebSockets are everywhere — trading platforms, IoT devices, dashboards, telemetry streams, chat systems, and real‑time APIs. The WebSocket Client Connector makes it incredibly easy to connect to live WebSocket endpoints inside your workflows, enabling automation based on streaming messages, event feeds, and bidirectional communication.

With the WebSocket Client Connector, you can send messages, subscribe to streams, collect live data, filter incoming frames, and integrate real‑time communication directly into your automation pipelines.

Step 1: Connect to a WebSocket Endpoint

The connector supports any WebSocket URL, including secure endpoints (wss://). You can configure:

  • WebSocket URL — e.g., wss://stream.binance.com/ws/btcusdt@trade
  • Headers (JSON) — optional authentication headers

The connector handles the handshake, header injection, and connection lifecycle automatically.

Step 2: Send a WebSocket Message

Use the WS Send Message node to send a single text frame. You can specify:

  • message — text or JSON payload
  • waitForReply — whether to wait for one response
  • replyTimeoutMs — timeout for receiving a reply

The node returns:

  • ok — send succeeded
  • reply — received message (optional)
  • durationMs — total time

This is ideal for ping/pong checks, sending commands, or interacting with APIs that respond with a single frame.

Step 3: Fetch Multiple Messages

Use the WS Fetch Messages node to subscribe and collect multiple frames. You can configure:

  • subscribePayload — optional subscription message
  • maxMessages — number of messages to collect
  • timeoutMs — maximum wait time
  • messageFilter — regex filter for incoming frames

The node returns:

  • messages — array of collected frames
  • count — number of messages
  • durationMs — elapsed time

This is perfect for trading feeds, telemetry streams, event subscriptions, or real‑time dashboards.

Step 4: Filter Incoming Messages

You can filter messages using a regex pattern:

  • "e":"trade" — match trade events
  • "type":"update" — match update frames
  • price — match frames containing “price”

This allows you to collect only relevant messages and ignore noise.

Step 5: Build Real‑Time Automations

Once WebSocket data enters your workflow, you can combine it with any other connector:

  • Trigger alerts when certain events appear
  • Store live data in Google Sheets or databases
  • Feed trading signals into conditional logic
  • Update dashboards with real‑time metrics
  • Process IoT telemetry streams

WebSockets become a powerful entry point into your automation ecosystem.

What's Next?

Experiment with multi-step workflows, combine WebSocket streams with conditional logic, or build dashboards showing live message activity. The WebSocket Client Connector gives you the tools to automate any real‑time data process.

Nodlyn Assistant
Ask me anything about Nodlyn
Hi! 👋 I'm the Nodlyn assistant. Ask me about the product, workflow components, connectors, agent runtime, agent capabilities, deployment, and more. If I don't know an answer, I'll point you to our contact form.
Nodlyn Assistant
Ask me anything about Nodlyn
Hi! 👋 I'm the Nodlyn assistant. Ask me about the product, workflow components, connectors, agent runtime, agent capabilities, deployment, and more. If I don't know an answer, I'll point you to our contact form.