Flowgraph Foreach Module
Minimal module that stores key-value iteration state for flowgraph projects spawned as foreach children. When a parent flowgraph iterates over a collection, each child manager gets a foreach module co
Minimal module that stores key-value iteration state for flowgraph projects spawned as foreach children. When a parent flowgraph iterates over a collection, each child manager gets a foreach module containing its assigned key and value.
No public module exports - created via _flowgraph_createModule(C).
Purpose
In the flowgraph system, a parent project can iterate over data by spawning child managers. Each child receives a foreach module pre-loaded with:
key- the iteration key (index or table key)value- the iteration valueparentGraphId- the parent graph that spawned this child
Key Methods
| Method | Signature | Description |
|---|---|---|
init | () | Calls clear(). |
clear | () | Resets parentGraphId, key, and value to nil. |
afterTrigger | () | No-op placeholder. |
executionStopped | () | No-op placeholder. |
executionStarted | () | No-op; logs key/value when debug logging is enabled (commented out). |
Properties
| Property | Default | Description |
|---|---|---|
moduleOrder | 1000 | Very late priority (runs after all other modules). |
parentGraphId | nil | ID of the parent graph that created this foreach child. |
key | nil | Current iteration key. |
value | nil | Current iteration value. |
Usage Context
-- Parent flowgraph iterates over a table:
-- For each entry, a child manager is spawned with:
local foreachModule = childMgr:getModule("foreach")
foreachModule.parentGraphId = parentGraph.id
foreachModule.key = iterKey
foreachModule.value = iterValue
-- Child nodes access iteration data:
local fe = self.mgr:getModule("foreach")
local myKey = fe.key
local myValue = fe.valueSee Also
- Flowgraph Action Module - Related reference
- Flowgraph AI Recording Module - Related reference
- Flowgraph Button Module - Related reference
- FlowGraph Guide - Guide
Flowgraph File Module
Provides persistent key-value file storage for flowgraph projects. Reads and writes JSON save files in the `settings/cloud/flowgraphSaveData/` directory. Used by nodes to persist state across sessions
Flowgraph Level Module
Manages level-loading coordination for flowgraph projects. Handles deferred function execution during level loads, prefab registration, and collision reload scheduling.