Condition to Tool Configuration
Condition to Tool connections in Workforce allow you to create intelligent workflows that execute tools only when specific conditions are met.
How Condition to Tool Works
A Condition to Tool connection acts as an IF statement in your workforce flow. When a condition evaluates to true, the connected tool executes; when false, the tool is skipped. This creates branching logic in your workflows, making your AI workforce more adaptable and responsive to different scenarios.
Setting Up a Condition to Tool Connection
To create a Condition to Tool connection in your workforce:
- Navigate to Workforce and “Build” in the main navigation
- Add a condition node to your workspace by dragging it from the node palette
- Configure your condition (see below for LLM-based vs Rule-based options)
- Add a tool node to your workspace
- Connect the condition node to the tool node by clicking and dragging from the condition’s output connector to the tool’s input connector
Choosing Between LLM-based and Rule-based Conditions
Workforce offers two types of conditions, each suited for different scenarios:
LLM-based Conditions
Use natural language to describe complex logic. The AI interprets your description and evaluates whether the condition is met.
Best for:
- Complex logic that’s easier to express in natural language
- Evaluating unstructured data like text content
- Time-based conditions
- Scenarios requiring interpretation
Example: “Go down this path if the email contains an urgent request”
Rule-based Conditions
Use structured filters to compare specific values with deterministic logic.
Best for:
- Precise comparisons of tool outputs
- Numeric threshold checks
- Validating specific field values
- Performance-critical paths
Example: Check if Validate Data / output / status equals “SUCCESS”
LLM-based Condition Examples
You can create various types of conditions using simple, natural language instructions:
Time-Based Conditions
- “Go down this path if today is Monday or Tuesday”
- “Follow this route if the current time is between 9 AM and 5 PM”
- “Use this tool if it’s a weekday”
Data-Based Conditions
- “Go down this path if the customer priority is high”
- “Follow this route if the email contains the word ‘urgent’”
- “Use this tool if the sentiment score is greater than 0.7”
Tool Output Conditions
- “Go down this path if the previous tool completed successfully”
- “Follow this route if the data validation passed”
- “Use this tool if we received a response from the API”
Rule-based Condition Examples
Rule-based conditions use structured filters for precise, deterministic comparisons:
Validating Tool Output Status
Scenario: Only proceed if a validation tool succeeded
Configuration:
- Condition type: Rule-based
- Filter:
- Target:
Validate Input / output / status - Operator: equals
- Source: “SUCCESS”
- Target:
This ensures the next tool only runs when validation explicitly returns “SUCCESS”.
Numeric Threshold Checks
Scenario: Route high-value transactions to a special processing tool
Configuration:
- Condition type: Rule-based
- Filter:
- Target:
Calculate Amount / output / total - Operator: >
- Source: 10000
- Target:
The tool only executes when the transaction amount exceeds $10,000.
Multiple Criteria (AND Logic)
Scenario: Process orders that are both complete and paid
Configuration:
- Condition type: Rule-based
- Match mode: Match All
- Filter 1:
- Target:
Check Status / output / order_status - Operator: equals
- Source: “complete”
- Target:
- Filter 2:
- Target:
Check Payment / output / payment_status - Operator: equals
- Source: “paid”
- Target:
Both conditions must be true for the tool to execute.
Multiple Criteria (OR Logic)
Scenario: Flag items that need attention (either urgent or high-value)
Configuration:
- Condition type: Rule-based
- Match mode: Match Any
- Filter 1:
- Target:
Get Priority / output / priority - Operator: equals
- Source: “urgent”
- Target:
- Filter 2:
- Target:
Calculate Value / output / amount - Operator: >=
- Source: 5000
- Target:
The tool executes if either condition is true.
Field Existence Check
Scenario: Only process records that have an optional field populated
Configuration:
- Condition type: Rule-based
- Filter:
- Target:
Get Data / output / optional_field - Operator: exists
- Target:
This checks whether the field has any value before proceeding.
String Pattern Matching
Scenario: Route customer IDs with a specific prefix to a specialized tool
Configuration:
- Condition type: Rule-based
- Filter:
- Target:
Get Customer / output / customer_id - Operator: starts with
- Source: “PREMIUM-”
- Target:
Only customers with IDs starting with “PREMIUM-” trigger this tool.
When to Use Each Condition Type
Use LLM-based Conditions When:
- You need to evaluate natural language or unstructured text
- The logic is complex and easier to express in plain English
- You’re working with time-based or contextual conditions
- Exact matching isn’t critical
- You want the AI to interpret intent
Example use case: Routing customer emails based on content sentiment or urgency
Use Rule-based Conditions When:
- You need precise, deterministic comparisons
- You’re validating tool outputs against known values
- You’re working with numeric thresholds
- Performance and reliability are critical
- You want to avoid AI interpretation overhead
- You need to check specific field values or existence
Example use case: Validating API responses, checking status codes, or enforcing business rules with specific thresholds
Best Practices for Condition to Tool Connections
- Choose the right condition type: Use LLM-based for complex interpretation, rule-based for precise comparisons
- Keep conditions focused: Each condition should evaluate a single concept for clarity
- Be specific: Provide clear criteria for when the condition should be true
- Test thoroughly: Verify your conditions work as expected with different inputs
- Consider edge cases: Think about unusual scenarios that might affect your condition
- Structure tool outputs appropriately: For rule-based conditions, ensure tools output flat values rather than nested objects
Advanced Condition to Tool Patterns
Chaining Multiple Conditions
You can create sophisticated decision trees by chaining multiple conditions together:
- Create several condition nodes that evaluate different aspects of your data
- Connect each condition to the appropriate tool
- Tools will only execute when their specific conditions are met
Parallel Condition Evaluation
For more complex scenarios, you can have multiple conditions evaluating the same data simultaneously:
- Create several condition nodes that check different aspects of the same data
- Connect each condition to different tools
- Multiple tools may execute in parallel depending on which conditions are met
Combining Condition Types
You can use both LLM-based and rule-based conditions in the same workflow:
- Use rule-based conditions for precise validation checks
- Use LLM-based conditions for complex interpretation
- Connect them to different tools based on your workflow needs
Practical Use Cases
Email Routing Based on Content
LLM-based approach: “Go down this path if the email contains a support request” or “Follow this route if the message mentions billing issues.”
Rule-based approach: Check if Classify Email / output / category equals “support” or “billing”
Time-Sensitive Workflows
LLM-based approach: “Use this tool only during business hours” or “Go down this path if it’s the first day of the month.”
Rule-based approach: Check if Get Current Hour / output / hour is >= 9 and <= 17
Data Quality Control
LLM-based approach: “Follow this route if all required fields are filled” or “Use this tool if the data passes validation.”
Rule-based approach: Check if Validate Data / output / status equals “valid” and Check Required Fields / output / all_present equals true
Approval Workflows
LLM-based approach: “Go down this path if the request has been approved” or “Use this tool if the manager has given permission.”
Rule-based approach: Check if Check Approval / output / approved equals true
Troubleshooting Condition to Tool Connections
If your condition to tool connections aren’t working as expected:
For LLM-based Conditions:
- Review your condition language: Make sure your natural language condition is clear and specific
- Test with simpler conditions: Try a very basic condition to verify the connection works
- Refine your language: If needed, make your condition more explicit or detailed
For Rule-based Conditions:
- Check the target path: Verify it points to the correct field from the upstream node
- Verify the operator: Ensure you’re using the right comparison type (e.g., numeric operators for numbers)
- Check the source value: Make sure it matches the expected data type and format
- Review match mode: Confirm whether you need “Match All” (AND) or “Match Any” (OR) logic
- Test with simple filters: Start with a single filter to isolate issues
General Troubleshooting:
- Check the flow: Confirm the connections between nodes are correctly established
- Monitor execution: Watch how the workflow behaves when the condition is evaluated
- Review upstream outputs: Verify that the data you’re evaluating actually exists and has the expected format
Related Features
- Add Conditions: Complete guide to configuring both LLM-based and rule-based conditions
- Agent to Tool connections: Direct connections from agents to tools without conditional logic
- Tool to Tool connections: Sequential execution of tools in a workflow
- Edge Settings: Configure how nodes connect in your workforce
By using Condition to Tool connections with both LLM-based and rule-based conditions in the Workforce Builder, you can create intelligent, adaptive workflows that respond dynamically to changing circumstances, making your AI workforce more efficient and effective.
Tool to Tool Configuration
Tool to Tool configuration is a powerful feature in Workforce that allows you to connect tools directly to other tools, creating automated workflows without requiring agent intervention.
Communication
Communication is a fundamental aspect of Workforce that defines how agents interact with each other within your AI workforce.

