NLUCommandAdapter uses a predicted intent to start a flow.
In order to trigger a flow via the NLUCommandAdapter you need to have an NLU trigger
defined for your flow.
Flow guards are conditions that have to be met before a flow can be started.
Adding flow guards provides additional control over when flows are triggered.
NLU Trigger
Thenlu_trigger field is optional.
If present, it contains a list of intents that can start the flow.
If you don’t want to use a confidence threshold, list the intent names:
flows.yml
flows.yml
Multiple Intents in NLU Trigger
You can list multiple intents for thenlu_trigger.
If any of these intents is predicted, the flow will be started by the
NLUCommandAdapter.
Preventing Flows from Starting
Flow Guards
Flow guards are specified by adding an additionalif field to the flow definition.
For example, the following flow for showing the user’s latest bill can only be triggered
if the slots authenticated and email_verified are both true.
flows.yml
if key is not met, the flow cannot be started. However, there
are some exceptions to this:
- The flow is triggered through a link step from another flow.
- The flow is triggered through a call step from another flow.
- The flow has defined intents with an NLU trigger. In this case, intent trigger messages,
for example
/initialize_conversation, can “force start” a flow for a targeted intent.
if: False.
For example:
flows.yml