# Intent from UserUttered event is not triggering the corresponding rule

**URL:** <https://forum.rasa.com/t/intent-from-useruttered-event-is-not-triggering-the-corresponding-rule/39503>\
**Category:** Rasa Open Source\
**Created:** [January 27, 2021, 4:11am UTC](https://forum.rasa.com/t/intent-from-useruttered-event-is-not-triggering-the-corresponding-rule/39503 "2021-01-27T04:11:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![srinivasn5](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@srinivasn5](https://forum.rasa.com/u/srinivasn5)\
**Post date:** [January 27, 2021, 4:11am UTC](https://forum.rasa.com/t/intent-from-useruttered-event-is-not-triggering-the-corresponding-rule/39503/1 "2021-01-27T04:11:19Z")

</div>

I’m trying to invoke a rule from “action\_nlu\_fallback” through UserUttered(“some\_text”,{“intent”: {“name”: “xyz”, “confidence”: 1.0}}) as return event. I am able to see in the logs, that the nlu core is able to extract the intent as expected (i.e intent: ‘xyz’). But the issue here is that, instead of invoking corresponding rule related to the parsed intent, rasa core is always predicting next action is “‘action\_listen’”. so what changes do i need to do, so that it will trigger corresponding rule/story for the parsed intent ?

## Logs:

[state 5] user intent: nlu\_fallback | previous action name: action\_listen

[state 6] user intent: ask\_if\_bot | previous action name: action\_handle\_nlu\_fallback

2021-01-27 08:28:08 DEBUG rasa.core.policies.rule\_policy - There is no applicable rule.

2021-01-27 08:28:08 DEBUG rasa.core.policies.ensemble - Predicted next action using policy\_1\_TEDPolicy.

2021-01-27 08:28:08 DEBUG rasa.core.processor - Predicted next action ‘action\_listen’ with confidence 0.95.

2021-01-27 08:28:08 DEBUG rasa.core.processor - Policy prediction ended with events ‘[]’.

2021-01-27 08:28:08 DEBUG rasa.core.processor - Action ‘action\_listen’ ended with events ‘[]’.

---

<div class="post-metadata">

**Author:** ![j.mosig](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/j.mosig/32/3588_2.png) [@j.mosig](https://forum.rasa.com/u/j.mosig)\
**Post date:** [January 27, 2021, 9:44am UTC](https://forum.rasa.com/t/intent-from-useruttered-event-is-not-triggering-the-corresponding-rule/39503/2 "2021-01-27T09:44:35Z")

</div>

Hello @srinivasn5, welcome to the Forum!

I’m not sure I understand what you mean by

> invoke a rule from “action\_nlu\_fallback” through UserUttered(“some\_text”,{“intent”: {“name”: “xyz”, “confidence”: 1.0}}) as return event.

What does the rule look like right now? And what is the output of `rasa --version`?

---

<div class="post-metadata">

**Author:** ![srinivasn5](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@srinivasn5](https://forum.rasa.com/u/srinivasn5)\
**Post date:** [January 27, 2021, 11:29am UTC](https://forum.rasa.com/t/intent-from-useruttered-event-is-not-triggering-the-corresponding-rule/39503/3 "2021-01-27T11:29:34Z")

</div>

Hello @j.mosig, Thanks for the reply.

* * *

```
> Rasa Version : 2.1.1
> Rasa SDK Version : 2.1.2
> Python Version : 3.6.9

```

* * *

Here is the thing what I’m trying to achieve.

1. I’ve enabled FallbackClassifier for handling “out\_of\_scope” scenarios, so I’ve added following config in config.yml

2. Once this threshold is reached, I’ve created a custom\_action\_fallback\_handler to handle the user input.

3. In the above custom\_action\_fallback\_handler, i am trying to invoke certain intent (lets say “xyz”)

4. To invoke the intent I am using the UserUtter event with required payload

5. So what i can see in the rasa logs is, the rasa’s NLU server is able to detect the intent name, but it is not able to predict the action/story corresponding to that intent (i.e ‘xyz’)

> LOGS:
> 
> [state 5] user intent: nlu\_fallback | previous action name: action\_listen
> 
> [state 6] user intent: ask\_if\_bot | previous action name: action\_handle\_nlu\_fallback
> 
> 2021-01-27 08:28:08 DEBUG rasa.core.policies.rule\_policy - There is no applicable rule.
> 
> 2021-01-27 08:28:08 DEBUG rasa.core.policies.ensemble - Predicted next action using policy\_1\_TEDPolicy.
> 
> 2021-01-27 08:28:08 DEBUG rasa.core.processor - Predicted next action ‘action\_listen’ with confidence 0.95.
> 
> 2021-01-27 08:28:08 DEBUG rasa.core.processor - Policy prediction ended with events ‘’.
> 
> 2021-01-27 08:28:08 DEBUG rasa.core.processor - Action ‘action\_listen’ ended with events ‘’.

1. Instead it is predicting “action\_listen” is the next action for that intent (which is not true, since I’ve a rule mapped to that particular intent (i.e “xyz”)

2. So how can I trigger a **story/rule** , which is corresponding to the **intent** , that was sent from **UserUttered event**?

Let me know if any further info is required.

---

<div class="post-metadata">

**Author:** ![j.mosig](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/j.mosig/32/3588_2.png) [@j.mosig](https://forum.rasa.com/u/j.mosig)\
**Post date:** [January 27, 2021, 12:16pm UTC](https://forum.rasa.com/t/intent-from-useruttered-event-is-not-triggering-the-corresponding-rule/39503/4 "2021-01-27T12:16:44Z")

</div>

> [@srinivasn5](#):
>
> `return "return "action_handle_nlu_fallback""`

Before I think more about this: Is this a typo?

---

<div class="post-metadata">

**Author:** ![srinivasn5](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@srinivasn5](https://forum.rasa.com/u/srinivasn5)\
**Post date:** [January 27, 2021, 1:28pm UTC](https://forum.rasa.com/t/intent-from-useruttered-event-is-not-triggering-the-corresponding-rule/39503/6 "2021-01-27T13:28:32Z")

</div>

OOPS! Yes it’s a typo, I’ve corrected it now.

---

<div class="post-metadata">

**Author:** ![j.mosig](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/j.mosig/32/3588_2.png) [@j.mosig](https://forum.rasa.com/u/j.mosig)\
**Post date:** [January 28, 2021, 11:09am UTC](https://forum.rasa.com/t/intent-from-useruttered-event-is-not-triggering-the-corresponding-rule/39503/7 "2021-01-28T11:09:20Z")

</div>

Cool, thanks. Yes, I think that doesn’t work. Have to think for an explanation, though. But why do you want to insert a user intent in this way? I think a better approach would be

```auto
rules:
- rule: Handle nlu fallback with supported_services
  steps:
  - intent: nlu_fallback
  - action: action_handle_nlu_fallback
  - slot_was_set:
    - fallback_intent: supported_services
  - action: utter_service

```

So your `action_handle_nlu_fallback` evaluates things and sets a slot `fallback_intent`. The rule then applies only if `fallback_intent` was set to `supported_services`.

---

<div class="post-metadata">

**Author:** ![srinivasn5](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@srinivasn5](https://forum.rasa.com/u/srinivasn5)\
**Post date:** [January 28, 2021, 5:02pm UTC](https://forum.rasa.com/t/intent-from-useruttered-event-is-not-triggering-the-corresponding-rule/39503/8 "2021-01-28T17:02:40Z")

</div>

Thanks. I will try this.
