# langxiyi/flowstateplugin architecture

> Architecture diagram of the GitHub repository langxiyi/flowstateplugin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/langxiyi/flowstateplugin
- Repository: https://github.com/langxiyi/flowstateplugin

## Overview

FlowStateMachine is an Unreal Engine state-machine plugin with a graph-based authoring editor, runtime state/node model, shared data and metadata, asset creation, Blueprint nodes, and widget-layer helpers. The principal workflow is to author a machine graph, compile graph nodes into runtime nodes, then use the machine and its shared data during gameplay. The excerpts substantiate graph-to-runtime conversion and common-data access; most runtime execution and widget wiring were not sampled, so those connections are omitted.

Main entry points: [`Source/FlowStateMachine_Editor/Private/Graph/FSMGraph.cpp`](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Editor/Private/Graph/FSMGraph.cpp) (Machine graph), [`Source/FlowStateMachine_AssetType/Private/Factories/FlowStateMachineFactories.cpp`](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_AssetType/Private/Factories/FlowStateMachineFactories.cpp) (Asset factories), [`Source/FlowStateMachine/Private/SM/FSMCommonDataManager.cpp`](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/SM/FSMCommonDataManager.cpp) (Data manager), [`Source/FlowStateMachine_Editor/Private/FSMGraphEditor.cpp`](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Editor/Private/FSMGraphEditor.cpp) (Graph editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Graph authoring"]
  node_editor["Graph editor<br/>[FSMGraphEditor.cpp]"]
  node_graph["Machine graph<br/>[FSMGraph.cpp]"]
  node_graphnodes["Graph nodes"]
  node_schema["Graph schema"]
end

subgraph group_runtime["State runtime"]
  node_runtimegraph["Runtime node model<br/>[FSMRuntimeNode.cpp]"]
  node_state["State nodes"]
  node_composites["Composite nodes"]
  node_jump["Jump node"]
  node_subnodes["Runtime subnodes"]
  node_services["State services"]
  node_machine["State machine"]
  node_context["Execution context"]
end

subgraph group_data["Shared data"]
  node_commondata[("Common data asset<br/>[FSMCommonData.cpp]")]
  node_manager["Data manager"]
  node_datatypes["Typed values"]
end

subgraph group_assets["Assets and metadata"]
  node_metadata["Metadata fragments"]
  node_metaasset[("Metadata asset")]
  node_factories["Asset factories"]
  node_assettypes["Asset type actions"]
end

subgraph group_integrations["Blueprint and UI"]
  node_blueprintnodes["Blueprint nodes"]
  node_actions["Gameplay actions"]
  node_widgetlayers["Widget layers"]
  node_layout["Widget layout"]
end

node_designer(("Designer"))
node_game(("Game / Blueprint"))

node_designer -->|"authors in"| node_editor
node_editor -->|"opens graph"| node_graph
node_graph -->|"refreshes nodes"| node_graphnodes
node_graph -->|"builds runtime"| node_runtimegraph
node_factories -->|"creates machine"| node_machine
node_factories -->|"creates metadata"| node_metaasset
node_manager -->|"duplicates asset"| node_commondata
node_manager -->|"reads and sets"| node_datatypes
node_metadata -.->|"uses fragments"| node_metaasset
node_game -.->|"runs machine"| node_machine
node_game -.->|"uses nodes"| node_blueprintnodes
node_actions -.->|"creates widgets"| node_layout
node_widgetlayers -.->|"exposes layers"| node_layout
node_assettypes -.->|"registers actions"| node_factories

click node_editor "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Editor/Private/FSMGraphEditor.cpp"
click node_graph "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Editor/Private/Graph/FSMGraph.cpp"
click node_graphnodes "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Editor/Private/Node/FSMGraphNodeBase.cpp"
click node_schema "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Editor/Private/Graph/Schema/EdGraphSchema_FSM.cpp"
click node_runtimegraph "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeNode.cpp"
click node_state "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeNode_State.cpp"
click node_composites "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeNode_Composites.cpp"
click node_jump "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/RuntimeNode/Composites/FSMRuntimeNode_Jump.cpp"
click node_subnodes "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeSubNode.cpp"
click node_services "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeSubNode_Service.cpp"
click node_machine "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/SM/FlowStateMachine.cpp"
click node_context "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/SM/FlowStateContext.cpp"
click node_commondata "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/Data/FSMCommonData.cpp"
click node_manager "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/SM/FSMCommonDataManager.cpp"
click node_datatypes "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/Data/CommonDataType/FSMCommonDataType.cpp"
click node_metadata "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/Data/DataFragments/FSMMetaDataFragment_Assets.cpp"
click node_metaasset "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/Data/FSMMetaDataAsset.cpp"
click node_factories "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_AssetType/Private/Factories/FlowStateMachineFactories.cpp"
click node_assettypes "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_AssetType/Private/FlowStateMachine_AssetType.cpp"
click node_blueprintnodes "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Node/Private/Nodes/K2Node_SpawnAndBindActor.cpp"
click node_actions "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/Actions/Actions_CreateWidgets.cpp"
click node_widgetlayers "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Widget/Private/Widgets/FlowStateWidgetLayerManager.cpp"
click node_layout "https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Widget/Private/Widgets/FlowStateLayoutWidget.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_editor,node_graph,node_graphnodes,node_schema toneBlue
class node_runtimegraph,node_state,node_composites,node_jump,node_subnodes,node_services,node_machine,node_context toneAmber
class node_commondata,node_manager,node_datatypes toneMint
class node_metadata,node_metaasset,node_factories,node_assettypes toneRose
class node_blueprintnodes,node_actions,node_widgetlayers,node_layout,node_designer,node_game toneIndigo
```

## Components

### Graph authoring

- [Graph editor](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Editor/Private/FSMGraphEditor.cpp): `Source/FlowStateMachine_Editor/Private/FSMGraphEditor.cpp`
- [Machine graph](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Editor/Private/Graph/FSMGraph.cpp): `Source/FlowStateMachine_Editor/Private/Graph/FSMGraph.cpp`
- [Graph nodes](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Editor/Private/Node/FSMGraphNodeBase.cpp): `Source/FlowStateMachine_Editor/Private/Node/FSMGraphNodeBase.cpp`
- [Graph schema](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Editor/Private/Graph/Schema/EdGraphSchema_FSM.cpp): `Source/FlowStateMachine_Editor/Private/Graph/Schema/EdGraphSchema_FSM.cpp`

### State runtime

- [Runtime node model](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeNode.cpp): `Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeNode.cpp`
- [State nodes](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeNode_State.cpp): `Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeNode_State.cpp`
- [Composite nodes](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeNode_Composites.cpp): `Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeNode_Composites.cpp`
- [Jump node](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/RuntimeNode/Composites/FSMRuntimeNode_Jump.cpp): `Source/FlowStateMachine/Private/RuntimeNode/Composites/FSMRuntimeNode_Jump.cpp`
- [Runtime subnodes](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeSubNode.cpp): `Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeSubNode.cpp`
- [State services](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeSubNode_Service.cpp): `Source/FlowStateMachine/Private/RuntimeNode/FSMRuntimeSubNode_Service.cpp`
- [State machine](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/SM/FlowStateMachine.cpp): `Source/FlowStateMachine/Private/SM/FlowStateMachine.cpp`
- [Execution context](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/SM/FlowStateContext.cpp): `Source/FlowStateMachine/Private/SM/FlowStateContext.cpp`

### Shared data

- [Common data asset](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/Data/FSMCommonData.cpp): `Source/FlowStateMachine/Private/Data/FSMCommonData.cpp`
- [Data manager](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/SM/FSMCommonDataManager.cpp): `Source/FlowStateMachine/Private/SM/FSMCommonDataManager.cpp`
- [Typed values](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/Data/CommonDataType/FSMCommonDataType.cpp): `Source/FlowStateMachine/Private/Data/CommonDataType/FSMCommonDataType.cpp`

### Assets and metadata

- [Metadata fragments](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/Data/DataFragments/FSMMetaDataFragment_Assets.cpp): `Source/FlowStateMachine/Private/Data/DataFragments/FSMMetaDataFragment_Assets.cpp`
- [Metadata asset](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/Data/FSMMetaDataAsset.cpp): `Source/FlowStateMachine/Private/Data/FSMMetaDataAsset.cpp`
- [Asset factories](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_AssetType/Private/Factories/FlowStateMachineFactories.cpp): `Source/FlowStateMachine_AssetType/Private/Factories/FlowStateMachineFactories.cpp`
- [Asset type actions](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_AssetType/Private/FlowStateMachine_AssetType.cpp): `Source/FlowStateMachine_AssetType/Private/FlowStateMachine_AssetType.cpp`

### Blueprint and UI

- [Blueprint nodes](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Node/Private/Nodes/K2Node_SpawnAndBindActor.cpp): `Source/FlowStateMachine_Node/Private/Nodes/K2Node_SpawnAndBindActor.cpp`
- [Gameplay actions](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine/Private/Actions/Actions_CreateWidgets.cpp): `Source/FlowStateMachine/Private/Actions/Actions_CreateWidgets.cpp`
- [Widget layers](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Widget/Private/Widgets/FlowStateWidgetLayerManager.cpp): `Source/FlowStateMachine_Widget/Private/Widgets/FlowStateWidgetLayerManager.cpp`
- [Widget layout](https://github.com/langxiyi/flowstateplugin/blob/main/Source/FlowStateMachine_Widget/Private/Widgets/FlowStateLayoutWidget.cpp): `Source/FlowStateMachine_Widget/Private/Widgets/FlowStateLayoutWidget.cpp`

### Other components

- **Designer**
- **Game / Blueprint**

## Connections

- Designer → Graph editor: authors in
- Graph editor → Machine graph: opens graph (evidence: `Source/FlowStateMachine_Editor/Private/FSMGraphEditor.cpp`)
- Machine graph → Graph nodes: refreshes nodes (evidence: `Source/FlowStateMachine_Editor/Private/Graph/FSMGraph.cpp`)
- Machine graph → Runtime node model: builds runtime (evidence: `Source/FlowStateMachine_Editor/Private/Graph/FSMGraph.cpp`)
- Asset factories → State machine: creates machine (evidence: `Source/FlowStateMachine_AssetType/Private/Factories/FlowStateMachineFactories.cpp`)
- Asset factories → Metadata asset: creates metadata (evidence: `Source/FlowStateMachine_AssetType/Private/Factories/FlowStateMachineFactories.cpp`)
- Data manager → Common data asset: duplicates asset (evidence: `Source/FlowStateMachine/Private/SM/FSMCommonDataManager.cpp`)
- Data manager → Typed values: reads and sets (evidence: `Source/FlowStateMachine/Private/SM/FSMCommonDataManager.cpp`)
- Metadata fragments → Metadata asset: uses fragments
- Game / Blueprint → State machine: runs machine
- Game / Blueprint → Blueprint nodes: uses nodes
- Gameplay actions → Widget layout: creates widgets
- Widget layers → Widget layout: exposes layers
- Asset type actions → Asset factories: registers actions
