Condition Action
The Condition Action is very useful for designing dynamic workflows. Whenever you need to divide a conversation into two or more branches, this Action comes in handy — for example, sending sales inquiries directly to the sales team.

Types of Condition Actions
Section titled “Types of Condition Actions”There are two Condition Actions under Flow actions in the left toolbar. In this tutorial, we’ll focus on Condition w/ else. This Action lets you define a condition:
- If the condition is true, the green endpoint is triggered
- If the condition is false, the red endpoint is triggered

How to Use It
Section titled “How to Use It”Step 1: Add the Action
Section titled “Step 1: Add the Action”- Find Condition w/ else under Flow actions in the left toolbar
- Drag and drop it onto the canvas where you need it
- Click on it: a panel opens on the right where you can choose the Attribute you want to evaluate

Step 2: Create a Condition
Section titled “Step 2: Create a Condition”To create a condition:
- Click Add a new condition
- A pop-up will appear
- Select the Attribute (for example,
userEmail) - Define the condition by choosing one of the available options
- Enter a value if required (for some conditions, no value is needed)
- Click Apply condition
That’s it — you’ve set a new condition.

Available Condition Options
Section titled “Available Condition Options”Here’s what each option means in simple terms:

Equality Conditions
Section titled “Equality Conditions”- = equal As Numbers / = equal As Text → Check if two values are exactly the same (as numbers or text)
- ≠ not Equal As Numbers / ≠ not Equal As Text → Check if two values are different
Comparison Conditions
Section titled “Comparison Conditions”- > greater Than / ≥ greater Than Or Equal → Check if a number is larger (or larger/equal)
- < less Than / ≤ less Than Or Equal → Check if a number is smaller (or smaller/equal)
Text Conditions
Section titled “Text Conditions”- starts With / not starts With → Check if a text begins with (or does not begin with) a specific value
- starts With Ignore Case → Same as above but ignoring uppercase/lowercase differences
- ends With → Check if a text ends with a specific value
- contains / contains Ignore Case → Check if a text contains a specific value (ignoring case if selected)
State Conditions
Section titled “State Conditions”- is Empty → True if the attribute has no value
- is Null → True if the attribute is null
- is Undefined → True if the attribute is not defined at all
Advanced Conditions
Section titled “Advanced Conditions”- matches → Check if the value matches a specific pattern (for advanced use cases)
Practical Examples
Section titled “Practical Examples”Example 1: Ask for Email Before Closing Chat
Section titled “Example 1: Ask for Email Before Closing Chat”Check if userEmail is Undefined. If true, the green endpoint will trigger and you can ask for the email before ending the conversation.

Example 2: Ask a Series of Questions Before Moving On
Section titled “Example 2: Ask a Series of Questions Before Moving On”Use a ChatGPT task to collect details step by step (for example: name, needs, phone number).
In the prompt, you can write:
Your role is to ask one by one the questions below:
- name
- needs
- phone number
Once you receive all the responses, answer strictly with the word "eject".When the user has answered everything, the gpt_reply will contain “eject”. Set a condition: if gpt_reply contains “eject”, continue the Flow.
Otherwise, connect the Else branch to a Reply Action so the user keeps receiving questions until the condition is met. Keep in mind you also need a Capture User Reply action to receive the user’s response, and you need to connect it to the ChatGPT task again.
Then ChatGPT will ask the next question until it responds with “eject”.

Example 3: Immediate Handover to Human Support
Section titled “Example 3: Immediate Handover to Human Support”Use a ChatGPT task to run sentiment analysis on the conversation transcript. In the prompt, you can write:
Check if there are signs of frustration or negative sentiment in the lastUserText.
If yes, answer strictly with the word "human".When the AI Agent detects frustration, the gpt_reply will contain “human”.
Set a condition: if gpt_reply equals “human”, trigger the Transfer to human Action.

Advanced Use Cases
Section titled “Advanced Use Cases”Customer Segmentation
Section titled “Customer Segmentation”Route different customer types to appropriate experiences:
If customer_tier = "VIP" → Premium support flow
If customer_tier = "Standard" → Standard support flowTime-Based Routing
Section titled “Time-Based Routing”Handle requests differently based on time:
If current_hour >= 9 AND current_hour <= 17 → Business hours flow
Else → After-hours flowLanguage Detection
Section titled “Language Detection”Route users based on their preferred language:
If user_language = "Spanish" → Spanish support
If user_language = "French" → French support
Else → English support (default)Product-Specific Logic
Section titled “Product-Specific Logic”Handle different products with specialized flows:
If product_type = "enterprise" → Enterprise support
If product_type = "starter" → Basic supportCommon Patterns
Section titled “Common Patterns”Multi-Level Conditions
Section titled “Multi-Level Conditions”Chain conditions together for complex decision trees:
Condition 1 → If true: Condition 2 → If true: Action A
→ If false: Action B
→ If false: Action CValidation Flows
Section titled “Validation Flows”Use conditions to validate user input:
Capture Input → Validate Format → If valid: Continue
→ If invalid: Ask againProgressive Disclosure
Section titled “Progressive Disclosure”Reveal information gradually based on user responses:
Basic Info → User Interest Check → If interested: Detailed Info
→ If not: SummaryIntegration with Other Actions
Section titled “Integration with Other Actions”ChatGPT Tasks
Section titled “ChatGPT Tasks”Use AI-generated responses as condition inputs:
ChatGPT Analysis → Extract Decision → Condition Check → Route AccordinglyUser Attributes
Section titled “User Attributes”Base conditions on collected user information:
Capture User Data → Store in Attributes → Condition Check → Personalized FlowExternal Data
Section titled “External Data”Use webhook responses in conditions:
External API Call → Process Response → Condition Check → Dynamic RoutingTroubleshooting Common Issues
Section titled “Troubleshooting Common Issues”Condition Never True
Section titled “Condition Never True”- Check attribute spelling and case sensitivity
- Verify the attribute is being set correctly
- Use debugging to check actual attribute values
Unexpected Flow Behavior
Section titled “Unexpected Flow Behavior”- Review condition logic and operators
- Test with known values
- Check for undefined or null attributes
Performance Issues
Section titled “Performance Issues”- Avoid overly complex nested conditions
- Consider using switch-like logic for multiple options
- Optimize attribute retrieval
Performance Considerations
Section titled “Performance Considerations”Attribute Access
Section titled “Attribute Access”Ensure attributes are available when conditions are evaluated.
Complex Logic
Section titled “Complex Logic”Break down complex conditions into simpler, sequential checks.
Error Handling
Section titled “Error Handling”Include fallback paths for when conditions fail unexpectedly.
Security Considerations
Section titled “Security Considerations”Data Validation
Section titled “Data Validation”Validate user input before using in conditions to prevent injection attacks.
Sensitive Information
Section titled “Sensitive Information”Avoid exposing sensitive data in condition logic or error messages.
Access Control
Section titled “Access Control”Ensure conditions respect user permissions and access levels.
These are just a few examples of how the Condition Action can be used. There are many more possibilities to design smart, flexible workflows that adapt to user needs and conversation context.
The Condition Action is fundamental to creating intelligent, responsive chatbot experiences in Pingstreams, enabling your flows to make dynamic decisions based on real-time conversation data.
If you have any questions about the Condition Action or other Pingstreams features, contact our support team for assistance.