API Reference GE Extensions flowgraph nodes util Template Node - **Node Name:** `Template Node`
Node Name: Template Node
Category: repeat_instant
File: extensions/flowgraph/nodes/util/template.lua
A reference template demonstrating all available functionality for creating new flowgraph nodes. Not intended for production use - serves as documentation for node developers.
Pin Type Default Description flowflow trueFlow pin numbernumber 42Number pin hidNumnumber 42Hidden number pin fixNumnumber 42Hardcoded number pin boolbool trueBoolean pin stringstring "Text"String pin vec3vec3 {1,2,3}3D vector pin quatquat {0,0,0,1}Quaternion pin colorcolor {1,1,1,0.5}Color pin tabletable nilTable pin anyany nilAny-type pin multinumber|bool nilMulti-type pin
Pin Type Description flowflow Flow pin numbernumber Number pin boolbool Boolean pin stringstring String pin vec3vec3 3D vector pin quatquat Quaternion pin colorcolor Color pin tabletable (generic) Table pin anyany Any-type pin multinumber|bool Multi-type pin
Category Behavior repeat_instantRuns every frame, instant result repeat_p_durationRuns every frame, takes time to prepare once_instantRuns once until reset, instant result once_p_durationRuns once, takes time to prepare once_f_durationRuns once, has temporal component (timer) dynamic_instantSwitches between once/repeat, instant simpleNo flow pins needed providerNo flow or input pins logicControls flowgraph flow
Method When Called init(mgr)Node created for the first time _executionStarted()Project begins execution work()Each frame during execution _executionStopped()Project stops execution _onClear()Before serialization or starting destroy()Node is deleted
Method Purpose drawCustomProperties()Custom imgui in property window; return string for undo point drawMiddle(builder, style)Custom imgui within the node body showProperties()Called when properties panel opens hideProperties()Called when properties panel closes
Method Purpose _onSerialize(res)Save custom fields into res (fields in self.data auto-save) _onDeserialized(data)Restore custom fields from data
This node is a comprehensive reference. Key takeaways for node developers:
self.data fields are automatically serialized - no need to handle them manually.
Custom fields (like self.myField) need explicit _onSerialize/_onDeserialized.
Pin names flow and value are auto-hidden for cleaner display.
drawCustomProperties() should return a string reason to create an undo/redo history point.
C.dependencies lists required extensions for performance (avoids runtime lookups).
-- Creating a minimal new node:
local C = {}
C. name = 'My Node'
C. description = 'Does something useful.'
C. category = 'repeat_instant'
C. pinSchema = {
{dir = 'in' , type = 'number' , name = 'value' , default = 0 , description = "Input value." },
{dir = 'out' , type = 'number' , name = 'result' , description = "Output result." },
}
C. tags = { 'mynode' }
function C : work ()
self . pinOut . result . value = self . pinIn . value . value * 2
end
return _flowgraph_createNode (C)
ui_imgui - ImGui bindings for custom UI
_flowgraph_createNode() - node registration function