API ReferenceGE Extensionsflowgraph
New Node Template
Template file demonstrating the structure for creating new flowgraph nodes. Shows all available pin types, node metadata fields, and the minimal `work()` entry point.
Template file demonstrating the structure for creating new flowgraph nodes. Shows all available pin types, node metadata fields, and the minimal work() entry point.
Node Metadata
| Field | Description |
|---|---|
C.name | Display name shown in the flowgraph editor |
C.description | Tooltip description for the node |
C.color | im.ImVec4(r,g,b,a) - node header color |
C.icon | Icon from ui_flowgraph_editor.nodeIcons |
C.category | Category for node browser organization |
C.tags | String array for search/filtering |
Pin Schema
The C.pinSchema table defines all input and output pins:
| Field | Type | Description |
|---|---|---|
dir | "in" or "out" | Pin direction |
type | string or table | Pin data type (see below) |
name | string | Pin identifier |
default | any | Default value (input pins only) |
description | string | Tooltip text |
tableType | string | Sub-type hint for table pins (output only) |
Available Pin Types
| Type | Default Example | Description |
|---|---|---|
"flow" | true | Execution flow signal |
"number" | 42 | Numeric value |
"bool" | true | Boolean toggle |
"string" | "Text" | Text value |
"vec3" | {1,2,3} | 3D vector |
"quat" | {0,0,0,1} | Quaternion rotation |
"color" | {1,1,1,0.5} | RGBA color |
"table" | nil | Generic table |
"any" | nil | Accepts any type |
| Multi-type | {'number','bool'} | Accepts multiple specified types |
Node Structure
local C = {}
C.name = 'My Custom Node'
C.description = "What this node does"
C.color = ui_flowgraph_editor.nodeColors.default
C.icon = ui_flowgraph_editor.nodeIcons.default
C.category = 'once_instant'
C.tags = { 'custom' }
C.pinSchema = {
-- Input pins
{ dir = 'in', type = 'flow', name = 'flow', default = true, description = "Execution trigger" },
{ dir = 'in', type = 'number', name = 'speed', default = 10, description = "Speed value" },
-- Output pins
{ dir = 'out', type = 'flow', name = 'flow', description = "Passes flow through" },
{ dir = 'out', type = 'bool', name = 'result', description = "Operation result" },
}
-- Called each frame when flow is active
function C:work()
-- Access input: self.pinIn.speed.value
-- Set output: self.pinOut.result.value = true
end
return _flowgraph_createNode(C)Common Node Categories
| Category | Behavior |
|---|---|
once_instant | workOnce() fires once per flow trigger |
once_p_duration | workOnce() fires once, node stays active for duration |
logic | Continuous work() called every frame with flow |
repeat_instant | work() called every frame |
Key Conventions
- Always end with
return _flowgraph_createNode(C)(not_flowgraph_createModule) - Use
C:work()for continuous nodes,C:workOnce()for single-fire nodes - Pin names must be unique within their direction
fixed = trueprevents user from removing the pinhidden = truehides pin by default (accessible via node properties)impulse = trueon flow outputs means the pin auto-resets after one trigger
See Also
- Flowgraph Base Module - Related reference
- Flowgraph Base State Node - Related reference
- Flowgraph Base Node - Related reference
- FlowGraph Guide - Guide