Portal
← Back to Overview

1. E-Commerce: Order Confirmation Emails

Scenario: Send personalized order confirmation emails to 500 customers daily at scheduled time.

Configuration

{ "itemsIterationEnabled": true, "itemsIterationPropertyName": "orders", "recipients": "@{input:item|customer|email}", "subject": "Order Confirmation: @{input:item|order_id}", "body": "Your order total: $@{input:item|total}", "breakOnFirstError": false, "retryFailedItems": 1 }

Sample Data

order_idcustomer.emailtotal
ORD-2026-001alice@example.com$149.99
ORD-2026-002bob@example.com$299.50
ORD-2026-003charlie@example.com$75.00

Expected Timeline

500 orders, sequential processing @ 1 second each = ~8 minutes total

Key Properties:
  • 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

{ "itemsIterationEnabled": true, "itemsIterationPropertyName": "employees", "filterExpression": "@{input:item|status}=='inactive'", "batchSize": 100, "parallelExecution": false, "breakOnFirstError": false, "aggregateResults": true }

Execution Breakdown

Input: 1,000 employees total
After filter: 250 inactive employees
Batch size: 100
Batches: 3 batches
Batch 1: Items 1-100 (5s)
Batch 2: Items 101-200 (5s)
Batch 3: Items 201-250 (2s)
Total: ~12 seconds
Design Pattern:
  • 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

{ "itemsIterationEnabled": true, "itemsIterationPropertyName": "card_tokens", "url": "https://payments.example.com/validate", "method": "POST", "body": "{ \"token\": \"@{input:item|token}\" }", "batchSize": 50, "parallelExecution": true, "timeoutPerIteration": 5000, "retryFailedItems": 2 }

Performance Gain

Sequential:
500 cards × 1s = 500 seconds (8+ minutes)
Parallel (50 concurrent):
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.

Rate Limiting:
  • 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

{ "itemsIterationEnabled": true, "itemsIterationPropertyName": "leads", "url": "https://api.clearbit.com/v1/companies/find?domain=@{input:item|company_domain}", "batchSize": 10, "parallelExecution": true, "batchWaitTimeMs": 100, "maxAllowedCount": 1000, "filterExpression": "@{input:item|company_domain} != null" }

Rate Limit Handling

BatchItemsConcurrencyTimeRate
11-1010 parallel1s10 req/s
wait 100ms
211-2010 parallel1s10 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

Key Strategy:
  • 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

{ "itemsIterationEnabled": true, "itemsIterationPropertyName": "transactions", "filterExpression": "@{input:item|status}=='completed'", "sortByExpression": "@{input:item|amount}", "reverseOrder": true, "batchSize": 1000, "aggregateResults": true }

Processing Steps

Input: 100,000 transactions
Filter: Only completed (95,000)
Sort: By amount descending
Process: 1,000 per batch
Batches: 95
Time: ~95 seconds
Output: Single array
Use: Dashboard, reports
Optimization:
  • 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

{ "itemsIterationEnabled": true, "itemsIterationPropertyName": "customers", "filterExpression": "@{input:item|engagement_score} >= 50", "sortByExpression": "@{input:item|engagement_score}", "reverseOrder": true, "recipients": "@{input:item|email}", "subject": "@{input:item|engagement_score} > 80 ? 'VIP Offer' : 'Exclusive Deal'", "batchSize": 100, "parallelExecution": true }

Data Filtering Example

SegmentScore RangeCountMessage
VIP80-100500VIP Exclusive Offer
Gold60-792,500Gold Member Deal
Silver50-591,000Member Exclusive
Bronze<506,000Not sent (filtered out)

Expected Timeline

4,000 emails (500 + 2,500 + 1,000), 100 parallel batches × 1s = ~40 seconds

Segmentation Strategy:
  • 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

{ "itemsIterationEnabled": true, "itemsIterationPropertyName": "tickets", "sortByExpression": "@{input:item|priority}", "reverseOrder": true, "body": "Assign ticket @{input:item|id} (priority @{input:item|priority}) to next available agent" }

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)

Why Sort Tickets?
  • 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

{ "itemsIterationEnabled": true, "itemsIterationPropertyName": "old_crm_records", "batchSize": 500, "parallelExecution": false, "batchWaitTimeMs": 500, "breakOnFirstError": true, "retryFailedItems": 3, "maxAllowedCount": 50000 }

Migration Timeline

50,000 records, 500 per batch = 100 batches, 5 seconds per batch + 500ms wait = ~550 seconds (~9 minutes)

Safety Measures

Reliability:
  • Batch size: 500
  • Sequential (no parallel)
  • Retries: 3
Control:
  • breakOnFirstError: true
  • batchWaitTimeMs: 500
  • maxAllowedCount: 50000
Migration Strategy:
  • 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

{ "itemsIterationEnabled": true, "itemsIterationPropertyName": "events", "batchSize": 5000, "parallelExecution": true, "aggregateResults": true, "returnLastResultOnly": false }

Event Distribution Example

Event TypeCountPercentage
page_view60,00060%
click25,00025%
form_submit10,00010%
scroll5,0005%

Output

Aggregated array: 100,000 processed events ready for dashboard ingestion

Why Parallelization?
  • 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

{ "itemsIterationEnabled": true, "itemsIterationPropertyName": "images", "batchSize": 8, "parallelExecution": true, "timeoutPerIteration": 10000 }

Performance Comparison

StrategyWorkersTime per ImageTotal Time
Sequential11 second1,000 seconds (16+ min)
Parallel (8)81 second~125 seconds (2 min)
Speedup8× faster
CPU-Bound Optimization:
  • 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

{ "itemsIterationEnabled": true, "itemsIterationPropertyName": "customers", "url": "https://payments.example.com/charge", "method": "POST", "breakOnFirstError": false, "retryFailedItems": 3, "timeoutPerIteration": 30000, "aggregateResults": true }

Expected Results

StatusInitial AttemptAfter RetriesFinal
Success94 (94%)+4 from retry98 (98%)
Failed6 (6%)-4 recovered2 (2%)
Success Rate: 98%

Retry Outcomes

Failures (6 total):
  • Insufficient funds: 2
  • Card expired: 1
  • Network timeout: 3
After Retries (3 each):
  • Network timeout → Success: 3
  • Insufficient funds → Still fail: 2
  • Card expired → Still fail: 1
Payment Strategy:
  • 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

{ "itemsIterationEnabled": true, "itemsIterationPropertyName": "webhook_subscriptions", "url": "@{input:item|webhook_url}", "method": "POST", "body": "{ \"event\": \"order.created\", \"orderId\": \"@{input:item|order_id}\" }", "batchSize": 5, "parallelExecution": true, "batchWaitTimeMs": 2000, "retryFailedItems": 5, "timeoutPerIteration": 10000 }

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

AttemptSuccess RateCumulative Success
Initial (1st attempt)95%95%
Retry 12%97%
Retry 21%98%
Retry 3-51%99%
Final Success Rate: 99%
Webhook Delivery Strategy:
  • 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
← Back to Overview | Best Practices →