Skip to content
FacebookYouTubeX (Twitter)

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.

Condition Action Overview

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

Condition Endpoints

  1. Find Condition w/ else under Flow actions in the left toolbar
  2. Drag and drop it onto the canvas where you need it
  3. Click on it: a panel opens on the right where you can choose the Attribute you want to evaluate

Condition Configuration

To create a condition:

  1. Click Add a new condition
  2. A pop-up will appear
  3. Select the Attribute (for example, userEmail)
  4. Define the condition by choosing one of the available options
  5. Enter a value if required (for some conditions, no value is needed)
  6. Click Apply condition

That’s it — you’ve set a new condition.

Condition Setup

Here’s what each option means in simple terms:

Condition Options

  • = 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
  • > 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)
  • 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)
  • 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
  • matches → Check if the value matches a specific pattern (for advanced use cases)

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.

Email Check Example

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”.

Question Series Example

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.

Sentiment Analysis Example

Route different customer types to appropriate experiences:

If customer_tier = "VIP" → Premium support flow
If customer_tier = "Standard" → Standard support flow

Handle requests differently based on time:

If current_hour >= 9 AND current_hour <= 17 → Business hours flow
Else → After-hours flow

Route users based on their preferred language:

If user_language = "Spanish" → Spanish support
If user_language = "French" → French support  
Else → English support (default)

Handle different products with specialized flows:

If product_type = "enterprise" → Enterprise support
If product_type = "starter" → Basic support

Chain conditions together for complex decision trees:

Condition 1 → If true: Condition 2 → If true: Action A
                                   → If false: Action B
            → If false: Action C

Use conditions to validate user input:

Capture Input → Validate Format → If valid: Continue
                                → If invalid: Ask again

Reveal information gradually based on user responses:

Basic Info → User Interest Check → If interested: Detailed Info
                                 → If not: Summary

Use AI-generated responses as condition inputs:

ChatGPT Analysis → Extract Decision → Condition Check → Route Accordingly

Base conditions on collected user information:

Capture User Data → Store in Attributes → Condition Check → Personalized Flow

Use webhook responses in conditions:

External API Call → Process Response → Condition Check → Dynamic Routing
  • Check attribute spelling and case sensitivity
  • Verify the attribute is being set correctly
  • Use debugging to check actual attribute values
  • Review condition logic and operators
  • Test with known values
  • Check for undefined or null attributes
  • Avoid overly complex nested conditions
  • Consider using switch-like logic for multiple options
  • Optimize attribute retrieval

Ensure attributes are available when conditions are evaluated.

Break down complex conditions into simpler, sequential checks.

Include fallback paths for when conditions fail unexpectedly.

Validate user input before using in conditions to prevent injection attacks.

Avoid exposing sensitive data in condition logic or error messages.

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.