Flow Control
Inputs, outputs, and defaults of the 11 built-in nodes in the Flow Control category.
Generated from the pinned SoulFire source. Regenerate these pages with bun run generate-node-reference.
Branch
flow.branch
Branches execution based on a boolean condition
Also called: if, condition, switch, split.
Inputs
| Port | Type | Required / default | Description |
|---|---|---|---|
in (In) | exec | Optional | Execution input |
condition (Condition) | boolean | false | Condition to evaluate |
Outputs
| Port | Type | Description |
|---|---|---|
exec_true (True) | exec | Executes if condition is true |
exec_false (False) | exec | Executes if condition is false |
branch (Branch) | string | Which branch was taken |
condition (Condition) | boolean | The evaluated condition |
Cooldown
flow.debounce
Rate-limits execution by enforcing a cooldown period
Also called: Debounce, debounce, rate limit, throttle.
Inputs
| Port | Type | Required / default | Description |
|---|---|---|---|
in (In) | exec | Optional | Execution input |
cooldownMs (Cooldown (ms)) | number | 1000 | Milliseconds between allowed executions |
key (Key) | string | "default" | Unique key for this debounce |
Outputs
| Port | Type | Description |
|---|---|---|
exec_allowed (Allowed) | exec | Execution path if cooldown elapsed |
exec_denied (Denied) | exec | Execution path if still in cooldown |
allowed (Allowed) | boolean | Whether execution was allowed |
remainingMs (Remaining (ms)) | number | Milliseconds until next allowed execution |
For Each
flow.foreach
Iterates over each item in a list
Also called: foreach, loop, iterate, list, array.
Inputs
| Port | Type | Required / default | Description |
|---|---|---|---|
in (In) | exec | Optional | Execution input |
items (Items) | list<T> | Required | List of items to iterate |
Outputs
| Port | Type | Description |
|---|---|---|
exec_loop (Loop) | exec | Executes for each item |
exec_done (Done) | exec | Executes when iteration completes |
item (Item) | T | Current item |
index (Index) | number | Current index |
isComplete (Complete) | boolean | Whether iteration is done |
size (Size) | number | Total items count |
For Each Bot
flow.foreach_bot
Iterates over each bot in a list
Also called: foreach, bot, iterate, loop.
Inputs
| Port | Type | Required / default | Description |
|---|---|---|---|
in (In) | exec | Optional | Execution input |
bots (Bots) | list<bot> | Required | List of bots to iterate |
Outputs
| Port | Type | Description |
|---|---|---|
exec_loop (Loop) | exec | Executes for each bot |
exec_done (Done) | exec | Executes when iteration completes |
bot (Bot) | bot | Current bot in iteration |
index (Index) | number | Current bot index |
count (Count) | number | Total number of bots |
isComplete (Complete) | boolean | Whether iteration is done |
Gate
flow.gate
Conditionally passes through execution and values
Also called: filter, pass, block, conditional.
Inputs
| Port | Type | Required / default | Description |
|---|---|---|---|
in (In) | exec | Optional | Execution input |
condition (Condition) | boolean | true | Whether to allow pass-through |
value (Value) | any | Required | Value to pass through |
Outputs
| Port | Type | Description |
|---|---|---|
exec_allowed (Allowed) | exec | Executes if condition is true |
exec_blocked (Blocked) | exec | Executes if condition is false |
passed (Passed) | boolean | Whether execution was allowed |
value (Value) | any | The passed-through value |
Loop
flow.loop
Repeats execution a specified number of times
Also called: repeat, for, iterate, count.
Inputs
| Port | Type | Required / default | Description |
|---|---|---|---|
in (In) | exec | Optional | Execution input |
count (Count) | number | 10 | Number of iterations |
Outputs
| Port | Type | Description |
|---|---|---|
exec_loop (Loop) | exec | Executes for each iteration |
exec_done (Done) | exec | Executes when loop completes |
index (Index) | number | Current iteration index |
isComplete (Complete) | boolean | Whether loop is done |
count (Count) | number | Total iteration count |
Rate Limit
flow.rate_limit
Limits execution rate using a token bucket algorithm
Also called: rate, limit, throttle, bucket, spam, cooldown.
Inputs
| Port | Type | Required / default | Description |
|---|---|---|---|
in (In) | exec | Optional | Execution input |
key (Key) | string | "default" | Unique key for this rate limiter |
maxTokens (Max Tokens) | number | 10 | Maximum tokens in bucket |
refillRate (Refill Rate) | number | 1 | Tokens added per second |
tokensRequired (Tokens Required) | number | 1 | Tokens consumed per execution |
Outputs
| Port | Type | Description |
|---|---|---|
exec_allowed (Allowed) | exec | Execution path if allowed |
exec_denied (Denied) | exec | Execution path if rate limited |
wasAllowed (Was Allowed) | boolean | Whether execution was allowed |
tokensRemaining (Tokens Remaining) | number | Tokens left in bucket |
retryAfterMs (Retry After (ms)) | number | Milliseconds until tokens available |
Repeat Until
flow.repeat_until
Repeats execution until a condition is met (do-while semantics)
Also called: loop, repeat, until, while, condition, do-while.
Inputs
| Port | Type | Required / default | Description |
|---|---|---|---|
in (In) | exec | Optional | Execution input |
maxIterations (Max Iterations) | number | 10000 | Safety limit |
Outputs
| Port | Type | Description |
|---|---|---|
exec_loop (Loop) | exec | Executes for each iteration |
exec_check (Check) | exec | Evaluates condition after each iteration (must end with a Result node) |
exec_done (Done) | exec | Executes when condition is met or limit reached |
index (Index) | number | Current iteration index |
conditionMet (Condition Met) | boolean | Whether the condition was met (false if limit reached) |
Result
flow.result
Reports a boolean result back to a loop's check chain
Also called: check, condition, loop, terminal.
Inputs
| Port | Type | Required / default | Description |
|---|---|---|---|
in (In) | exec | Optional | Execution input |
value (Value) | boolean | false | The boolean result to report back to the enclosing loop |
Outputs
None.
Sequence
flow.sequence
Executes multiple branches in order
Also called: order, steps, then.
Inputs
| Port | Type | Required / default | Description |
|---|---|---|---|
in (In) | exec | Optional | Execution input |
branchCount (Branch Count) | number | 2 | Number of branches to execute |
Outputs
| Port | Type | Description |
|---|---|---|
exec_0 (Then 0) | exec | First branch |
exec_1 (Then 1) | exec | Second branch |
exec_2 (Then 2) | exec | Third branch |
exec_3 (Then 3) | exec | Fourth branch |
exec_4 (Then 4) | exec | Fifth branch |
exec_5 (Then 5) | exec | Sixth branch |
exec_6 (Then 6) | exec | Seventh branch |
exec_7 (Then 7) | exec | Eighth branch |
branchCount (Branch Count) | number | Number of branches |
Switch
flow.switch
Performs a multi-way branch based on a value
Also called: case, branch, select.
Inputs
| Port | Type | Required / default | Description |
|---|---|---|---|
in (In) | exec | Optional | Execution input |
value (Value) | string | "" | Value to switch on |
cases (Cases) | string | "case1,case2,case3" | Comma-separated case values |
Outputs
| Port | Type | Description |
|---|---|---|
exec_default (Default) | exec | Executes if no case matches |
exec_case0 (Case 0) | exec | Executes if case 0 matches |
exec_case1 (Case 1) | exec | Executes if case 1 matches |
exec_case2 (Case 2) | exec | Executes if case 2 matches |
exec_case3 (Case 3) | exec | Executes if case 3 matches |
exec_case4 (Case 4) | exec | Executes if case 4 matches |
exec_case5 (Case 5) | exec | Executes if case 5 matches |
exec_case6 (Case 6) | exec | Executes if case 6 matches |
exec_case7 (Case 7) | exec | Executes if case 7 matches |
branch (Branch) | string | Which case matched |
caseIndex (Case Index) | number | Index of matched case (-1 for default) |
matched (Matched) | boolean | Whether any case matched |
How is this page?
Last updated on
