---
title: "Graph"
description: "The `Graph` entity."
section: "Reference"
group: "Types"
order: 110
---

## Definition

```ts
interface Graph {
  id: string;
  graphDefinitionId: string;
  name: string;
  sourceId: string | null;
  sourceType: "file" | "manual" | "run" | null;
  createdBy: string;
  createdAt: string;
  nodeCount?: number | undefined;
  edgeCount?: number | undefined;
}
```

## Fields

| Field               | Type                                  | Notes                                                                       |
| ------------------- | ------------------------------------- | --------------------------------------------------------------------------- |
| `id`                | `string`                              | `readonly` `required`                                                       |
| `graphDefinitionId` | `string`                              | `required` — Graph definition this instance was extracted against.          |
| `name`              | `string`                              | `required` — Human-readable instance name.                                  |
| `sourceId`          | `string \| null`                      | `required` — ID of the source entity this graph was extracted from, if any. |
| `sourceType`        | `"file" \| "manual" \| "run" \| null` | `required` — Kind of source entity (e.g. file, email) this graph came from. |
| `createdBy`         | `string`                              | `required` — User who triggered the extraction.                             |
| `createdAt`         | `string`                              | `readonly` `required` — ISO-8601 timestamp of creation.                     |
| `nodeCount`         | `number \| undefined`                 | `optional` — Number of nodes in the instance, when included.                |
| `edgeCount`         | `number \| undefined`                 | `optional` — Number of edges in the instance, when included.                |
