# Rasa custom action not triggering another story

**URL:** <https://forum.rasa.com/t/rasa-custom-action-not-triggering-another-story/56205>\
**Category:** Rasa Open Source\
**Created:** [November 17, 2022, 2:29pm UTC](https://forum.rasa.com/t/rasa-custom-action-not-triggering-another-story/56205 "2022-11-17T14:29:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjs007](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/bjs007/32/21961_2.png) [@bjs007](https://forum.rasa.com/u/bjs007)\
**Post date:** [November 17, 2022, 2:29pm UTC](https://forum.rasa.com/t/rasa-custom-action-not-triggering-another-story/56205/1 "2022-11-17T14:29:10Z")

</div>

[Recover\_pin\_code\_T9erhAW\_stories.yml](https://forum.rasa.com/uploads/short-url/q8J7U68YkYoI2pP4LpNWVHXAPa3.yml) (1.6 KB)

@souvikg10 souvikg10 can you please help? please class ActionFromWhereDoYouWantToTransferMoneyFrom(Action):

```
def name(self) -> Text:
    return "action_from_where_do_you_want_to_transfer_money_from"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    user_choice = tracker.get_slot("transfertype")

    return [SlotSet("transfertype", user_choice)]

```

class ActionEvaluateAmeliaExpFromParent23807cb0(Action):

```
def name(self) -> Text:
    return "action_evaluate_amelia_exp_from_parent_23807cb0"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

    if (tracker.get_slot("smstype")) == "phone":`Preformatted text`
       return [SlotSet("edge_", "4b9b53c4-39ec-4b0e-a6e5-048f56b212ae"), FollowupAction(name="action_evaluate_amelia_exp_from_parent_23807cb0_result")]
    if (tracker.get_slot("smstype")) == "whatsapp":
       return [SlotSet("edge_", "06cfb640-b3c3-4fb5-93f4-7cfab73e8c06"), FollowupAction(name="action_evaluate_amelia_exp_from_parent_23807cb0_result")]

```

class ActionEvaluateAmeliaExpFromParent23807cb0Result(Action):

```
def name(self) -> Text:
    return "action_evaluate_amelia_exp_from_parent_23807cb0_result"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    return

```

Story file attached.

1. Story Recover\_pin\_code\_T9erhAW\_AmeliaAsks\_56c76b90\_AmeliaSays\_a67ef531 works fine
2. Story Amelia Asks\_AmeliaSays\_a67ef531\_AmeliaAsks\_11070919\_AmeliaSays\_23807cb0 also gets triggered
3. 
  - action: action\_do\_you\_want\_on\_phone\_or\_whatsapp takes input however it can not trigger next action. It says no memoized action. It should either trigger story: \_AmeliaSays\_23807cb0 or \_AmeliaSays\_534b4f25

- story: \_AmeliaSays\_23807cb0 steps:
  - action: action\_evaluate\_amelia\_exp\_from\_parent\_23807cb0\_result
  - slot\_was\_set:
    - edge\_: 4b9b53c4-39ec-4b0e-a6e5-048f56b212ae

  - action: utter\_you\_will\_receive\_as\_regular\_message

- story: \_AmeliaSays\_534b4f25 steps:
  - action: action\_evaluate\_amelia\_exp\_from\_parent\_23807cb0\_result
  - slot\_was\_set:
    - edge\_: 06cfb640-b3c3-4fb5-93f4-7cfab73e8c06

  - action: utter\_you\_will\_receive\_on\_whatsapp

---

<div class="post-metadata">

**Author:** ![Margaretbrown](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@Margaretbrown](https://forum.rasa.com/u/Margaretbrown)\
**Post date:** [November 18, 2022, 6:56am UTC](https://forum.rasa.com/t/rasa-custom-action-not-triggering-another-story/56205/2 "2022-11-18T06:56:05Z")

</div>

Follow this steps to triggering custom action : Introduction. Setting up your environment. Installing Rasa Open Source. Deploying Assistants. Introduction. Monitoring and Analyzing Assistants. Analytics. Custom Graph Components. Graph Recipe. Action Server. Introduction. rasa.cli.arguments.data. rasa.cli.arguments.evaluate. Rasa SDK Change Log. Compatibility Matrix. [PrepaidGiftBalance Mastercard](https://www.prepaidgiftbalance.vip)

---

<div class="post-metadata">

**Author:** ![souvikg10](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/souvikg10/32/93_2.png) [@souvikg10](https://forum.rasa.com/u/souvikg10)\
**Post date:** [November 18, 2022, 5:47pm UTC](https://forum.rasa.com/t/rasa-custom-action-not-triggering-another-story/56205/3 "2022-11-18T17:47:23Z")

</div>

You didn’t write about the issue you are facing… ☹

---

<div class="post-metadata">

**Author:** ![bjs007](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/bjs007/32/21961_2.png) [@bjs007](https://forum.rasa.com/u/bjs007)\
**Post date:** [November 19, 2022, 5:30am UTC](https://forum.rasa.com/t/rasa-custom-action-not-triggering-another-story/56205/4 "2022-11-19T05:30:56Z")

</div>

> [@bjs007](#):
>
> action: action\_do\_you\_want\_on\_phone\_or\_whatsapp takes input however it can not trigger next action. It says no memoized action. It should either trigger story: \_AmeliaSays\_23807cb0 or \_AmeliaSays\_534b4f25

I am sorry if I did not make it clear but this is the problem

Point 3

- action: action\_do\_you\_want\_on\_phone\_or\_whatsapp takes input however it can not trigger the next action. It says no memoized action. It should either trigger story: \_AmeliaSays\_23807cb0 or \_AmeliaSays\_534b4f25 but it does not happen regularly. Sometime it works and sometime it does not.

---

<div class="post-metadata">

**Author:** ![souvikg10](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/souvikg10/32/93_2.png) [@souvikg10](https://forum.rasa.com/u/souvikg10)\
**Post date:** [November 19, 2022, 9:18am UTC](https://forum.rasa.com/t/rasa-custom-action-not-triggering-another-story/56205/5 "2022-11-19T09:18:53Z")

</div>

I feel like you are missing something here

```auto
steps:
  - action: action_evaluate_amelia_exp_from_parent_a67ef531_result
  - slot_was_set:
    - edge_: f7395d28-05bb-4482-a728-5059e3620069
  - action: utter_sure_you_will_receive_your_pincode_via_sms
  - action: utter_do_you_want_on_phone_or_whatsapp
  - intent: recoverpincodeterhaw2
  - action: action_do_you_want_on_phone_or_whatsapp
  - action: action_evaluate_amelia_exp_from_parent_23807cb0

```

If action\_do\_you\_want\_on\_phone\_or\_whatsapp does get triggered, assuming this is a custom action, what exactly does it do? send an utter back to the user? if so, then should you not have intent to take the input from the user after the action? for me, it seems two actions are triggered subsequently,

```auto
 - action: action_do_you_want_on_phone_or_whatsapp
 - action: action_evaluate_amelia_exp_from_parent_23807cb0

```

yet if the first one is assuming an input for the user, you should provide an intent in the story to capture that input before triggering the next action

also how are some of your stories triggered without an intent? are you triggering them in custom actions?

---

<div class="post-metadata">

**Author:** ![bjs007](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/bjs007/32/21961_2.png) [@bjs007](https://forum.rasa.com/u/bjs007)\
**Post date:** [November 20, 2022, 5:21am UTC](https://forum.rasa.com/t/rasa-custom-action-not-triggering-another-story/56205/6 "2022-11-20T05:21:26Z")

</div>

1. 
  - action: action\_do\_you\_want\_on\_phone\_or\_whatsapp custom action takes input from the user and sets a slot smstype provided by the intent recoverpincodeterhaw2

class ActionDoYouWantOnPhoneOrWhatsapp(Action):

```
def name(self) -> Text:
    return "action_do_you_want_on_phone_or_whatsapp"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    user_choice = tracker.get_slot("smstype")
    return [SlotSet("smstype", user_choice)]

```

1. Then the custom action action\_evaluate\_amelia\_exp\_from\_parent\_23807cb0 is triggered as it is the next step mentioned in the story. This checks for a few conditions

class ActionEvaluateAmeliaExpFromParent23807cb0(Action):

```
def name(self) -> Text:
    return "action_evaluate_amelia_exp_from_parent_23807cb0"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    if (tracker.get_slot("smstype")) == "phone":
       return [FollowupAction(name="action_evaluate_amelia_exp_from_parent_23807cb0_result")]
    if (tracker.get_slot("smstype")) == "whatsapp":
       return [FollowupAction(name="action_evaluate_amelia_exp_from_parent_23807cb0_result2")]

```

if the slot smstype is phone as provided by the user then it triggers the next Story (- story: \_AmeliaSays\_23807cb0) using FollowupAction action\_evaluate\_amelia\_exp\_from\_parent\_23807cb0\_result

- story: \_AmeliaSays\_23807cb0 steps:
  - action: action\_evaluate\_amelia\_exp\_from\_parent\_23807cb0\_result
  - slot\_was\_set:
    - edge\_: 4b9b53c4-39ec-4b0e-a6e5-048f56b212ae

  - action: utter\_you\_will\_receive\_as\_regular\_message

else if the smstype is whatsapp then folowupAction action\_evaluate\_amelia\_exp\_from\_parent\_23807cb0\_result2 this is triggered

- story: \_AmeliaSays\_534b4f25 steps:
  - action: action\_evaluate\_amelia\_exp\_from\_parent\_23807cb0\_result2
  - slot\_was\_set:
    - edge\_: 06cfb640-b3c3-4fb5-93f4-7cfab73e8c06

  - action: utter\_you\_will\_receive\_on\_whatsapp

class ActionEvaluateAmeliaExpFromParent23807cb0Result(Action):

```
def name(self) -> Text:
    return "action_evaluate_amelia_exp_from_parent_23807cb0_result"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    return [SlotSet("edge_", "4b9b53c4-39ec-4b0e-a6e5-048f56b212ae")]

```

class ActionEvaluateAmeliaExpFromParent23807cb0Result2(Action):

```
def name(self) -> Text:
    return "action_evaluate_amelia_exp_from_parent_23807cb0_result2"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    return [SlotSet("edge_", "06cfb640-b3c3-4fb5-93f4-7cfab73e8c06")]

```

**why we need an intent after one custom action to capture if we are going through the same story?**** also, how are some of your stories triggered without intent? are you triggering them in custom actions?** Yes. I am starting a few of the stories without intent. but using a custom action.

Is it not possible to have a story without intent?

I have attached all of the stories

here is the flow

This is a banking service

Users can select from three options in the main\_story either to check their balance, change their pin, or transfer a custom action (action\_what\_do\_you\_want\_to\_do) takes input and that triggers another custom action action\_evaluate\_amelia\_exp\_from\_parent\_76c1a8e0 which checks for an expression evaluation and depending on the expression evaluation result it can either trigger action\_evaluate\_amelia\_exp\_from\_parent\_76c1a8e0\_result or —\> executes a separate story mentioned in separate file action\_evaluate\_amelia\_exp\_from\_parent\_76c1a8e0\_result2 → executes a separate mentioned in a separate file

The same logic I have used everywhere for checking conditions. I have to use an intermediate custom action like action\_evaluate\_amelia\_exp\_from\_parent\_23807cb0 instead of directly using just a slot because I can have a complex expression/condition to check before triggering another story.

The problem is it works for the initial few conditions check but after 2 conditions it does not work.

The above-mentioned story in my Question is part (change) of a bigger story (main story) [change\_stories.yml](https://forum.rasa.com/uploads/short-url/91Qu3fLi6kvQFhOQNzRi2BkVUta.yml) (2.8 KB) [main\_stries.yml](https://forum.rasa.com/uploads/short-url/dk0XCE4bgag5LAuNXnwbsfhlRc8.yml) (1.2 KB) [story\_bankbalance.yml](https://forum.rasa.com/uploads/short-url/1x5dtSQouZSl22hO1DqzGEYS6eR.yml) (838 Bytes) [story\_transfer.yml](https://forum.rasa.com/uploads/short-url/paHytZlnIFcVg7MI4KbhPjDwA0V.yml) (1000 Bytes)
