Universal Item Iteration: Real-World Use Cases
12+ practical scenarios showing configuration and expected behavior.
1. E-Commerce: Order Confirmation Emails
Scenario: Send personalized order confirmation emails to 500 customers daily at scheduled time.
Configuration
Sample Data
| order_id | customer.email | total |
|---|---|---|
| ORD-2026-001 | alice@example.com | $149.99 |
| ORD-2026-002 | bob@example.com | $299.50 |
| ORD-2026-003 | charlie@example.com | $75.00 |
Expected Timeline
500 orders, sequential processing @ 1 second each = ~8 minutes total
- breakOnFirstError: false → Continue even if one email fails
- retryFailedItems: 1 → One retry for transient SMTP issues
- No batching → Sequential emails maintain order
2. HR: Bulk Employee Record Update
Scenario: Update 1,000 inactive employee records in bulk, marking last review date.
Configuration
Execution Breakdown
After filter: 250 inactive employees
Batch size: 100
Batches: 3 batches
Batch 2: Items 101-200 (5s)
Batch 3: Items 201-250 (2s)
Total: ~12 seconds
- filterExpression → Only process inactive employees (1000 → 250)
- batchSize: 100 → Database efficiency
- parallelExecution: false → Sequential batches respect DB connections
- aggregateResults: true → Single array output for report
3. Finance: Parallel Credit Card Validation
Scenario: Validate 500 credit cards in parallel before charging for subscription renewals.
Configuration
Performance Gain
500 cards × 1s = 500 seconds (8+ minutes)
500 ÷ 50 = 10 batches × 1s = 10 seconds
Expected Results
Out of 500: ~485 valid (97%), ~15 invalid (3%). Retries recover ~2 more. Final: 487 valid.
- Payment API allows ~100 concurrent → batchSize: 50 is safe
- timeoutPerIteration: 5000 → 5-second limit per validation
- retryFailedItems: 2 → Recover from transient network issues
4. CRM: Data Enrichment from External API
Scenario: Fetch company info from external service for 10,000 leads, rate-limited to 100 req/sec.
Configuration
Rate Limit Handling
| Batch | Items | Concurrency | Time | Rate |
|---|---|---|---|---|
| 1 | 1-10 | 10 parallel | 1s | 10 req/s |
| wait 100ms | ||||
| 2 | 11-20 | 10 parallel | 1s | 10 req/s |
| wait 100ms | ||||
| ... | ... | ... | ... | Effective: 100 req/s ✓ |
Expected Results
10,000 leads: 1,000 processed (maxAllowedCount), ~950 have domain data, ~950 enriched = 95% success
- batchSize: 10, parallel: true → 10 concurrent requests
- batchWaitTimeMs: 100 → 100ms wait between batches = 100 req/sec sustained
- maxAllowedCount: 1000 → Safety limit (API costs money)
- filterExpression → Skip leads without company domain
5. Reporting: Process Transaction Logs
Scenario: Transform and aggregate 100,000 transaction logs for daily report.
Configuration
Processing Steps
Filter: Only completed (95,000)
Sort: By amount descending
Process: 1,000 per batch
Time: ~95 seconds
Output: Single array
Use: Dashboard, reports
- Filter + Sort pre-processing → Reduce dataset before iteration
- Large batchSize: 1000 → Process many at once (memory efficient)
- Reverse order: true → Highest amounts processed first
- aggregateResults: true → Single report-ready array
6. Marketing: Segment Customers and Send Campaigns
Scenario: Filter by engagement score, segment into tiers, send targeted campaign emails.
Configuration
Data Filtering Example
| Segment | Score Range | Count | Message |
|---|---|---|---|
| VIP | 80-100 | 500 | VIP Exclusive Offer |
| Gold | 60-79 | 2,500 | Gold Member Deal |
| Silver | 50-59 | 1,000 | Member Exclusive |
| Bronze | <50 | 6,000 | Not sent (filtered out) |
Expected Timeline
4,000 emails (500 + 2,500 + 1,000), 100 parallel batches × 1s = ~40 seconds
- filterExpression → 4,000 of 10,000 customers (40%) qualify
- sortByExpression → Process highest engagement first
- reverseOrder → VIP customers processed first
- parallelExecution → Speed up email sending
7. Support: Process Support Tickets in Priority Order
Scenario: Process 500 support tickets, highest priority first, assign to agents.
Configuration
Processing Order Example
Input order: [P2, P5, P1, P3, P4, P1, P2]
After sort (descending): [P5, P4, P3, P2, P2, P1, P1]
Processing: Highest priority (P5) → ... → Lowest priority (P1)
- Critical issues (P5) resolved first → Improves customer satisfaction
- Fair assignment → High-priority get top agents
- SLA compliance → Urgent tickets don't wait in queue
8. Data Migration: Move Data Between Systems
Scenario: Migrate 50,000 customer records from old CRM to new system with batching.
Configuration
Migration Timeline
50,000 records, 500 per batch = 100 batches, 5 seconds per batch + 500ms wait = ~550 seconds (~9 minutes)
Safety Measures
- Batch size: 500
- Sequential (no parallel)
- Retries: 3
- breakOnFirstError: true
- batchWaitTimeMs: 500
- maxAllowedCount: 50000
- Conservative batching → Database connection management
- Fail fast → Stop if data corruption detected
- Retries → Handle transient network/database issues
- Waits → Let target system keep up
9. Analytics: Event Processing with Aggregation
Scenario: Process 100,000 user events, aggregate by event type for dashboard.
Configuration
Event Distribution Example
| Event Type | Count | Percentage |
|---|---|---|
| page_view | 60,000 | 60% |
| click | 25,000 | 25% |
| form_submit | 10,000 | 10% |
| scroll | 5,000 | 5% |
Output
Aggregated array: 100,000 processed events ready for dashboard ingestion
- Event processing is CPU-bound → Can parallelize within limits
- batchSize: 5000 → Large batches for efficiency
- aggregateResults: true → Single output for downstream processing
10. Image Processing: Resize Images in Parallel
Scenario: Resize 1,000 images in parallel using 8 concurrent workers.
Configuration
Performance Comparison
| Strategy | Workers | Time per Image | Total Time |
|---|---|---|---|
| Sequential | 1 | 1 second | 1,000 seconds (16+ min) |
| Parallel (8) | 8 | 1 second | ~125 seconds (2 min) |
| Speedup | 8× faster | ||
- batchSize: 8 → Matches typical CPU core count (8-core system)
- parallelExecution: true → Use all cores
- timeoutPerIteration: 10000 → Prevent stuck resizes
11. Payment Processing: Charge Customers with Error Handling
Scenario: Charge 100 customers monthly; retry failures, report results.
Configuration
Expected Results
| Status | Initial Attempt | After Retries | Final |
|---|---|---|---|
| Success | 94 (94%) | +4 from retry | 98 (98%) |
| Failed | 6 (6%) | -4 recovered | 2 (2%) |
| Success Rate: 98% | |||
Retry Outcomes
- Insufficient funds: 2
- Card expired: 1
- Network timeout: 3
- Network timeout → Success: 3
- Insufficient funds → Still fail: 2
- Card expired → Still fail: 1
- breakOnFirstError: false → Process all customers even if some fail
- retryFailedItems: 3 → Recover from transient network issues (not permanent failures)
- timeoutPerIteration: 30000 → 30-second limit for payment processing
- aggregateResults: true → Single report of all results
12. Webhook Delivery: Send Webhooks to External Services
Scenario: Deliver webhooks to 10,000 external services with rate limiting.
Configuration
Delivery Timeline
10,000 webhooks, 5 concurrent, 2-second wait between batches:
10,000 ÷ 5 = 2,000 batches × 2 seconds = ~4,000 seconds (~67 minutes)
Reliability
| Attempt | Success Rate | Cumulative Success |
|---|---|---|
| Initial (1st attempt) | 95% | 95% |
| Retry 1 | 2% | 97% |
| Retry 2 | 1% | 98% |
| Retry 3-5 | 1% | 99% |
| Final Success Rate: 99% | ||
- batchSize: 5, parallel: true → Moderate concurrency
- batchWaitTimeMs: 2000 → Backoff to handle slow subscribers
- retryFailedItems: 5 → Aggressive retry for delivery reliability
- timeoutPerIteration: 10000 → 10-second per-webhook limit