Skip to main content
Fetch the neighbors of a set of vertices in a graph session object.

POST /revisions/:id/data/query (Command: list_session_graph_neighbors)

Returns the edges incident to the given source vertices and the vertices on the far end of those edges. The response is paginated and can be filtered by edge direction and type.

Request Body

ParameterTypeRequiredDescription
enginestringYesMust be workflow_blobhub.
commandstringYesMust be list_session_graph_neighbors.
session_idstringYesThe ID of the session that owns the graph envelope.
aliasstringYesAlias of the graph session object.
fromarray of stringYesSource vertex ids whose neighbors to fetch.
directionstringNoEdge traversal direction: "out", "in", or "both" (default).
labelstringNoFilter edges by label. Omit to return all edge types.
neighbor_labelstringNoFilter neighbor vertices by label.
cursorstringNoOpaque pagination cursor returned by a previous call.
limitintegerNoMaximum number of edges to return. Server enforces its own maximum.
direction — controls which edges are traversed (default: "both"):
  • "out" — edges where from_id is in from (outgoing).
  • "in" — edges where to_id is in from (incoming).
  • "both" — both directions. When paginating with direction: "both", the cursor is a composite token that tracks progress through both sets independently; always pass back the cursor verbatim.
label and neighbor_label may be combined to narrow results further (e.g. only "depends_on" edges leading to vertices labelled "task").

Response

ParameterTypeDescription
edgesarray of objectThe matching edges, in insertion order.
verticesarray of objectThe neighbor vertices referenced by the returned edges (deduped).
cursorstring or nullPagination cursor; null when this is the last page.

Errors

  • invalid_graph_envelope — the alias does not exist or its value.type is not "graph".
  • invalid_cursor — the cursor is malformed or has expired.

Example

{
  "engine": "workflow_blobhub",
  "command": "list_session_graph_neighbors",
  "session_id": "sess_001",
  "alias": "task_graph",
  "from": ["task:2"],
  "direction": "out",
  "label": "depends_on"
}

See also