Conditions

Add logic to control workflow paths

What are Conditions?

Conditions let you define different paths in your automation based on specific criteria. They help your AI agent make smart decisions about which actions to take and when to take them.

Condition Basics

How Conditions Work

  • Evaluate data from triggers and previous steps
  • Compare values using operators (equals, contains, etc.)
  • Return true or false based on criteria
  • Control which actions execute next

Condition Benefits

  • Create intelligent workflows
  • Reduce unnecessary actions
  • Personalize responses
  • Handle different scenarios

Condition Types

UnicornSurf supports various types of conditions to handle different scenarios:

Content Conditions

Filter based on text content, keywords, or patterns

Examples:

  • Email subject contains "urgent"
  • Message body includes "refund"
  • Form field equals "high priority"
  • Text matches specific pattern

Data Conditions

Filter based on data values and comparisons

Examples:

  • Amount greater than $1000
  • Date is within last 7 days
  • Status equals "completed"
  • Count is less than 5

Sender Conditions

Filter based on who sent the message or form

Examples:

  • From specific email address
  • From verified domain
  • Not from blocked list
  • From contact list

Time Conditions

Filter based on when the event occurred

Examples:

  • During business hours
  • Weekdays only
  • Specific time range
  • Not on holidays

Condition Examples

Here are some real-world examples of how conditions can be used:

Email Triage

Route emails based on content and sender

Subject contains "urgent" → High Priority
From domain "@company.com" → Internal
Body contains "refund" → Billing Team
Has attachment → Review Required

Lead Qualification

Qualify leads based on form data

Company size > 50 employees → Enterprise
Budget > $5000 → High Value
Industry = "Technology" → Tech Team
Timeline = "Immediate" → Urgent

Support Routing

Route support tickets to appropriate teams

Category = "Technical" → Engineering
Priority = "High" → Senior Support
Customer = "Enterprise" → VIP Team
Language = "Spanish" → Spanish Team

Best Practices

Be Specific

Use precise conditions to avoid false positives

Pro tip: Instead of "contains urgent", use "subject contains urgent AND priority equals high"

Test Thoroughly

Test conditions with various data scenarios

Pro tip: Use the test panel to verify conditions work with edge cases

Use Multiple Conditions

Combine conditions for more accurate filtering

Pro tip: Use AND/OR logic to create complex but precise conditions

Handle Edge Cases

Consider what happens when conditions fail

Pro tip: Add fallback actions for when conditions don't match

Troubleshooting

Condition not matching

  • Check condition syntax and logic
  • Verify data format and case sensitivity
  • Test with sample data
  • Review condition order and precedence

Too many matches

  • Make conditions more specific
  • Add additional filtering criteria
  • Use more precise operators
  • Review data quality and format

Condition too complex

  • Break into multiple simpler conditions
  • Use nested conditions for clarity
  • Document complex logic
  • Consider using AI-powered classification

Next Steps

Now that you understand conditions, explore these related concepts: