Skip to main content

Flow Control Nodes

Flow control nodes manage workflow execution, enabling synchronization, conditions, batch processing, retry logic, and comparison.

Start​

Entry point for every workflow

The Start node triggers when you run the workflow. Every workflow must have exactly one Start node.

PropertyDescription
InputsNone
Outputsflow (flow trigger)

Features:

  • Built-in Run button with credit cost estimate
  • Shows a warning when you have insufficient credits
  • Connects to the first processing node in your workflow
  • No configuration needed

Sync Gate​

Wait for multiple inputs before continuing

The Sync Gate synchronizes multiple workflow branches, waiting until all connected inputs are ready before proceeding.

PropertyDescription
Inputs3 inputs (typed by selected type)
Outputs1 merged output (same type as inputs)

Configuration:

SettingOptionsDescription
Output Typeimage, video, audioSets the type for all handles

The handle type applies to both inputs and outputs. All 3 input handles and the single output handle share the same selected type.

Use cases:

  • Merge parallel branches before further processing
  • Ensure all data is ready before a downstream node executes
  • Wait for multiple generation operations to complete

Example:

Start --> Generate Image A --\
Generate Image B ----> Sync Gate --> Combine
Generate Image C --/
Chaining Sync Gates

For merge points with more than 3 inputs, the AI generator automatically chains multiple Sync Gate nodes together.


Conditional Switch​

Route media based on AI analysis

Analyzes input media using AI vision and routes it to different branches based on content classification. Each branch receives a confidence score, and the input is routed to the highest-scoring branch.

PropertyDescription
Inputsimage, video, or text (separate handles)
OutputsDynamic -- one output per configured branch

Configuration:

SettingDescription
BranchesNamed branches with optional descriptions
Confidence Threshold10-90% -- routes to default if best score is below this

Branch setup:

  • Each branch has a name and optional description to guide the AI classification
  • Minimum 2 branches required
  • Always include a "default" branch to handle unmatched content
  • Branches are dynamically added/removed via the node UI

Default branches:

  • product -- Product images and commercial shots
  • person -- People or portraits
  • default -- Everything else

Use cases:

  • Content moderation routing
  • Automated categorization (product vs. person vs. landscape)
  • Different processing pipelines for different content types

Retry Gate​

Automatically retry failed operations

Wraps downstream operations with automatic retry logic for handling transient failures like API timeouts or generation errors.

PropertyDescription
Inputstrigger (any type)
Outputsretry_target (flow), max_exceeded (any), log

Configuration:

SettingRangeDefaultDescription
Max Retries1-103Number of retry attempts before routing to failed output

Outputs explained:

  • Retry (flow) -- Connect to the operation that should be retried
  • Failed (any) -- Triggered when max retries are exceeded; connect to error handling or fallback logic
  • Log -- Retry history for debugging; connect to a Log node

Runtime display:

  • Shows current retry count vs. max retries
  • Tracks retry history with attempt numbers and timestamps
  • Visual indicator changes when max retries reached

Use cases:

  • AI generation (may fail due to model load or content filters)
  • External API calls with intermittent failures
  • Network-dependent operations

Batch Processor​

Process multiple items efficiently

Iterates over an array of items, executing the downstream workflow segment once per item. Items can be processed in parallel or sequentially.

PropertyDescription
Inputsitems (any -- expects an array, typically from Data Feed)
Outputsitem (current item), index (text), total (text)

Configuration:

SettingOptionsDefaultDescription
Modeparallel, sequentialparallelProcessing strategy
Concurrency1-105Max parallel items (parallel mode)
Error Modecontinue, stop, retrycontinueHow to handle failures
Naming PatternTemplate string--Output naming with {filename}, {index}, {total} variables

Error modes:

  • continue -- Skip failed items, process the rest
  • stop -- Halt on first error
  • retry -- Retry failed items before stopping

Context variables available within the batch loop:

  • $item -- The current item being processed
  • $index -- Current iteration index (0-based)
  • $total -- Total number of items

Visual indicators:

  • Edges within batch scope are displayed as dotted lines (strokeDasharray: '5,5')
  • Progress tracking shows completed/total count

Validation rules:

  • Must have a corresponding Batch End (or Sync Gate) as a merge point
  • Nested Batch Processors are not allowed
  • No circular dependencies within batch scope

Batch End​

Collect batch processing results

Collects results from all batch iterations and provides completion statistics. Must be paired with a Batch Processor node.

PropertyDescription
InputsResults from batch processing segment (any)
OutputsCollected items (any), total count (text)

Configuration:

SettingOptionsDefaultDescription
Collection Modearray, object, countarrayHow results are collected
Include ErrorsbooleanfalseInclude error information in output
Include MetadatabooleanfalseInclude timing and iteration metadata
Result FilterJavaScript expression--Filter results before collecting

Example workflow:

Data Feed --> Batch Processor --> Text to Image --> Batch End
| |
[10 items] [collect all]

Compare & Select​

Choose the best result from multiple options

Displays artifacts from multiple upstream nodes side by side, allowing you to select the best one to pass downstream. Useful for human-in-the-loop quality selection.

PropertyDescription
InputsMultiple any inputs (collects artifacts from upstream)
Outputsselected (the chosen artifact)

Features:

  • Shows visual previews of all incoming artifacts
  • Click to select the best result
  • Lightbox view for detailed comparison
  • Selected artifact is forwarded to downstream nodes

Use cases:

  • Compare outputs from different models
  • Quality gate before final processing
  • A/B testing of generation parameters

Compare Image​

Side-by-side image comparison

Provides a visual comparison of two images for quality assessment or difference detection.

PropertyDescription
Inputs2 image inputs
Outputsselected image

Use cases:

  • Before/after comparison (original vs. upscaled)
  • Model quality comparison
  • Visual quality assessment

Flow Control Tips​

Batch Processing Pattern​

Connect Batch Processor and Batch End for complete batch workflows:

Data Feed --> Batch Processor --> [Processing Nodes] --> Batch End

Recommended concurrency: 3-5 for most operations. For 100+ items, consider pagination or chunking.

Conditional Routing Pattern​

Use Conditional Switch with descriptive branch names:

  1. Analyze content with clear category definitions
  2. Route to appropriate processing paths
  3. Always include a default branch for edge cases

Error Handling Pattern​

Wrap unreliable operations with Retry Gate:

  • Connect the retry output back to the operation
  • Connect the failed output to error handling or fallback logic
  • Use the log output with a Log node to track retry attempts

Synchronization Pattern​

Use Sync Gate when multiple branches must complete before continuing:

  • All inputs must be ready before the output fires
  • Choose the correct type (image/video/audio) for your data
  • Chain multiple Sync Gates for more than 3 inputs