> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blobhub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Session Graph Elements

Fetch multiple elements from a graph session object by id in a single call.

## **POST** `/revisions/:id/data/query` (Command: `get_session_graph_elements`)

Ids that do not exist in the graph are silently omitted from the response (no error is raised for
missing ids). This makes the command safe to use for cache-warming after receiving a
`session_graph_changed` event: pass all changed `element_id` values from the event's `changes`
array and the server returns whichever still exist.

### Request Body

| Parameter     | Type            | Required | Description                                         |
| :------------ | :-------------- | :------- | :-------------------------------------------------- |
| `engine`      | string          | Yes      | Must be `workflow_blobhub`.                         |
| `command`     | string          | Yes      | Must be `get_session_graph_elements`.               |
| `session_id`  | string          | Yes      | The ID of the session that owns the graph envelope. |
| `alias`       | string          | Yes      | Alias of the graph session object.                  |
| `element_ids` | array of string | Yes      | The ids of the vertices or edges to retrieve.       |

### Response

| Parameter  | Type            | Description                                                               |
| :--------- | :-------------- | :------------------------------------------------------------------------ |
| `elements` | array of object | The retrieved elements. Missing ids are omitted; order is not guaranteed. |

### Errors

* `invalid_graph_envelope` — the alias does not exist or its `value.type` is not `"graph"`.

### Example

<CodeGroup>
  ```json Request theme={null}
  {
    "engine": "workflow_blobhub",
    "command": "get_session_graph_elements",
    "session_id": "sess_001",
    "alias": "task_graph",
    "element_ids": ["task:1", "task:2", "e:1"]
  }
  ```

  ```json Response theme={null}
  {
    "elements": [
      {
        "element_id": "task:1",
        "type": "vertex",
        "labels": ["task"],
        "props": { "title": "Research", "status": "in_progress" },
        "rev": 2,
        "created_at": "2026-06-06T10:00:00.000000+00:00",
        "updated_at": "2026-06-06T10:00:01.000000+00:00",
        "user_id": "usr_001"
      },
      {
        "element_id": "task:2",
        "type": "vertex",
        "labels": ["task"],
        "props": { "title": "Write report", "status": "open" },
        "rev": 1,
        "created_at": "2026-06-06T10:00:00.000000+00:00",
        "updated_at": "2026-06-06T10:00:00.000000+00:00",
        "user_id": "usr_001"
      },
      {
        "element_id": "e:1",
        "type": "edge",
        "label": "depends_on",
        "from_id": "task:2",
        "to_id": "task:1",
        "props": {},
        "rev": 1,
        "created_at": "2026-06-06T10:00:00.000000+00:00",
        "updated_at": "2026-06-06T10:00:00.000000+00:00",
        "user_id": "usr_001"
      }
    ]
  }
  ```
</CodeGroup>

### See also

* [Graph session object](/blob-types/workflow/session-objects/graph/introduction) — envelope shape and element schema.
* [Apply Session Graph Mutations](/blob-types/workflow/operations/apply-session-graph-mutations) — write vertices and edges.
* [Get Session Graph Element](/blob-types/workflow/operations/get-session-graph-element) — fetch a single element by id.
* [List Session Graph Elements](/blob-types/workflow/operations/list-session-graph-elements) — paginate all elements.
* [List Session Graph Neighbors](/blob-types/workflow/operations/list-session-graph-neighbors) — fetch neighbors of a set of vertices.
* [Query Session Graph](/blob-types/workflow/operations/query-session-graph) — traverse the graph with a query AST.
* [`session_graph_changed` event](/blob-types/workflow/workflows/session-events) — use `changes[].element_id` values as input to this command to sync a local cache.
