Stellio Entities
The node bundles the most important entity operations of the Stellio context broker: querying by type, filter and id pattern, reading a single entity, counting matches and deleting individually or in batches. The operation can be fixed in the dialog or controlled per message via msg.operation. A Browser tab shows entities directly in the editor.
- Node type
- stellio-entities
- Package
- @htag/node-red-contrib-hypertegrity-ngsi-ld
- Inputs / outputs
- 1 / 1
- Target
- Stellio context broker (NGSI-LD)
When to use this node
After publishing entities you usually want to check what is stored in the broker, look up individual records or remove outdated entities. Stellio Entities covers these tasks with one node and saves you from assembling HTTP requests, headers and query parameters by hand.
Typical use cases are:
- Quality control after an import: query all entities of a type and compare them with the source.
- Dashboards and enrichment: read an entity by id and reuse its attributes in a flow.
- Monitoring: count the entities of a type and raise an alert on deviations.
- Clean-up: find entities by id pattern and remove them via batch delete.
How the node works
Determine operation
msg.operation or the configured action decides whether to query, get, count or delete.
Build request
Connection (API URL, tenant, context) and parameters (type, q, id pattern, attrs, limit, offset, entity id) are merged from msg and configuration.
Call the broker
The node calls /ngsi-ld/v1/entities or /entityOperations/delete with NGSILD-Tenant and Link headers.
Emit response
Response body, status code, headers and, where available, the result count are written into the message.
Result: Entities, a single entity, a count or the result of a deletion in msg.payload.
The node is message-driven. Every incoming message triggers exactly one request. The Browser tab in the dialog works independently: it uses the admin endpoints of the Node-RED server to list entities in the editor, show details and delete entities directly.
Configuration
The dialog has the tabs Aktion (action) and Browser. All stored fields are on the action tab.
Action tab
| Field | Type | Default | Meaning |
|---|---|---|---|
| Name | Text | empty | Display name of the node in the flow. Without a name the node shows Entities: <action>. |
| API URL | Text | ${STELLIO_API_URL} | Base URL of the broker. Placeholders ${VAR} are replaced from environment variables at runtime; a trailing slash is removed. Empty: falls back to the environment variable STELLIO_API_URL. |
| Tenant | Text | empty | Value of the NGSILD-Tenant header. Empty: the header is not sent (default tenant of the broker). |
| Context | Text | see below | JSON-LD context sent as Link header. It determines how type and attribute names are abbreviated in the response. |
| Aktion (action) | Select | Query | Query (search entities), Get (single entity by id), Count (determine number), Delete (delete entity), Batch Delete (array of ids from msg.payload). |
| Type | Text | empty | Entity type(s) for Query and Count, comma-separated, for example Device,WeatherObserved. |
| q-Filter | Text | empty | NGSI-LD filter expression (example below). |
| ID Pattern | Text | empty | Regular expression on the entity id, for example urn:ngsi-ld:Device:.*. |
| Attrs | Text | empty | Return only these attributes, comma-separated. Also applies to Get. |
| Limit | Number | 100 | Maximum number of results per response (Query). |
| Offset | Number | empty | Number of results to skip for paging. |
| Entity ID | Text | empty | Full URN for Get and Delete, for example urn:ngsi-ld:Device:001. |
Example of a q filter:
temperature>20;category=="urban"
Default values of the URL fields:
Context: https://context.${DOMAIN}/main-context.jsonld
Which fields are visible depends on the selected action: Type, q-Filter, ID Pattern, Attrs, Limit and Offset appear for Query and Count, Entity ID for Get and Delete, and a hint about msg.payload for Batch Delete.
Browser tab
The tab uses the connection from the action tab. You can search by type and q-filter, set a limit, list results with Laden (load), show details as JSON and delete single entities after confirmation. The browser fields are not stored.
Deleting in the Browser tab takes effect on the broker immediately, without deploying the flow. It requires the Node-RED permission stellio.write.
Input
Values from the message take precedence over the configuration.
| Property | Type | Meaning |
|---|---|---|
msg.operation | string | query, get, count, delete or batchDelete. Unknown values are treated as query. |
msg.apiUrl | string | Overrides the API URL. |
msg.tenant | string | Overrides the tenant. |
msg.contextUrl | string | Overrides the context (Link header). |
msg.type | string | Overrides Type (Query, Count). |
msg.q | string | Overrides the q-filter (Query, Count). |
msg.idPattern | string | Overrides the ID Pattern (Query, Count). |
msg.attrs | string | Overrides Attrs (Query, Count, Get). |
msg.limit | number | Overrides the limit (Query). |
msg.offset | number | Overrides the offset (Query, Count). |
msg.entityId | string | Overrides the Entity ID (Get, Delete; fallback for Batch Delete). |
msg.payload | array of strings | batchDelete only: list of URNs to delete. If the payload is not an array, the Entity ID is used as a single element instead. |
If a query contains neither type, q-filter nor id pattern, the node automatically sets idPattern=.* so that the broker returns all entities.
Output
The message is extended with the broker response. For query with type WeatherObserved, msg.payload looks like this:
[
{
"id": "urn:ngsi-ld:WeatherObserved:exampletown:station-042",
"type": "WeatherObserved",
"temperature": {
"type": "Property",
"value": 14.2,
"observedAt": "2026-10-01T06:00:00.000Z"
},
"location": {
"type": "GeoProperty",
"value": {"type": "Point", "coordinates": [7.3322, 50.3315]}
},
"@context": ["https://context.exampletown.example/main-context.jsonld"]
}
]
| Field | Meaning |
|---|---|
msg.payload | query: array of entities. get: one entity object. count: object {"count": n}. delete: usually empty (204). batchDelete: result object of the broker with successful and failed ids. |
msg.statusCode | HTTP status code of the response. |
msg.headers | Response headers, including ngsi-ld-results-count for count queries. |
msg.count | Result count from the NGSILD-Results-Count header, if the broker sends it for query. |
Example flow
The package ships with a shared example flow for several Stellio nodes. You can import it in Node-RED via Menu → Import → Examples → @htag/node-red-contrib-hypertegrity-ngsi-ld → stellio-helper-nodes. The Stellio Entities node is included in this shared example, but it is not wired as a complete Inject-Entities-Debug flow; the following excerpt therefore shows a minimal wiring of this node. Alternatively, download stellio-helper-nodes.json and import it via Menu → Import.
Inject
An Inject node triggers the query manually or at a fixed interval.
Stellio Entities
The node queries all entities of the tenant with the Query action (limit 100).
Debug
A Debug node shows the entity array, status code and result count.
Show minimal wiring as JSON
[
{"id": "tab1", "type": "tab", "label": "Stellio Helper Nodes", "disabled": false, "info": ""},
{"id": "inject1", "type": "inject", "z": "tab1", "name": "", "props": [{"p": "payload"}], "repeat": "", "once": false, "payload": "", "payloadType": "date", "x": 160, "y": 100, "wires": [["entities1"]]},
{"id": "entities1", "type": "stellio-entities", "z": "tab1", "name": "", "apiUrl": "${STELLIO_API_URL}", "tenant": "default_dataspace", "contextUrl": "https://context.${DOMAIN}/main-context.jsonld", "operation": "query", "entityType": "", "q": "", "idPattern": "", "attrs": "", "limit": 100, "offset": "", "entityId": "urn:ngsi-ld:FloodMonitoring:L6090", "x": 400, "y": 100, "wires": [["debug1"]]},
{"id": "debug1", "type": "debug", "z": "tab1", "name": "Entities", "active": true, "tosidebar": true, "complete": "true", "targetType": "full", "x": 640, "y": 100, "wires": []}
]
Status and errors
| Indicator | Meaning |
|---|---|
| Blue dot "query…" (or name of the operation) | The request is running. |
| Green dot "12 entities" | Query successful; the number is the result count from the response header. |
| Green dot "get ✓ (200)" (or operation and status code) | Operation successful with status 2xx. |
| Yellow ring "status 404" (or another status code) | The broker answered with an error status. The message is still sent; details are in msg.payload. |
| Red ring "error" with error "operation "get" requires an entityId" | The Entity ID is missing for Get or Delete. |
| Red ring "error" with error "operation "batchDelete" requires msg.payload as an array of entity ids" | The ids are missing for Batch Delete. |
| Red ring "error" with error "Stellio API URL is required (config, msg.apiUrl or STELLIO_API_URL)" | No API URL could be determined. |
| Red ring "error" with network message or "timeout of 30000ms exceeded" | Broker unreachable or no answer within 30 seconds. |
Typical broker status codes: 200 (Query, Get, Count), 204 (Delete successful), 207 (Batch Delete partially successful), 400 (invalid filter or invalid URN), 404 (entity not found). Errors are reported via node.error and can be handled with a Catch node.
Notes
- Authentication: The node sends no authentication headers; access to the broker is protected by the network or an upstream gateway.
- Timeout: Requests abort after 30 seconds. Limit large queries using limit and offset.
- Context and attribute names: Without a matching context the broker returns full URIs instead of short attribute names. Use the same context as when writing.
- Admin endpoints: The Browser tab uses
/stellio-helper/browse(permissionstellio.read) and/stellio-helper/mutate(permissionstellio.write) of the Node-RED server. - Personal data: The node shows broker content unchanged and removes no data. Check whether query results contain personal data before processing them further or logging them in debug output.