If you want a story to execute conditionally, add a slot command to the story. For example, I have a profile slot (categorical with values “vip”, “standard”, “anonymous”).
In my stories I have something like this:
## greet_vip_story
* greet
- slot{"profile" : "vip"}
- utter_vip_greeting
## greet_standard_story
* greet
- slot{"profile": "standard"}
- utter_standard_greeting
## greet_anonymous_story
* greet
- slot{"profile": "anonymous"}
- utter_please_log_in
In this case, I’m assuming the slot already contains the correct value. Have a look here: Rasa documentation on slots, to see what can be detected. (A string for example, can’t be matched, you can just check if it is set or not)
Does this solve the problem for you?