WebSocket

trigger_websocket · trigger · Triggers · Available · v1.0.0

Description

Run the workflow in real time whenever a message arrives on a WebSocket connection. Unlike the Webhook trigger (an HTTP endpoint that waits for calls), this node actively CONNECTS to a remote ws:// or wss:// stream and stays listening — ideal for live feeds where data is pushed, not polled.

⚙️ Configuration parameters

Fields shown in the editor when configuring the node. Generated directly from the NodeDefconfigFields.

FieldTypeRequiredDefaultDescription
url
URL WebSocket
stringyes
wss://stream.example.com/ws
Endpoint a cui connettersi. wss:// = cifrato (TLS, raccomandato). ws:// = in chiaro (solo reti fidate). La connessione resta aperta e persistente finché il workflow è abilitato.
headersJson
Header di connessione (JSON)
JSON object/arrayno
{ "Authorization": "Bearer xxx" }
Header inviati durante l'handshake HTTP di upgrade. Oggetto JSON chiave→valore. Usali per autenticare (Bearer, Cookie, API key) o per negoziare un sub-protocollo. Vuoto = nessun header custom.
subscribeMessage
Messaggio di subscribe (on-open)
string (multiline)no
{ "op": "subscribe", "channel": "trades" }
Messaggio inviato SUBITO dopo l'apertura della connessione (e dopo ogni riconnessione). Tipicamente un JSON di subscribe richiesto dal provider per iniziare a ricevere lo stream. Vuoto = nessun invio.
jsonParse
Parsa i messaggi come JSON
booleannotrueOn (default): ogni frame viene parsato come JSON in "data" (fallback alla stringa grezza se non è JSON valido). Off: "data" resta sempre la stringa testuale del frame. "raw" contiene sempre il testo originale.
messagePointer
JSON Pointer di filtro/estrazione
stringno
/type oppure /data/price
RFC 6901 JSON Pointer. Se valorizzato, il run parte SOLO se il puntatore risolve a un valore non-undefined, e quel valore viene esposto come "matched". Es. "/type" filtra i messaggi che hanno un campo type. Vuoto = ogni messaggio fa partire un run.
reconnect
Riconnessione automatica
booleannotrueOn (default): su chiusura/errore riconnette con backoff esponenziale (1s→2s→4s… max 30s). Off: alla prima disconnessione il watcher si ferma finché non riabiliti/salvi il workflow.
pingIntervalSec
Keepalive ping (secondi)
numberno30Intervallo dei ping di keepalive per non farsi chiudere la connessione da proxy/load-balancer inattivi. 0 = disabilitato. Default 30s. Molti provider chiudono i socket idle dopo 60s.
maxMessagesPerSec
Budget anti-flood (messaggi/sec)
numberno20Tetto di run avviati al secondo da questo trigger. I messaggi oltre il budget vengono scartati (con log) per proteggere il runtime da stream troppo verbosi. 0 = nessun limite (usa con cautela).

💡 Configuration example

JSON snippet of the node as it appears in the workflow. Values are derived fromdefaultValue and from required parameters.

{
  "id": "node-trigger_websocket-1",
  "defId": "trigger_websocket",
  "label": "WebSocket",
  "config": {
    "url": "wss://stream.example.com/ws",
    "jsonParse": true,
    "reconnect": true,
    "pingIntervalSec": 30,
    "maxMessagesPerSec": 20
  }
}

🔗 Related nodes in the same category

Ready to use WebSocket?

Available now on all FlowForge plans. Try it free without a credit card.

Start freeBrowse all nodes