How to loop over actions

I want to repeatedly perform an action until a condition is met. How can this be done in Rasa? I want something like:

* greet
 - utter_greet
 - action_ask_question
 - action_do_stuff
  ] ( repeat until condition is met )
 - utter_done

To give some background our bot makes a suggestion and asks the user “do you like this?”. The user can reply yes or no. We keep making suggestions until the user has said yes to N suggestions. We’ve built an action that does this based on slots but we can’t work out how to use stories to drive this flow (repeatedly invoke an action until the condition is met)


Hi @thobson

This is something you can do with a form and its validation function. The form will keep asking until its slots are filled, so you just have the validation function be the action_do_stuff and let it set the form’s slot to none if the condition is not met. See Forms (or Handling Business Logic | Rasa Open Source Documentation if you work with Rasa 2.0 rc1)

Hi @j.mosig I am really interested in repeating parts of a story/rule using Forms (How to practically design chatbot with repeated parts of a story - #4 by mattvan83).

Could you help me get through?


Melinda just replied on your thread. :slight_smile:

Thanks @j.mosig :slight_smile: