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.
| Property | Description |
|---|---|
| Inputs | None |
| Outputs | flow (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.
| Property | Description |
|---|---|
| Inputs | 3 inputs (typed by selected type) |
| Outputs | 1 merged output (same type as inputs) |
Configuration:
| Setting | Options | Description |
|---|---|---|
| Output Type | image, video, audio | Sets 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 --/
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.
| Property | Description |
|---|---|
| Inputs | image, video, or text (separate handles) |
| Outputs | Dynamic -- one output per configured branch |
Configuration:
| Setting | Description |
|---|---|
| Branches | Named branches with optional descriptions |
| Confidence Threshold | 10-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.
| Property | Description |
|---|---|
| Inputs | trigger (any type) |
| Outputs | retry_target (flow), max_exceeded (any), log |
Configuration:
| Setting | Range | Default | Description |
|---|---|---|---|
| Max Retries | 1-10 | 3 | Number 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.
| Property | Description |
|---|---|
| Inputs | items (any -- expects an array, typically from Data Feed) |
| Outputs | item (current item), index (text), total (text) |
Configuration:
| Setting | Options | Default | Description |
|---|---|---|---|
| Mode | parallel, sequential | parallel | Processing strategy |
| Concurrency | 1-10 | 5 | Max parallel items (parallel mode) |
| Error Mode | continue, stop, retry | continue | How to handle failures |
| Naming Pattern | Template 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.
| Property | Description |
|---|---|
| Inputs | Results from batch processing segment (any) |
| Outputs | Collected items (any), total count (text) |
Configuration:
| Setting | Options | Default | Description |
|---|---|---|---|
| Collection Mode | array, object, count | array | How results are collected |
| Include Errors | boolean | false | Include error information in output |
| Include Metadata | boolean | false | Include timing and iteration metadata |
| Result Filter | JavaScript 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.
| Property | Description |
|---|---|
| Inputs | Multiple any inputs (collects artifacts from upstream) |
| Outputs | selected (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.
| Property | Description |
|---|---|
| Inputs | 2 image inputs |
| Outputs | selected 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:
- Analyze content with clear category definitions
- Route to appropriate processing paths
- 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