{
  "schemaVersion": 1,
  "snapshotDate": "2026-10-23",
  "slug": "reference-app-core-demo-alert",
  "title": "Compose alert",
  "section": "Library asset reference",
  "description": "Creates a typed warning from a device reading.",
  "kind": "node",
  "url": "/wiki/reference-app-core-demo-alert/",
  "markdown": "/wiki/reference-app-core-demo-alert/index.md",
  "json": "/wiki/reference-app-core-demo-alert/index.json",
  "headings": [
    {
      "id": "sockets-and-configuration",
      "title": "Sockets and configuration",
      "depth": 2
    },
    {
      "id": "example",
      "title": "Example",
      "depth": 2
    },
    {
      "id": "boundaries",
      "title": "Boundaries",
      "depth": 2
    },
    {
      "id": "catalog-identity",
      "title": "Catalog identity",
      "depth": 2
    },
    {
      "id": "inputs",
      "title": "Inputs",
      "depth": 2
    },
    {
      "id": "outputs",
      "title": "Outputs",
      "depth": 2
    },
    {
      "id": "configuration-schema",
      "title": "Configuration schema",
      "depth": 2
    },
    {
      "id": "source-and-installed-versions",
      "title": "Source and installed versions",
      "depth": 2
    }
  ],
  "sources": [
    "../OpenNodeFlow-Library/work/catalog-all.mjs",
    "../OpenNodeFlow-Library/work/azure-pack-consolidation-20261022/catalog-policy.mjs",
    "../OpenNodeFlow-Library/work/developer-packs-20261022/catalog.mjs",
    "shared/seed.ts",
    "shared/storage-library.ts",
    "shared/variable-library.ts",
    "shared/control-flow.ts",
    "shared/remote-routes.ts",
    "server/runtime-library.ts",
    "shared/error-library.ts",
    "shared/storage-model.ts",
    "shared/builtin-documentation.ts"
  ],
  "family": "app-core",
  "contract": {
    "key": "app.core.demo.alert",
    "slug": "app-core-demo-alert",
    "name": "Compose alert",
    "kind": "node",
    "family": "app-core",
    "packId": null,
    "category": "Monitoring",
    "description": "Creates a typed warning from a device reading.",
    "inputs": [
      {
        "id": "exec",
        "name": "Execute",
        "type": "control",
        "typeName": "Control",
        "required": false
      },
      {
        "id": "reading",
        "name": "Reading",
        "type": "type.device-reading",
        "typeName": "Device reading",
        "typeKey": "app.core.type.device-reading",
        "required": true
      }
    ],
    "outputs": [
      {
        "id": "next",
        "name": "Next",
        "type": "control",
        "typeName": "Control",
        "required": false
      },
      {
        "id": "alert",
        "name": "Alert",
        "type": "type.alert",
        "typeName": "Alert",
        "typeKey": "app.core.type.alert",
        "required": false
      }
    ],
    "configSchema": {},
    "documentation": "# Compose alert\n\nConstructs a typed warning from a Device reading. It always produces the same alert category; it does not evaluate a threshold, send a message or choose severity from input.\n\n## Sockets and configuration\n- **exec** (control): optional branch gate.\n- **reading** (Device reading custom type, required): validated source measurement.\n- **alert** (Alert custom type): composed object.\n- **next** (control): automatic success route.\n- No asset-specific configuration schema.\n\nThe output title is Demand threshold exceeded, severity is warning, message is `<deviceId> is drawing <value> <unit>`, and deviceId is copied. The reading's timestamp is omitted because the Alert schema does not declare it. All readings passed to this node produce an alert, including normal/negative/zero values; policy belongs upstream.\n\n## Example\nUse a Condition with operator greater and compare 80. Wire True to this node's Execute and the normalized reading to its reading socket. Input `{\"deviceId\":\"meter-example\",\"value\":95,\"unit\":\"kW\",\"timestamp\":\"2026-01-01T12:00:00.000Z\"}` produces a warning message meter-example is drawing 95 kW. Route alert to Workflow output or a separately authored notification/API node.\n\n## Boundaries\nA data wire alone orders execution but does not gate it by threshold; wire the appropriate control route. A missing/invalid required reading fails input validation, and an unselected control branch skips. Custom input/output type versions are pinned by publication. The body has no logging, secret access, state writes or external calls. The composed message/device identity are retained data, so use fictional examples and avoid exposing unnecessary customer information.",
    "tags": [
      "builtin",
      "node"
    ],
    "source": "app-builtin-catalog"
  }
}
