> ## 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

[Overview](./overview) > Inworld Graph

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

Represents a blueprintable and programmable runtime graph. Provides functionality for creating, compiling, and executing graphs asynchronously using callbacks. The graph can manage nodes, edges, and execution states for real-time execution purposes.

## Methods

* [CancelAllExecutions](#cancelallexecutions)
* [CancelExecution](#cancelexecution)
* [CheckNodeByName](#checknodebyname)
* [GetAllExecutions](#getallexecutions)
* [GetExecutionInfo](#getexecutioninfo)
* [GetExecutionMode](#getexecutionmode)
* [GetExecutionStatus](#getexecutionstatus)
* [GetGraphInstance](#getgraphinstance)
* [GetGraphInstance](#getgraphinstance)
* [GetNodeByName](#getnodebyname)
* [GetNodeByName](#getnodebyname)
* [GetNodeByName](#getnodebyname)
* [GetPendingExecutionsCount](#getpendingexecutionscount)
* [GetRunningExecutionsCount](#getrunningexecutionscount)
* [IsCompiled](#iscompiled)
* [IsExecutionCanceled](#isexecutioncanceled)
* [Lock](#lock)
* [SetExecutionMode](#setexecutionmode)
* [SetGraphId](#setgraphid)

## Reference

### CancelAllExecutions

Cancels all ongoing and pending executions

<img src="https://mintcdn.com/inworldai/StlB2j_TRDiuzJEK/img/unreal/runtime/nd_img_CancelAllExecutions.png?fit=max&auto=format&n=StlB2j_TRDiuzJEK&q=85&s=d3455827daea41eca1faf02379d3e1a8" alt="CancelAllExecutions Blueprint Node" width="191" height="108" data-path="img/unreal/runtime/nd_img_CancelAllExecutions.png" />

## Examples

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

***

### CancelExecution

Cancels an ongoing graph execution

<img src="https://mintcdn.com/inworldai/StlB2j_TRDiuzJEK/img/unreal/runtime/nd_img_CancelExecution.png?fit=max&auto=format&n=StlB2j_TRDiuzJEK&q=85&s=d698d9934151ea8c86999a1fa51d6e76" alt="CancelExecution Blueprint Node" width="191" height="143" data-path="img/unreal/runtime/nd_img_CancelExecution.png" />

## Examples

```c++ theme={"system"}
void CancelExecution(const FString& ExecutionId)
```

#### Parameters

| Parameter   | Type             | Description                               |
| ----------- | ---------------- | ----------------------------------------- |
| ExecutionId | `const FString&` | The identifier of the execution to cancel |

***

### CheckNodeByName

Utility function for determining if a node exists in the graph

## Examples

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

#### Returns

**Type:** `bool`
**Description:** true if a node with the name exists, false otherwise

***

### GetAllExecutions

Gets all current executions (running and pending)

<img src="https://mintcdn.com/inworldai/mZNEEtl7pbzQ55cC/img/unreal/runtime/nd_img_GetAllExecutions.png?fit=max&auto=format&n=mZNEEtl7pbzQ55cC&q=85&s=7c6da5d96af41537543ecd68c91e6ade" alt="GetAllExecutions Blueprint Node" width="202" height="76" data-path="img/unreal/runtime/nd_img_GetAllExecutions.png" />

## Examples

```c++ theme={"system"}
TArray<FInworldGraphExecution> GetAllExecutions()
```

#### Returns

**Type:** `TArray<FInworldGraphExecution>`
**Description:** Array of all current executions

***

### GetExecutionInfo

Gets information about a specific execution

<img src="https://mintcdn.com/inworldai/jW_EGJyM8Okshayp/img/unreal/runtime/nd_img_GetExecutionInfo.png?fit=max&auto=format&n=jW_EGJyM8Okshayp&q=85&s=05ea0ae9bd2a3974c2ff40f50ac95fcf" alt="GetExecutionInfo Blueprint Node" width="255" height="111" data-path="img/unreal/runtime/nd_img_GetExecutionInfo.png" />

## Examples

```c++ theme={"system"}
FInworldGraphExecution GetExecutionInfo(const FString& ExecutionId)
```

#### Parameters

| Parameter   | Type             | Description                     |
| ----------- | ---------------- | ------------------------------- |
| ExecutionId | `const FString&` | The identifier of the execution |

#### Returns

**Type:** `FInworldGraphExecution`
**Description:** The execution information, or empty struct if not found

***

### GetExecutionMode

Gets the current execution mode

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

## Examples

```c++ theme={"system"}
EInworldGraphExecutionMode GetExecutionMode()
```

#### Returns

**Type:** `EInworldGraphExecutionMode`
**Description:** The current execution mode

***

### GetExecutionStatus

Gets the status of a specific execution

<img src="https://mintcdn.com/inworldai/jW_EGJyM8Okshayp/img/unreal/runtime/nd_img_GetExecutionStatus.png?fit=max&auto=format&n=jW_EGJyM8Okshayp&q=85&s=907a39a73d77ac3a4c586ecd87255076" alt="GetExecutionStatus Blueprint Node" width="255" height="111" data-path="img/unreal/runtime/nd_img_GetExecutionStatus.png" />

## Examples

```c++ theme={"system"}
EInworldGraphExecutionStatus GetExecutionStatus(const FString& ExecutionId)
```

#### Parameters

| Parameter   | Type             | Description                     |
| ----------- | ---------------- | ------------------------------- |
| ExecutionId | `const FString&` | The identifier of the execution |

#### Returns

**Type:** `EInworldGraphExecutionStatus`
**Description:** The current status of the execution

***

### GetGraphInstance

Creates and compile an instance of the given InworldGraph asset.

<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` | Called when the graph initialization is finished |

***

### 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()
```

***

### GetNodeByName

Utility function for grabbing a member node by its unique id

<img src="https://mintcdn.com/inworldai/jW_EGJyM8Okshayp/img/unreal/runtime/nd_img_GetNodeByName.png?fit=max&auto=format&n=jW_EGJyM8Okshayp&q=85&s=b5863bf8d5f80260bbe7163927c39242" alt="GetNodeByName Blueprint Node" width="301" height="165" data-path="img/unreal/runtime/nd_img_GetNodeByName.png" />

## Examples

```c++ theme={"system"}
UInworldNode* GetNodeByName(
    const FString& NodeName,
    TSubclassOf<UInworldNode> NodeClass
)
```

#### Parameters

| Parameter | Type                        | Description                                |
| --------- | --------------------------- | ------------------------------------------ |
| NodeName  | `const FString&`            | unique id of the node to look for          |
| NodeClass | `TSubclassOf<UInworldNode>` | The class to convert the node to on return |

#### Returns

**Type:** `UInworldNode*`
**Description:** Pointer to the node with the given name, or nullptr if not found

***

### GetNodeByName

<img src="https://mintcdn.com/inworldai/jW_EGJyM8Okshayp/img/unreal/runtime/nd_img_GetNodeByName.png?fit=max&auto=format&n=jW_EGJyM8Okshayp&q=85&s=b5863bf8d5f80260bbe7163927c39242" alt="GetNodeByName Blueprint Node" width="301" height="165" data-path="img/unreal/runtime/nd_img_GetNodeByName.png" />

## Examples

```c++ theme={"system"}
return GetNodeByName()
```

#### Returns

**Type:** `return`

***

### GetNodeByName

<img src="https://mintcdn.com/inworldai/jW_EGJyM8Okshayp/img/unreal/runtime/nd_img_GetNodeByName.png?fit=max&auto=format&n=jW_EGJyM8Okshayp&q=85&s=b5863bf8d5f80260bbe7163927c39242" alt="GetNodeByName Blueprint Node" width="301" height="165" data-path="img/unreal/runtime/nd_img_GetNodeByName.png" />

## Examples

```c++ theme={"system"}
UInworldNode* GetNodeByName()
```

#### Returns

**Type:** `UInworldNode*`

***

### GetPendingExecutionsCount

Gets the number of pending executions

<img src="https://mintcdn.com/inworldai/FLbWLM7DwaqfvDaU/img/unreal/runtime/nd_img_GetPendingExecutionsCount.png?fit=max&auto=format&n=FLbWLM7DwaqfvDaU&q=85&s=890c9cc49dd9fb3328b724da16a21405" alt="GetPendingExecutionsCount Blueprint Node" width="239" height="76" data-path="img/unreal/runtime/nd_img_GetPendingExecutionsCount.png" />

## Examples

```c++ theme={"system"}
int32 GetPendingExecutionsCount()
```

#### Returns

**Type:** `int32`
**Description:** Number of pending executions

***

### GetRunningExecutionsCount

Gets the number of currently running executions

<img src="https://mintcdn.com/inworldai/FLbWLM7DwaqfvDaU/img/unreal/runtime/nd_img_GetRunningExecutionsCount.png?fit=max&auto=format&n=FLbWLM7DwaqfvDaU&q=85&s=68fccc215f84296ce13cd281a2bdaa2e" alt="GetRunningExecutionsCount Blueprint Node" width="239" height="76" data-path="img/unreal/runtime/nd_img_GetRunningExecutionsCount.png" />

## Examples

```c++ theme={"system"}
int32 GetRunningExecutionsCount()
```

#### Returns

**Type:** `int32`
**Description:** Number of running executions

***

### IsCompiled

Checks if the graph has been compiled

<img src="https://mintcdn.com/inworldai/UjBJ5lUznbajzMw5/img/unreal/runtime/nd_img_IsCompiled.png?fit=max&auto=format&n=UjBJ5lUznbajzMw5&q=85&s=112394ce147ff02423136a02eca45573" alt="IsCompiled Blueprint Node" width="206" height="76" data-path="img/unreal/runtime/nd_img_IsCompiled.png" />

## Examples

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

#### Returns

**Type:** `bool`
**Description:** True if the graph is compiled, false otherwise

***

### IsExecutionCanceled

Checks if an execution is canceled

<img src="https://mintcdn.com/inworldai/UjBJ5lUznbajzMw5/img/unreal/runtime/nd_img_IsExecutionCanceled.png?fit=max&auto=format&n=UjBJ5lUznbajzMw5&q=85&s=8d4097bf57100aa4e6c849557eabe35f" alt="IsExecutionCanceled Blueprint Node" width="255" height="143" data-path="img/unreal/runtime/nd_img_IsExecutionCanceled.png" />

## Examples

```c++ theme={"system"}
bool IsExecutionCanceled(const FString& ExecutionId)
```

#### Parameters

| Parameter   | Type             | Description                              |
| ----------- | ---------------- | ---------------------------------------- |
| ExecutionId | `const FString&` | The identifier of the execution to check |

#### Returns

**Type:** `bool`
**Description:** True if the execution is canceled, false otherwise

***

### Lock

## Examples

```c++ theme={"system"}
FScopeLock Lock()
```

#### Returns

**Type:** `FScopeLock`

***

### SetExecutionMode

Sets the execution mode for the graph

<img src="https://mintcdn.com/inworldai/UjBJ5lUznbajzMw5/img/unreal/runtime/nd_img_SetExecutionMode.png?fit=max&auto=format&n=UjBJ5lUznbajzMw5&q=85&s=02f5e3f4ceb53ee14be897c48fc63857" alt="SetExecutionMode Blueprint Node" width="290" height="166" data-path="img/unreal/runtime/nd_img_SetExecutionMode.png" />

## Examples

```c++ theme={"system"}
void SetExecutionMode(EInworldGraphExecutionMode Mode)
```

#### Parameters

| Parameter | Type                         | Description               |
| --------- | ---------------------------- | ------------------------- |
| Mode      | `EInworldGraphExecutionMode` | The execution mode to set |

***

### SetGraphId

Utility function for changing the graph's string identifier

## Examples

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

***
