Build your first agent in just a few minutes with [Rasa Copilot](https://hello.rasa.com/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta).

## Starting Flows

Flows can be triggered by one of the following Rasa components: the LLM-based Command Generator ([SearchReadyLLMCommandGenerator](/content/docs/reference/config/components/llm-command-generators/#searchreadyllmcommandgenerator/index.html) or [CompactLLMCommandGenerator](/content/docs/reference/config/components/llm-command-generators/#compactllmcommandgenerator/index.html), or the [NLUCommandAdapter](/content/docs/reference/config/components/nlu-command-adapter/index.html).

LLM-based Command Generators use the descriptions of each of your flows, the running conversation, and other context to decide when to start a flow. It's important to write clear and distinct descriptions for each of your flows to help the LLM decide which flow to trigger, or to issue a [clarify](/content/docs/reference/config/components/llm-command-generators/#command-reference/index.html) command if the user hasn't provided enough information.

The `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](/content/docs/reference/primitives/starting-flows/#nlu-trigger/index.html) defined for your flow.

[Flow guards](/content/docs/reference/primitives/starting-flows/#flow-guards/index.html) 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

The `nlu_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:

```yaml
flows:
  my_flow:
    description: "A flow triggered with <intent-name>"
    nlu_trigger:
      - intent: <intent-name>
    steps:
      - action: my_action
```

If you only want the flow to trigger if the confidence is above a threshold, use the following syntax:

```yaml
flows:
  my_flow:
    description: "A flow triggered with <intent-name>"
    nlu_trigger:
      - intent:
          name: <intent-name>
          confidence_threshold: 0  # threshold value, optional
    steps:
      - action: my_action
```

#### Multiple Intents in NLU Trigger

You can list multiple intents for the `nlu_trigger`. If any of these intents is predicted, the flow will be started by the [NLUCommandAdapter](/content/docs/reference/config/components/nlu-command-adapter/index.html).

**caution**  
In order to actually use `nlu_trigger`, you need to add the [NLUCommandAdapter](/content/docs/reference/config/components/nlu-command-adapter/index.html) before the `LLMCommandGenerator` to your NLU pipeline in the config file.

## Preventing Flows from Starting

### Flow Guards

Flow guards are specified by adding an additional `if` 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`.

```yaml
flows:
  show_latest_bill:
    description: A flow with a flow guard.
    if: slots.authenticated AND slots.email_verified
    steps:
      - action: my_action
```

If the [condition](/content/docs/reference/primitives/conditions/index.html) after the `if` key is not met, the flow cannot be started. However, there are some exceptions to this:

1. The flow is triggered through a [link](/content/docs/reference/primitives/flow-steps/#link/index.html) step from another flow.
2. The flow is triggered through a [call](/content/docs/reference/primitives/flow-steps/#call/index.html) step from another flow.
3. The flow has defined intents with an [NLU trigger](/content/docs/reference/primitives/starting-flows/#nlu-trigger/index.html). In this case, intent trigger messages, for example`/initialize_conversation`, can "force start" a flow for a targeted intent.

If you have a flow which should _exclusively_ be started via a [link](/content/docs/reference/primitives/flow-steps/#link/index.html) or [call](/content/docs/reference/primitives/flow-steps/#call/index.html) step, you can specify that by adding `if: False`. For example:

```yaml
flows:
  feedback_form:
    description: A flow should only be linked to.
    if: False
    steps:
      - action: my_action
```

- [Starting Flows](/content/docs/reference/primitives/starting-flows/#starting-flows/index.html)
  - [NLU Trigger](/content/docs/reference/primitives/starting-flows/#nlu-trigger/index.html)
- [Preventing Flows from Starting](/content/docs/reference/primitives/starting-flows/#preventing-flows-from-starting/index.html)
  - [Flow Guards](/content/docs/reference/primitives/starting-flows/#flow-guards/index.html)
