In this article, we’ll explore the Execution Order within flows built in Cognigy.AI. While our platform offers a wide range of customization options for creating the agent behavior you want, this flexibility can sometimes lead to complexity. Today, we'll clarify this process, focusing on a chat-based use case for simplicity. Keep in mind, though, that the execution order is the same across different endpoint channels.
What Is "Execution Order"?
The Execution Order refers to the sequence in which inputs are processed and actions are triggered in Cognigy.AI. For example, if a user types, "Hello, my name is Jonas, and I want to order a pizza", in a WebChatV3 endpoint, the input is first handled by the NLU (Natural Language Understanding). Based on the configuration of the flow, different actions or responses may occur after processing the input. Let’s walk through this in more detail.
Let’s start with the most basic setup.
Basic Flow Example: No Default Reply
Let’s say you have a simple flow called "Order Food" without any default replies. When a user types, "I want to order a pizza," the NLU detects the Order Pizza intent. The flow then continues executing according to the defined steps, without automatically sending a default reply.
Basic Flow Example: With Default Reply
In this example, we’ve configured the Order Pizza intent to have a default reply like "Thank you for your order." When the user types in their order, the NLU detects the intent, and the default reply is immediately sent in the chat.
You can configure what happens next by toggling the "Continue Flow after Default Reply" option under Settings. This allows you to either continue the flow after sending the default reply or pause and wait for further user input.
Adding Flexibility: Attached Flows & NLU Behavior
Now, let’s say we want to add a Customer Support intent to the flow, but we don’t want to configure it in every lookup node within the Order Flow. This is where Attached Flows come in handy.
We create a separate flow called "Universals", which includes a Say Node that provides the phone number for customer support. After creating a Customer Support intent within the Universals Flow, we attach it to our main flow under NLU > Attached Flows. By activating the "Continue main flow after attached flow" option, we can have the main flow resume after the attached flow finishes.
For example, if a user says, "I want to talk to customer support" the NLU detects the intent in the attached flow and executes it. Depending on your configuration, you can decide to either continue with the main flow or end the conversation after providing customer support.
You can extend this approach to more advanced use cases, like incorporating a Customer Satisfaction (CSAT) flow. Once the attached flow (e.g., CSAT) completes, the user can be seamlessly returned to the main flow. This demonstrates the flexibility of Cognigy.AI—while the initial setup may seem complex, it quickly becomes intuitive with practice.
Question Nodes and Execution Order
Lastly, let’s discuss the Question Node. Question nodes are an excellent way to guide user input. However, the settings you configure here can impact the execution order.
Some key options in the Question Node include:
- Escalation Intents (e.g., handover, no user input timeout)
- Advanced Settings like "Only accept Escalation Intents", which ensures that only specific escalation intents, like handover, are processed, ignoring others like Order Food.
If no special settings are enabled and an intent is detected, the input follows the same execution order as mentioned earlier (e.g., default replies or attached flows). Afterward, the question node validates the user input. If the input passes validation, the flow continues; if not, a reprompt or wrong answer action is triggered.
For more detailed configuration options, refer to our documentation: Question Node Reference.
Comments
0 comments