download dots
Branch Loop Filter

Branch Loop Filter

3 min read
On this page (7)

Definition: Branch, Loop, and Filter are advanced automation actions that handle real-world edge cases at scale. They transform simple automations into sophisticated business processes.

Branch Action

What It Does:
Creates different workflow paths based on conditions. Like a fork in the road.

When to Use:

  • Different customer types need different handling
  • Outcomes depend on data values
  • Multiple possible next steps

Example:

IF deal_value > $10,000
  โ†’ Assign to senior rep
  โ†’ Schedule executive call
ELSE
  โ†’ Assign to standard rep
  โ†’ Send automated follow-up

Configuration:

  • Define condition(s)
  • Set path for TRUE
  • Set path for FALSE
  • Optional: Multiple branches for multiple conditions

Loop Action

What It Does:
Repeats actions for each item in a list or until a condition is met.

When to Use:

  • Processing multiple records
  • Sending to multiple recipients
  • Iterating until success

Example:

FOR EACH lead in new_leads
  โ†’ Score lead
  โ†’ Assign to rep
  โ†’ Send welcome email
  โ†’ Add to nurture sequence

Configuration:

  • Define the list to iterate
  • Set actions for each item
  • Optional: Exit conditions
  • Optional: Error handling

Filter Action

What It Does:
Processes only items that match specific criteria. Like a sieve.

When to Use:

  • Only certain records need processing
  • Excluding specific items
  • Focusing on high-priority items

Example:

FILTER leads WHERE score > 80
  โ†’ These leads get priority handling

FILTER tasks WHERE overdue = true
  โ†’ Send reminder notifications

Configuration:

  • Define filter criteria
  • Set actions for matching items
  • Optional: Actions for non-matching items

Combining Actions

Real-World Scenario: Lead Processing

1. FILTER leads WHERE source = "website"

2. FOR EACH filtered lead:
   a. Score lead
   b. BRANCH on score:
      - High (>80): Assign to senior rep, call within 1 hour
      - Medium (50-80): Assign to standard rep, email within 24 hours
      - Low (<50): Add to nurture sequence

3. Update CRM with assignments

Error Handling

In Branches:

  • Default path for unexpected conditions
  • Error notification actions

In Loops:

  • Continue on error vs. stop on error
  • Error logging and reporting
  • Retry logic for transient failures

In Filters:

  • Handle empty results
  • Log filtered-out items if needed

Performance Considerations

Loop Optimization:

  • Batch operations when possible
  • Set reasonable limits
  • Monitor execution time

Filter Efficiency:

  • Filter early in workflows
  • Use specific criteria
  • Reduce unnecessary processing

Best Practices

Keep It Readable:
Name your branches clearly
Document complex logic
Use consistent patterns

Test Thoroughly:
Test each branch path
Test loop edge cases (0 items, 1 item, many items)
Verify filter criteria

Monitor Performance:
Track execution times
Watch for infinite loops
Monitor resource usage

Related Wiki Pages: Advanced Triggers & Actions, Agentic Workflows, Workflows