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.

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

  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.

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.

Available condition options

Here’s what each option means in simple words:

  • = 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).

Examples

1. Ask for email before closing a chat Check if userEmail is Undefined. If true, the green endpoint will trigger and you can ask for the email before ending the conversation.

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

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.

These are just a few examples of how the Condition Action can be used. There are many more possibilities to design smart, flexible workflows.

If you have any questions about the Condition Action or other Tiledesk features, contact us at [email protected].

Last updated