Rasa Stories not following the defined series of intent and actions

I wanted to execute the following story

- story: dental_tooth_pain
  steps:
  - intent: greet
  - action: utter_problem
  - intent: tooth_pain
  - action: utter_age
  - intent: age
  - action: utter_gender
  - intent: gender
  - action: utter_severity
  - intent: severity
  - action: utter_dentist

- story: tooth_alignment
  steps:
  - intent: greet
  - action: utter_problem
  - intent: tooth_align
  - action: utter_age
  - intent: age
  - action: utter_gender
  - intent: gender
  - action: utter_severity
  - intent: frequency
  - action: utter_dentist

However, after asking age, it it taking me to some different utter response which is totally irrelevant. What is the cause of this randomness and how can this be fixed? Need urgent help on this.

You should consider using forms for this instead of stories.

If you want to use stories instead of forms, you can combine the above two stories with the or statement which will probably help identify the issue:

  - intent: greet
  - action: utter_problem
  - or:
    - intent: tooth_pain
    - intent: tooth_align
  - action: utter_age

The debug log provides info on the dialogue prediction and why it’s not doing what you expect.