---
title: "CreateGraphInstanceBody"
description: "Request body for a Graph operation."
section: "Reference"
group: "Types"
order: 111
---

## Definition

```ts
interface CreateGraphInstanceBody {
  name: string;
  sourceId?: string | undefined;
  sourceType?: "file" | "manual" | "run" | undefined;
  nodes?:
    | Array<{ nodeDefinitionId: string; label: string; properties: unknown }>
    | undefined;
  edges?:
    | Array<{
        edgeDefinitionId: string;
        sourceLabel: string;
        targetLabel: string;
        label: string;
        properties?: unknown;
      }>
    | undefined;
}
```

## Fields

| Field        | Type                                                                                                                               | Notes                                                                                                 |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `name`       | `string`                                                                                                                           | `required` — Instance name                                                                            |
| `sourceId`   | `string \| undefined`                                                                                                              | `optional` — Source ID for provenance                                                                 |
| `sourceType` | `"file" \| "manual" \| "run" \| undefined`                                                                                         | `optional` — Kind of source entity the graph was derived from.                                        |
| `nodes`      | `Array<{ nodeDefinitionId: string; label: string; properties: unknown; }> \| undefined`                                            | `optional` — Optional nodes to insert atomically with the graph row.                                  |
| `edges`      | `Array<{ edgeDefinitionId: string; sourceLabel: string; targetLabel: string; label: string; properties?: unknown; }> \| undefined` | `optional` — Optional edges connecting the same-batch nodes. Ignored unless `nodes` is also provided. |
