| title | node_id (graph function) |
|---|---|
| description | This article describes the node_id() function. |
| ms.topic | reference |
| ms.date | 10/29/2025 |
[!INCLUDE applies] [!INCLUDE fabric] [!INCLUDE azure-data-explorer]
The node_id function calculates the graph node identifier as it was set by the user either in make-graph or graph model.
Note
This function is used with the graph-match and graph-shortest-paths operators.
Warning
This feature is currently in public preview. Functionality and syntax are subject to change before General Availability.
node_id([node])
[!INCLUDE syntax-conventions-note]
| Name | Type | Required | Description |
|---|---|---|---|
| node | string |
The reference to a graph node variable in a graph pattern. Don't pass any parameters when used inside all(), any(), and map() graph functions, with inner_nodes(). |
Returns the node ID string representation of the input node or of all inner nodes, when used inside all(), any(), and map() functions with inner_nodes().
The following example creates a graph to analyze a hierarchical structure of employees and their managers.
:::moniker range="azure-data-explorer"
[!div class="nextstepaction"] Run the query ::: moniker-end
let employees = datatable(name:string, age:long)
[
"Alice", 32,
"Bob", 31,
"Eve", 27,
];
let reports = datatable(employee:string, manager:string)
[
"Bob", "Alice",
"Chris", "Alice",
"Eve", "Bob",
];
reports
| make-graph employee --> manager with employees on name
| graph-match (employee)-[reports*1..3]->(manager)
where node_id(employee) startswith "E"
project manager1 = node_id(manager), manager2 = map(inner_nodes(reports), node_id())Output
| manager_1 | manager_2 |
|---|---|
| Bob | [] |
| Alice | ["Bob"] |