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

# Inworld Graph Asset

[Overview](./overview) > Inworld Graph Asset

**Class:** `UInworldGraphAsset` | **Inherits from:** `UObject`

Asset representation of an Inworld graph for serialization and storage. This class serves as the asset representation of an Inworld graph, containing all nodes, edges, and configuration data necessary to create and execute runtime graphs. It provides functionality for graph validation, configuration generation, and runtime graph instance creation.

## Methods

* [GetGraphConfig](#getgraphconfig)
* [GetGraphInstance](#getgraphinstance)
* [GetGraphInstance](#getgraphinstance)
* [GetLevelNum](#getlevelnum)
* [GetNodesByLevel](#getnodesbylevel)
* [IsValidAsSubgraph](#isvalidassubgraph)
* [Print](#print)

## Reference

### GetGraphConfig

Retrieves the graph configuration as a string.

<img src="https://mintcdn.com/inworldai/jW_EGJyM8Okshayp/img/unreal/runtime/nd_img_GetGraphConfig.png?fit=max&auto=format&n=jW_EGJyM8Okshayp&q=85&s=b5088aec53cdebc0b983564270bf3558" alt="GetGraphConfig Blueprint Node" width="224" height="108" data-path="img/unreal/runtime/nd_img_GetGraphConfig.png" />

## Examples

```c++ theme={"system"}
const FString& GetGraphConfig()
```

#### Returns

**Type:** `const FString&`
**Description:** The graph configuration string.

***

### GetGraphInstance

Creates and returns a compiled graph instance asynchronously.

<img src="https://mintcdn.com/inworldai/jW_EGJyM8Okshayp/img/unreal/runtime/nd_img_GetGraphInstance.png?fit=max&auto=format&n=jW_EGJyM8Okshayp&q=85&s=3c857b4090c46a385af99a0c0db39a9a" alt="GetGraphInstance Blueprint Node" width="302" height="170" data-path="img/unreal/runtime/nd_img_GetGraphInstance.png" />

## Examples

```c++ theme={"system"}
void GetGraphInstance(FOnGraphCompiled Callback)
```

#### Parameters

| Parameter | Type               | Description                                       |
| --------- | ------------------ | ------------------------------------------------- |
| Callback  | `FOnGraphCompiled` | Delegate called when the graph instance is ready. |

***

### GetGraphInstance

<img src="https://mintcdn.com/inworldai/jW_EGJyM8Okshayp/img/unreal/runtime/nd_img_GetGraphInstance.png?fit=max&auto=format&n=jW_EGJyM8Okshayp&q=85&s=3c857b4090c46a385af99a0c0db39a9a" alt="GetGraphInstance Blueprint Node" width="302" height="170" data-path="img/unreal/runtime/nd_img_GetGraphInstance.png" />

## Examples

```c++ theme={"system"}
void GetGraphInstance()
```

***

### GetLevelNum

Gets the number of levels in the graph hierarchy.

<img src="https://mintcdn.com/inworldai/jW_EGJyM8Okshayp/img/unreal/runtime/nd_img_GetLevelNum.png?fit=max&auto=format&n=jW_EGJyM8Okshayp&q=85&s=9412b35f4e595d3867fdf6f84a88996a" alt="GetLevelNum Blueprint Node" width="224" height="76" data-path="img/unreal/runtime/nd_img_GetLevelNum.png" />

## Examples

```c++ theme={"system"}
int GetLevelNum()
```

#### Returns

**Type:** `int`
**Description:** The number of levels in the graph.

***

### GetNodesByLevel

Retrieves all nodes at a specific level in the graph hierarchy.

<img src="https://mintcdn.com/inworldai/jW_EGJyM8Okshayp/img/unreal/runtime/nd_img_GetNodesByLevel.png?fit=max&auto=format&n=jW_EGJyM8Okshayp&q=85&s=cf17c5137f319734e3291caddfafaa52" alt="GetNodesByLevel Blueprint Node" width="224" height="143" data-path="img/unreal/runtime/nd_img_GetNodesByLevel.png" />

## Examples

```c++ theme={"system"}
void GetNodesByLevel(
    int Level,
    TArray<UInworldNodeAsset*>& Nodes
)
```

#### Parameters

| Parameter | Type                          | Description                                   |
| --------- | ----------------------------- | --------------------------------------------- |
| Level     | `int`                         | The level to query for nodes.                 |
| Nodes     | `TArray<UInworldNodeAsset*>&` | Output array of nodes at the specified level. |

***

### IsValidAsSubgraph

Checks if this graph asset is valid for use as a subgraph.

<img src="https://mintcdn.com/inworldai/UjBJ5lUznbajzMw5/img/unreal/runtime/nd_img_IsValidAsSubgraph.png?fit=max&auto=format&n=UjBJ5lUznbajzMw5&q=85&s=62cec33eb5c034882609457a9116a1f3" alt="IsValidAsSubgraph Blueprint Node" width="224" height="76" data-path="img/unreal/runtime/nd_img_IsValidAsSubgraph.png" />

## Examples

```c++ theme={"system"}
bool IsValidAsSubgraph()
```

#### Returns

**Type:** `bool`
**Description:** True if the graph can be used as a subgraph, false otherwise.

***

### Print

Prints debug information about the graph.

<img src="https://mintcdn.com/inworldai/UjBJ5lUznbajzMw5/img/unreal/runtime/nd_img_Print.png?fit=max&auto=format&n=UjBJ5lUznbajzMw5&q=85&s=cf0959c745f0b5589cf7d65484d2a504" alt="Print Blueprint Node" width="224" height="176" data-path="img/unreal/runtime/nd_img_Print.png" />

## Examples

```c++ theme={"system"}
void Print(
    bool ToConsole,
    bool ToScreen
)
```

#### Parameters

| Parameter | Type   | Description                        |
| --------- | ------ | ---------------------------------- |
| ToConsole | `bool` | If true, prints to console output. |
| ToScreen  | `bool` | If true, prints to screen overlay. |

***
