How to repeatedly listen for user input after asking questions inside custom action?

Hi, I have a RASA model where a custom action is entered based on a story I have. Inside this custom action I would like to parse an external tree (which is not an issue) but I need to continuously ask the questions from the tree and be able to wait for their response inside the custom action to get answers from the user. Once the user says “Done” the action is complete and I want that to be the end of the story. My main issue is I do not know how to have the custom action wait for the user response because when I use tracker.get_slot('parse_response') it immediately gets the last value.

So basically I would like this to happen:

*get first tree question*

dispatcher.utter_message("first tree question")

*custom action waits for response*

*custom action gets response AFTER question (not previously stored or the last message) and continues with parse based on that value*

Thank you!

It looks that you can do this with a form.

There’s probably a misconception about how actions and the dispatcher work. Bot Utterances are made after the action has run. The dispatcher just collects the messages, that the MessageProcessor hands to the output channel afterwards, but slot values are set before the action runs.

Anyway, as @Gehova stated, this seems to be a job for the form action. If you dont want to use a FormAction, youll need a lot of logic in a single action or a chain of different action, calling each other via Followup-events