Reusing same intent twice in story gives wrong actions result

I have a rule that looks like this:

- rule: Disconnect connection flow after authentication
  condition:
  - slot_was_set:
    - is_authenticated: true
  steps:
  - intent: disconnection
  - action: utter_prompt_safe_custody
  - intent: disconnection
  - action: utter_disconnection_options

This doesn’t work because I get the rasa error that more than user message is mentioned, don’t hardcode the state machine, something of that sort.

The reason I did this was because in the following story, rasa went to the last action directly instead of the first action.

- story: Disconnection flow
  steps:
  - intent: disconnection
  - slot_was_set: 
    - is_authenticated: true
  - action: utter_prompt_safe_custody
  - intent: disconnection
  - action: utter_disconnection_options

How do I let rasa know that I need it to do ‘utter_prompt_safe_custody’ first, instead of ‘utter_disconnection_options’?

I am having the same intent twice, because the user may type the same nlu example for the two steps.

Is there a different way to do this, or am I missing something?

I am using rasa version 2.3.4

@actorkrishna I guess you should use form for your usecase. Is that you using form?

Why should I use a form here? Ain’t it a simple intent-action pair? Also, if I need to use a rasa form, how do I go about using it? What should the slots be to fill in?

There is no way Rasa can separate which action to take if intents are the same. Make two different strories with different intents.

But what should I do if the user enters the same kind of message (NLU example) for both the intents? I can’t write the same NLU for different intents. It will throw an error

ok, also your rule is conflicting with your story, and rule rules i.e. first, rule is checked and then the story. That why it jumps to last action.
Also I don’t use multiple intents in story, it is always intent → action 1 → action 2 etc. Otherwise bot will jump randomly, out of my control

So check the basics, think your bot logic again and try that

I had removed rule already when I put story. It’s either rule or story, not both at once. Also, i’m checking with the following stories in the disconnection flow

version: "2.0"
stories:
- story: Disconnection flow part 1
  steps:
  - intent: disconnection
  - slot_was_set:
    - is_authenticated: true
  - action: utter_prompt_safe_custody
  - checkpoint: disconnect_connection_checkpoint

- story: Disconnection flow part 2
  steps:
  - checkpoint: disconnect_connection_checkpoint
  - action: utter_prompt_safe_custody
  - intent: disconnection
  - action: utter_disconnection_options

I used checkpoints first without repeating the utter_prompt_safe_custody action in the above file and it still jumped to the last action. Now with the above structure in the story, it gives the utter_prompt_safe_custody action twice.

OTP verification is successful
Buttons:
1: Safe Custody (/safe_custody)
2: Cancel Subscription (/disconnection)
You can stop billing temporarily for just Rs 200/month and reconnect in a jiffy when you are back by opting for safe custody
? You can stop billing temporarily for just Rs 200/month and reconnect in a jiffy when you are back by
 opting for safe custody  (Use arrow keys)                                                           
 » 1: Safe Custody (/safe_custody)
   2: Cancel Subscription (/disconnection)
   Type out your own message...                  

In Rasa shell

ok. this is i happening

inten “disconnection” called, strory “Disconnection flow part 1” starts, after intent is slot filling, and after that Action “utter_prompt_safe_custody” and lastly checkpoint “disconnect_connection_checkpoint”

Now in story “Disconnection flow part 2” you don’t have any intent, so that story can not be started. The checkpoint here means that this story can not start before checkpoint “disconnect_connection_checkpoint” is “checked” nothing more.

See chekpoint examples here

Stories