Skip to main content

WebSocket Trigger

The WebSocket trigger establishes a long-lived connection to receive server messages and triggers a workflow when the event field matches.

Overview

After connecting to a WebSocket server, the extension continuously listens for JSON messages pushed by the server. When the event field matches the configured "Trigger Event," the workflow starts automatically, and the data field is automatically JSON-parsed and stored in the specified variable. The configuration panel displays the current connection status in real time (Connected / Disconnected).

Messages pushed by the server must be in the following JSON format:

{
"event": "task_notify",
"data": {
"url": "https://example.com/order/12345",
"orderId": "12345"
}
}
WebSocket

Quick Start

  1. Drag the "WebSocket Trigger" node onto the canvas
  2. Fill in the WebSocket server URL, e.g., wss://ws.example.com
  3. Fill in "Trigger Event" — corresponds to the event field value in server messages, e.g., task_notify
  4. Configure the execution mode and the variable name for receiving data
  5. When the server sends a matching message, the workflow starts automatically

Parameter Reference

ParameterTypeDefaultDescription
Server URLTextWebSocket address, required. Format: ws:// or wss://
Trigger EventTextMatches the server message event field value, required
Execution ModeDropdownRequired. Open New Tab / Match Open Page
Execution Page URLTextRequired for "Open New Tab" mode
Match PatternTextRequired for "Match Open Page" mode; see URL Match Patterns
Receive DataTextVariable name to store the parsed result of the data field
Activate TabTogglefalseWhether to automatically switch to the target tab when triggered

Execution Mode

Triggers support two execution modes, determining which page the workflow runs on:

ModeDescriptionConfiguration Required
Open New TabOpens a new browser tab, loads the specified URL, then executesExecution Page URL (required)
Match Open PageMatches an already-open tab by URL pattern, executes on the matched pageMatch Pattern (Chrome match patterns format; see URL Match Patterns)

The Execution Page URL supports referencing received data via {{variableName}} (see Variables), enabling dynamic target page selection. Match patterns are fixed and do not support variables.

Receiving Parameters & Dynamic URL

When a trigger receives data, the data is parsed as JSON and stored in the variable configured in "Receive Data" (e.g., data). It can then be referenced anywhere in the workflow using {{ }} expressions.

Typical Usage: When the received data includes a url field, you can dynamically specify the target page in "Execution Page URL" via the variable.

Example received data:

{
"url": "https://shop.example.com/order/12345",
"orderId": "12345"
}

Trigger configuration:

Receive Data: data
Execution Page URL: {{data.url}}

During workflow execution, nodes such as Open Page can also reference fields like {{data.orderId}}.

FAQ

Connection status always shows "Disconnected"

Symptom: Configured the server URL, but the panel consistently shows a red "Disconnected" status.

Cause: The server address is unreachable, or the URL format is incorrect.

Solution: First verify the server is reachable using an online WebSocket testing tool; confirm the URL starts with ws:// or wss://.