I/O (Flowgraph Node)
- **Node Name:** `I/O`
Overview
- Node Name:
I/O - Category: macro
- Hidden: yes
- Undeleteable: yes
- File:
extensions/flowgraph/nodes/macro/io.lua
Handles input/output between a sub-graph (macro) and its parent graph via the Integrated node. Every sub-graph has one "in" I/O node and one "out" I/O node.
Properties
| Property | Description |
|---|---|
macro | 1 - marks this as a macro node |
hidden | true - not shown in the node palette |
undeleteable | true - cannot be removed by the user |
savePins | true - pins are serialized |
ioType | "in" or "out" - direction of data flow |
Behavior
init()- Enables pin saving, sets ioType to"io"(must be overridden to"in"or"out"on deserialization), disables clearing output pins on start, and marks itself as non-root.work()- Forouttype nodes: when flow reaches this node, signals the parent Integrated node to update its output pins by callingintegratedNode:updatePins()._onSerialize(res)- Saves name, color, and ioType. Logs an error if ioType is still"io"._onDeserialized(nodeData)- Restores name, color, ioType. SetsallowCustomOutPinsfor "in" nodes andallowCustomInPinsfor "out" nodes, enabling the user to add pins in the editor.doubleClicked()- Navigates to the target (parent) graph in the editor.drawMiddle()- Shows the target graph name and a hover preview.
How It Works
I/O nodes are the endpoints of a sub-graph. They come in pairs:
-
"in" I/O node: Receives data from the parent graph. The Integrated node copies its input pin values to this node's output pins, making them available inside the sub-graph. Users can add custom output pins to define what data the sub-graph accepts.
-
"out" I/O node: Sends data back to the parent graph. When flow reaches this node, it triggers the Integrated node to read the values from its input pins and copy them to the Integrated node's output pins. Users can add custom input pins to define what data the sub-graph returns.
Example Usage
-- Inside a sub-graph/macro:
-- [I/O In] → custom out pins → sub-graph logic → [I/O Out]
--
-- The I/O In node's output pins mirror the Integrated node's input pins
-- The I/O Out node's input pins mirror the Integrated node's output pins
--
-- Add pins to I/O nodes in the editor to define the macro's interface
-- The parent Integrated node automatically updates to matchSee Also
- Foreach (Flowgraph Node) - Related reference
- Get Foreach (Flowgraph Node) - Related reference
- Integrated (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide