What are Conditional Actions?
Conditional Actions is a specialized evaluator type that allows you to create dynamic, rule-based test scenarios. Unlike traditional evaluators that follow a linear script, Conditional Actions evaluators can adapt their behavior based on what the agent says during the conversation. This makes them ideal for testing complex workflows where the conversation can take multiple paths depending on the agent’s responses.When to Use Conditional Actions
Use Conditional Actions evaluators when you need to:- Test branching conversations: Handle different conversation paths based on agent responses
- Simulate decision trees: Test scenarios where user responses depend on what the agent asks
- Create adaptive evaluators: Build evaluators that can handle unexpected agent responses
- Test IVR (Interactive Voice Response) flows: Simulate interactive voice response systems with menu options
- Validate error handling: Test how agents handle various user inputs and edge cases
Example Use Case
Testing an appointment booking agent where the flow changes based on whether the agent offers available slots, asks for rescheduling, or cancels the appointment entirely.
Structure
A Conditional Actions evaluator consists of two main components:1. Role
Therole defines who the testing agent is pretending to be.
Keep the role concise and clear. It sets the context for the entire conversation.
2. Conditions
Theconditions array defines the rules and actions for the evaluator. Each condition specifies:
- When a certain situation occurs (the condition)
- What the testing agent should do (the action)
Condition Fields
Each condition object has the following fields:Unique identifier for the condition. Start with 0 for the first message.
The trigger condition that determines when this action should be taken.Special cases:
- When
idis 0, the condition can be empty (represents the first message) - When
typeisaction_followup, the condition should be an integer referencing the previous condition ID - For standard conditions, the condition is a string describing the trigger
What the testing agent should say or do when the condition is met. The interpretation depends on the
fixed_message field:- When
fixed_messageisfalse: Contains instructions for the testing agent to interpret - When
fixed_messageistrue: Contains the exact message to send word-for-word
The condition type. Options:
standard: Normal condition (default)action_followup: Action to take immediately after a previous action
When set to
true, the action field contains the exact message to send instead of instructions. Use this when you need precise, word-for-word control over what the testing agent says.Note: For id: 0 (first message), fixed_message is always true.First Message (id: 0)
The condition withid: 0 is special—it represents the first message the testing agent sends to start the conversation. Unlike other conditions, the first message always has fixed_message: true, meaning the action field contains the exact message to send.
Condition Types
Standard Conditions
Standard conditions are evaluated based on the conversation context. They trigger when the specified condition is met.Action Followup Conditions
Action followup conditions execute after a previous action has been taken, regardless of what the main agent responds. This is useful for multi-part responses or clarifications. Thecondition field should reference the previous condition ID as an integer.
Action followup conditions execute after the referenced action is taken, irrespective of the agent’s response. The
condition field should contain the ID (as an integer) of the previous condition.Action vs Fixed Message
Theaction field can be used in two ways, controlled by the fixed_message boolean:
Using action with fixed_message: false (Default)
When fixed_message is false (or omitted), the action field provides instructions that the testing agent interprets to generate a natural response.
Using action with fixed_message: true
When fixed_message is true, the action field contains the exact text that the testing agent will say, word-for-word. Use this when you need precise control.
When to Use Each
Use fixed_message: false
- Natural, varied responses
- Testing agent adaptability
- When exact wording doesn’t matter
Use fixed_message: true
- Exact phrases required
- Testing specific keywords
- Compliance testing
- Reproducible test cases
- First message (id: 0) - always uses this
The
action field is always required. The fixed_message boolean determines how to interpret it: as instructions (false) or as the exact message (true).Supported Tags
Conditional Actions supports a variety of special tags in theaction field to control conversation flow and behavior.
Communication Tags
<ivr> - Interactive Voice Response
<ivr> - Interactive Voice Response
Mark a message as an IVR (Interactive Voice Response) message that cannot be interrupted.The agent cannot interrupt while this message plays.
<voicemail> - Voicemail Greeting
<voicemail> - Voicemail Greeting
Play a voicemail greeting with beep.Or just a beep without greeting:
<endcall> - End Call
<endcall> - End Call
End the call immediately.
Speech Control Tags
<silence> - Add Pauses
<silence> - Add Pauses
Add silence/pauses in speech.Supports providers: ElevenLabs turbo models, Cartesia
<hold> - Hold Between Messages
<hold> - Hold Between Messages
Wait before sending the next message.Can have multiple hold tags in one action:
<spell> - Spell Out Text
<spell> - Spell Out Text
Spell out text letter by letter (e.g., API → A—P—I).
- For Cartesia: keeps tags as-is (native support)
- For ElevenLabs: converts to em-dash separated letters
<speed> - Control Speech Speed
<speed> - Control Speech Speed
Control the speed of speech (ratio: multiplier of base speed).
1.0= normal speed1.5= 50% faster0.8= 20% slower
<volume> - Control Volume
<volume> - Control Volume
Control the volume/loudness (ratio: multiplier of base volume).Supported on Cartesia. Must be at the start of the message.
Interaction Tags
<dtmf> - Send DTMF Tones
<dtmf> - Send DTMF Tones
Send DTMF (touch-tone) digits.Simulates pressing phone keypad buttons.
<send_sms> - Send SMS
<send_sms> - Send SMS
Trigger an SMS to be sent.
<interruption> - Interrupt After Timeout
<interruption> - Interrupt After Timeout
Interrupt the main agent after a specified time and deliver the message.The testing agent will interrupt the main agent after 3 seconds and speak this message.
Environmental Tags
<background_noise> - Background Sounds
<background_noise> - Background Sounds
Add background sounds during specific portions of speech.Available sounds:
office, cough, etc.
Volume is optional (default applies if not specified).<noise> - Play Sound Effects
<noise> - Play Sound Effects
Play a sound effect once without speech.Attributes:
sound: Sound name (required)volume: Volume level (optional)time: Duration in ms (optional)
<network_simulation> - Simulate Network Issues
<network_simulation> - Simulate Network Issues
Simulate network conditions like packet loss, jitter, or latency.Attributes (all optional):
packet_loss: Percentage (e.g., “5” = 5%)jitter: Milliseconds (e.g., “50”)latency: Milliseconds (e.g., “100”)
Complete Examples
Example 1: Appointment Cancellation
Example 2: IVR (Interactive Voice Response) Navigation
Example 3: Multi-Part Response with Followup
Example 4: Using Advanced Tags
Best Practices
Clear Conditions
Write conditions that clearly describe when they should trigger.
- ✅ “The agent asks for your email”
- ❌ “Email”
Specific Actions
Make actions specific and actionable.
- ✅ “Provide your email address”
- ❌ “Answer the question”
Logical Flow
Order conditions in a logical conversation flow.Start with
id: 0, then follow natural conversation progression.Common Patterns
Pattern 1: Conditional Branching
Handle different paths based on agent response:Pattern 2: Information Gathering
Progressively provide information as requested:Pattern 3: Multi-Step Action
Useaction_followup for complex multi-part responses:
Tips
Troubleshooting
Condition Not Triggering
Condition Not Triggering
Issue: A condition isn’t triggering when expected.Solutions:
- Make the condition more specific
- Check if a previous condition is matching instead
- Verify the condition describes what the agent says, not what the evaluator should do
Tags Not Working
Tags Not Working
First Message Not Sending
First Message Not Sending
Issue: The conversation doesn’t start.Solutions:
- Ensure you have a condition with
id: 0 - Verify the action field is not empty
- Check that the role is defined