Skip to content

Flows & HTTP Connectors

Automatically forward messages to external systems via webhooks when entities send data.

How It Works

  1. Entity sends message with tags
  2. System finds connectors with matching tags
  3. HTTP requests are sent to your webhooks
  4. You receive the data in your external system

Note: Each connector is triggered only once per message, even if it matches multiple tags (e.g., both original message tags and validation failure tags).

Quick Start

Connector Creation UI Creating a connector in the UI.

You can also define connectors using JSON, as shown below:

1. Create a Connector

{
  "name": "n8n_webhook",
  "type": "http",
  "tags": ["automation"],
  "config": {
    "url": "https://your-n8n.com/webhook/abc123",
    "method": "POST",
    "headers": {
      "Content-Type": "application/json"
    }
  }
}

2. Send a Message

When an entity sends a message with the alerts tag, your webhook will receive:

{
  "data": {
    "temperature": 25.5,
    "location": "building-a"
  },
  "context": {
    "tags": ["alerts"]
  },
  "msgType": "publish",
  "source": "123:us-1:entity:sensor_01",
  "timestamp": "2024-01-15T10:30:00Z"
}

Service Validation Failures

When an entity has a service assigned and sends data that fails validation, the system automatically adds validation failure tags to the message. This triggers any connectors with matching tags.

Example: Temperature Sensor Validation

Service Configuration:

{
  "name": "temperature_sensor_service",
  "dynamicActions": [
    {
      "name": "temp-publish",
      "tags": ["validation_failure", "data_quality"],
      "rules": [
        {
          "field": "temperature",
          "operator": "between",
          "value": [-50, 150],
          "message": "Temperature out of range"
        }
      ]
    }
  ]
}

Entity with Service:

{
  "name": "sensor_01",
  "service": "temperature_sensor_service"
}

Failed Message: When the sensor sends {"temperature": 200} (exceeds 150°C limit), the validation fails but the message continues processing with validation failure tags.

Connector Triggered:

{
  "name": "validation_alert",
  "type": "http",
  "tags": ["validation_failure"],
  "config": {
    "url": "https://alerts.example.com/webhook",
    "method": "POST",
    "headers": {
      "Content-Type": "application/json"
    }
  }
}

What Your Webhook Receives:

{
  "data": {
    "temperature": 200
  },
  "context": {
    "tags": ["validation_failure", "data_quality"]
  },
  "msgType": "publish",
  "source": "123:us-1:entity:sensor_01",
  "timestamp": "2024-01-15T10:30:00Z",
  "actionResult": {
    "name": "temp-publish",
    "valid": false,
    "message": "Temperature out of range",
    "tags": ["validation_failure", "data_quality"],
    "field": "temperature",
    "actual": 200,
    "expected": { "between": [-50, 150] }
  }
}

Validation Failure Output Format

When a validation rule fails, the actionResult includes:

  • field: The field that failed
  • actual: The value that was provided
  • expected: A JSON object describing the rule, e.g. { "between": [0, 100] }

Example:

{
  "field": "temperature",
  "actual": 150,
  "expected": { "between": [0, 100] }
}