Overview
The Loop node allows you to repeat a sequence of tasks multiple times in your workflow. You can loop either a fixed number of times or iterate through a list of items. This is perfect for processing multiple files, handling user data in batches, or any repetitive operations.When to Use Loop Nodes
- Process multiple files or documents
- Handle lists of users, orders, or records
- Retry operations multiple times
- Generate multiple variations of content
- Batch process large datasets
Adding a Loop Node
- Drag the Loop node from the node palette onto your workflow canvas
- Connect it to your previous task
- Configure the loop settings in the properties panel
Required Configuration
Basic Settings
Node Name
- Field: Node Name
- Required: Yes
- Description: Give your loop a descriptive name like “Process User Records” or “Retry API Calls”
Iteration Type
- Field: Iteration Type
- Required: Yes
- Options:
- Count: Loop a specific number of times
- List: Loop through each item in an array
Iteration Parameter
- Field: Iteration Parameter
- Required: Yes
- Description: This controls how many times the loop runs or what list to iterate through
Setting Up Iteration Parameters
For Count Loops
When using Count iteration type, the parameter must be a number:Manual Entry
Reference from Previous Task
For List Loops
When using List iteration type, the parameter must be an array:Basic Array Reference
Object with Array Property
Nested Object Properties
Using the Parameter Picker
Instead of typing manually, you can use the parameter picker:- Click the “Select Parameter” button
- Choose the source task from the dropdown
- Select whether you want an input or output parameter
- Pick the specific field name
- For objects, drill down to the array property you need
The selected parameter must result in either a number (for count loops) or
an array (for list loops). If the parameter type doesn’t match, the loop
won’t work correctly.
Loop Flow Configuration
Loop Start Block
- Field: Loop Start Block
- Required: Yes
- Description: The first task that runs inside each loop iteration
- UI: Dropdown showing available tasks in your workflow
Loop End Block(s)
- Field: Loop End Blocks
- Required: Yes
- Description: The task(s) that can end each loop iteration
- UI: Multi-select dropdown for multiple possible end points
Exit Block
- Field: Exit Block
- Required: Yes
- Description: The task that runs after all loop iterations complete
- UI: Dropdown showing available tasks
Loop Structure Visual
Practical Examples
Example 1: Processing User List
Scenario: You have a list of users and want to send each one a personalized email. Configuration:- Iteration Type: List
- Iteration Parameter:
user_fetch.output.users
- Loop Start Block:
generate_email
- Loop End Block:
send_email
- Exit Block:
send_summary_report
Example 2: Retry Mechanism
Scenario: Try an API call up to 3 times if it fails. Configuration:- Iteration Type: Count
- Iteration Parameter:
3
- Loop Start Block:
make_api_call
- Loop End Block:
check_api_success
- Exit Block:
handle_final_result
Example 3: Batch File Processing
Scenario: Process files in batches based on system capacity. Configuration:- Iteration Type: Count
- Iteration Parameter:
config.output.number_of_batches
- Loop Start Block:
fetch_file_batch
- Loop End Block:
process_batch
- Exit Block:
consolidate_results
Advanced Parameter Examples
Simple Array from API Response
Nested Array in Complex Object
Configuration-Based Count
Calculated Count from Previous Task
Common Validation Errors
”Parameter must be an array”
- Problem: You selected List iteration but the parameter is not an array
- Solution: Choose a parameter that contains a list of items, or switch to Count iteration
”Parameter must be a number”
- Problem: You selected Count iteration but the parameter is not a number
- Solution: Choose a numeric parameter, or switch to List iteration
”Loop start block not found”
- Problem: The selected start block doesn’t exist in your workflow
- Solution: Create the task first, then select it as the start block
”Circular dependency detected”
- Problem: Your loop configuration creates a circular reference
- Solution: Ensure the loop exit block connects to a task outside the loop
Loop Variable Access
During each iteration, your tasks can access loop information through the special__loop__
variable:
Available Properties:
__loop__.current_iteration
- Current iteration number (starts at 0)__loop__.total_iterations
- Total number of iterations__loop__.current_item
- Current item being processed (List loops only)__loop__.is_first
- True if this is the first iteration__loop__.is_last
- True if this is the last iteration
Best Practices
✅ Do’s
- Use descriptive names for your loop nodes
- Test with small datasets before processing large lists
- Set reasonable limits for count-based loops
- Handle empty arrays gracefully in your workflow
- Use the parameter picker instead of typing parameter paths manually
❌ Don’ts
- Don’t create infinite loops - always ensure your count is reasonable
- Don’t forget error handling - plan for what happens if an iteration fails
- Don’t use loops for single items - use conditional logic instead
- Don’t nest loops too deeply - consider breaking complex logic into separate workflows
Troubleshooting
Loop Doesn’t Start
- Check that your iteration parameter actually contains data
- Verify the parameter path is correct using the parameter picker
- Ensure the previous task completed successfully
Loop Runs Forever
- Verify you’re using Count iteration with a specific number
- Check that List iteration has a finite array
- Ensure loop end blocks are properly connected
Tasks Not Found
- Make sure all referenced tasks exist in your workflow
- Use the dropdowns instead of typing task names manually
- Check that task names haven’t changed after configuration
Related Features
- Conditional Nodes - Add logic to control loop behavior
- Variables - Store and reuse values across loop iterations
- Error Handling - Manage failures within loops
- Workflow Testing - Test your loops with sample data