Loop Data
Iterate through data sets in your automation
The Loop Data block is a powerful tool that lets you repeat actions over a set of data. Think of it like a “repeat for each” instruction - for example, sending an email to each customer in a list, or clicking every product link on a page.
Inputs
☐ Description (Optional)
A brief note explaining what this loop will do. This helps you track your automation’s purpose.
Good Examples:
- “Process each row in customer data table”
- “Click through all product links on page”
- “Send welcome email to new subscribers”
Bad Examples:
- “Loop through stuff”
- “Do something multiple times”
Why they’re bad: Too vague, doesn’t specify what data is being processed
☐ Loop Type (Required)
Choose what type of data to iterate through:
Table
Description: Loop through rows in a data table or spreadsheet data.
Features:
☐ Each row becomes available as variables
☐ Process data row by row
☐ Works with CSV, Excel, or database exports
Example Use Case: Processing a customer list with columns for name, email, and status
Numbers
Description: Loop through a sequence of numbers, counting up or down.
Features:
☐ Define start and end numbers
☐ Control count direction
☐ Set custom step intervals
Example Use Case: Navigate through pages 1-10 of search results
Variable
Description: Loop through items stored in a variable from previous steps.
Features:
☐ Access array elements sequentially
☐ Use data from earlier automation steps
☐ Process lists dynamically
Example Use Case: Visit each URL from a list of collected product links
Elements
Description: Loop through multiple elements found on a webpage.
Features:
☐ Process matching elements one by one
☐ Use CSS selectors or XPath
☐ Handle dynamic content
Example Use Case:
Click each “Add to Cart” button matching .cart-button
☐ Loop Settings (Required)
Configure how the loop processes your data:
Max Items
Description: Set the maximum number of items to process in this loop.
Key Points:
☐ Set to 0
for no limit
☐ Prevents infinite loops
☐ Perfect for testing
Best Practice: Start with a small number (e.g., 5) when testing new automations
Start Index
Description: Choose which item to start processing from.
Key Points:
☐ 0
starts from the first item
☐ Skip already processed items
☐ Resume from specific point
Best Practice: Use with “Resume Last Workflow” for handling large datasets
☐ Advanced Options (Optional)
-
Resume Last Workflow: Continue from where previous run stopped
- Perfect for large datasets
- Handles interruptions gracefully
- Remembers progress between runs
-
Reverse Loop Order: Process items in reverse order
- Start from the end of the list
- Useful for newest-first processing
- Example: Latest social media posts
Usage Examples
1. Customer Data Processing
Process customer records in batches of 100. If interrupted, resumes from last processed record. Perfect for large customer databases.
2. Product Link Scraper
a.product-link
Finds all product links on a page and processes each one. Useful for price monitoring or product data extraction.
3. Pagination Handler
Navigate through 10 pages of results. Common for search results or product catalogs where data spans multiple pages.
Working with Loop Data
Available Variables
Each loop iteration provides these variables:
loop.current
- Current item being processedloop.index
- Current iteration number (0-based)loop.isFirst
- True if first iterationloop.isLast
- True if last iteration
Best Practices
Testing
- Start with small Max Items
- Test edge cases (empty data)
- Verify loop exit conditions
Production
- Use Resume for reliability
- Monitor loop progress
- Handle errors gracefully
Notes
- Always set Max Items when testing new loops
- Use Resume Last Workflow for processing large datasets
- Test your loop with a small sample before running on full data
- Consider using Loop Breakpoint during development