session-users-from-json
The session-users-from-json node reads a parent JSON output, selects the user entries at usersPath, and makes the session’s users cover them through the Core API session users endpoint. It is the generic form of what react-utils does with USER_REGISTRATION events: HEAT Capture streams carry no HEAT Auth identity, only each capture instance’s origin_uuid, so a template that has already resolved origins to roles registers those origins as the session’s users. Dashboards then attribute themselves to them through dashboard_users (see dashboard-v2 upstream contract), which is what lists roles in the session header and makes a session visible to its trainees.
When to use it
Use it in capture templates where a node already knows which origin belongs to which seat or station (for example a system-arbex-js session model that binds headset origins to aircraft through the DIS application id). Put it directly under that node. No session metadata or Capture registration is required.
Behaviour
- Runs on the parent’s latest output.
- Entries whose id is not a GUID or an integer are skipped with a warning; entries without an id are skipped silently.
- Idempotent: existing links are kept; a link whose role or grouping differs from the data is removed and re-added (Core has no patch for a session user); nothing the data no longer mentions is removed.
- Output: a small JSON summary (
users,added,updated,unchanged,warnings).
Configuration
| Property | Default | Description |
|---|---|---|
usersPath | output.origins[?role && !central] | JMESPath selecting an array of objects or an object map of objects. |
idField | originUuid | Field holding the user id (Auth GUID, origin_uuid, or numeric core user id). |
roleField | role | Field holding the role (seat or station label). |
groupingField | grouping | Field holding the grouping. |
defaultGrouping | 1 | Grouping when the entry has none. |
defaultRole | Participant | Role when the entry has none. |
inputMode | latest | Input selection policy. |
Example
Parent output (a session model):
{
"output": {
"origins": [
{ "originUuid": "a289309f-…", "role": "Aircraft 1", "central": false },
{ "originUuid": "5eec86bf-…", "role": null, "label": "DIS feed", "central": true }
]
}
}Node configuration:
{ "inputMode": "latest", "usersPath": "output.origins[?role && !central]" }Result: one session user with external id a289309f-… and role Aircraft 1. The central DIS feed is not a user. A dashboard whose payload lists "dashboard_users": ["a289309f-…"] is attributed to that user.