Skip to main content

status

Monitor and react to status changes of other nodes in your flows.

Overview

The status node listens for status change events emitted by other nodes in the same flow. Nodes like MQTT, TCP, WebSocket, and database connectors report their connection state — connected, disconnected, reconnecting — and the status node captures these events so you can react, log, or display them on a dashboard.

All
Scope
Target
Scope
Color
Indicator
Text
Message

Properties

Property Type Default Description
scope string "all" "all" monitors every node; "target" monitors only specified nodes
nodeIds array [] List of node IDs to monitor (when scope = "target")

Status Message Structure

msg.status

Status object emitted by the source node

msg.status = {
  "fill": "green",
  "shape": "dot",
  "text": "connected"
}

Status Colors

Standard color indicators for node health

green  → healthy / connected
yellow → warning / reconnecting
red    → error / disconnected
blue   → info / processing
grey   → unknown / idle

Status Shapes

Shape of the status indicator beneath the node

"dot"  → solid filled circle
"ring" → hollow ring circle

// Example:
// green dot  = connected
// red ring   = connection lost

Source Info

Identify which node emitted the status

msg.status.source = {
  "id": "mqtt-broker-01",
  "type": "mqtt in",
  "name": "Sensor Broker"
}

Example: Monitor MQTT Connection Status

Track the connection state of an MQTT broker and trigger alerts on disconnection.

// Status node configuration — target MQTT nodes
{
  "scope": "target",
  "nodeIds": ["mqtt-broker-node-id"]
}

// Status messages received over time:

// 1. Broker connected
{
  "status": {
    "fill": "green",
    "shape": "dot",
    "text": "connected",
    "source": { "id": "mqtt-broker-01", "type": "mqtt in", "name": "Sensor Broker" }
  }
}

// 2. Broker connection lost
{
  "status": {
    "fill": "red",
    "shape": "ring",
    "text": "disconnected",
    "source": { "id": "mqtt-broker-01", "type": "mqtt in", "name": "Sensor Broker" }
  }
}

// Downstream switch node routes on msg.status.fill:
// "green" → log "connected"
// "red"   → send alert notification
// "yellow" → log "reconnecting..."

Example: Dashboard Connection Indicator

Display a live connection status indicator on a dashboard by monitoring all protocol nodes.

// Status node configuration — monitor all nodes
{
  "scope": "all"
}

// Function node — transform status to dashboard widget format
{
  "code": "const s = msg.status;\nmsg.payload = {\n  node: s.source ? s.source.name : 'unknown',\n  type: s.source ? s.source.type : 'unknown',\n  state: s.text,\n  healthy: s.fill === 'green',\n  color: s.fill,\n  timestamp: new Date().toISOString()\n};\nreturn msg;"
}

// Output to dashboard gauge or table:
{
  "payload": {
    "node": "Sensor Broker",
    "type": "mqtt in",
    "state": "connected",
    "healthy": true,
    "color": "green",
    "timestamp": "2025-06-15T14:30:00.000Z"
  }
}

// Dashboard shows a table of all node connection states
// Green/red indicators update in real time

Example: Connection Uptime Tracking

Track how long a connection has been up or down for SLA reporting.

// Status node → Function node with context storage
{
  "code": "const s = msg.status;\nconst now = Date.now();\nconst key = s.source ? s.source.id : 'unknown';\nlet tracker = context.get(key) || { upSince: null, downSince: null, totalDown: 0 };\n\nif (s.fill === 'green' && !tracker.upSince) {\n  if (tracker.downSince) tracker.totalDown += now - tracker.downSince;\n  tracker.upSince = now;\n  tracker.downSince = null;\n} else if (s.fill === 'red' && !tracker.downSince) {\n  tracker.downSince = now;\n  tracker.upSince = null;\n}\n\ncontext.set(key, tracker);\nmsg.payload = { node: key, uptime: tracker.upSince ? now - tracker.upSince : 0, totalDowntime: tracker.totalDown };\nreturn msg;"
}

// Output:
{
  "payload": {
    "node": "mqtt-broker-01",
    "uptime": 3600000,
    "totalDowntime": 120000
  }
}

Common Use Cases

Connection Monitoring

Track MQTT, TCP, WebSocket, and database connection health

Dashboard Indicators

Show live green/red status LEDs on monitoring dashboards

Uptime/SLA Reporting

Track connection uptime for service level agreements

Auto-Recovery Triggers

Trigger reconnection or failover when disconnection is detected

Related Nodes