Flow Basics: Conditions

You can create dynamic flows in several ways. However, the easiest way is to use conditions. With conditions, you can design "if/else" statements needing to write code.

What can conditions be used for?

Conditions open up a wide range of possibilities to dynamically branch or redirect flows. With conditions, you can:

  • Show a different response if a handover takes place outside business hours
  • Send a user into an on-boarding flow if a certain piece of data is missing
  • Give a personalized reply whenever a certain tag exists

How do Conditions work?

You can drag and drop conditions below any trigger or reply action. Conditions work fairly similar to branches. Like branches, you can add multiple conditions, re-order them, or individually remove them.

Below any condition you can add any number of reply actions and follow-up triggers.

Matching

Conditions are validated in run-time. In other words, each time a Condition is matched, the system dynamically determines if the Condition is valid or not based on its rules.

The order of Conditions is important. If you create multiple branched Conditions (for example, A, B, C), the system firsts try to match A, then B, and finally C.

This also means that the first Condition that is valid "wins" and any other Condition on the same level, even if the rules match, is ignored.

Any Condition can have multiple rules. By default a Condition won’t have any, you’ll need to add them manually. A rule-less Condition is always considered valid.

If a Condition has more than 1 rule, you can choose if the Condition should match all rules or if meeting any rule is sufficient for the Condition to be valid.

Rules

There are different types of rules (Param, Channel, Tag, User, Business Hours, AB Testing) you can use.

Param

Validate params that the NLP engine extracted or were created somewhere along the way. Using this rule, you can check if a param exists, contains a certain value, or matches a custom entity type.

Channel

With these type of rules, you can match if the conversation is taking place on a certain type or specific channel.

Tag

You can add or remove Tags throughout the system. With Tag rules, you can validate if a tags exists, has existed, or contains a certain value.

User

You can use the User rule to validate user profile data like name, language, and profile picture.

Business hours

When you configure business hours, you can use this rule to determine if the business is open or closed.

AB Testing

Choose AB test to differentiate a response. Note that AB tests only work in combination with other AB test conditions. The division is random. So when you add 2 AB test conditions, either A or B has a 50% chance to get matched.