Rasa 2.0 - YAML alphabetical sort breaks form flow


When I make changes to my domain.yml it puts everything into alphabetical order. However, since my forms are in there as well, the slots are asked in a different order (alphabetical one) then how I set them.

Is there a workaround for this?

Thanks in advance!

1 Like

Hi @fabrice-toussaint

One workaround could be to implement required_slots on a custom action for your form. See: Forms.

1 Like

Hi @jjuzl,

I implemented this with this method:

async def required_slots(
        slots_mapped_in_domain: List[Text],
        dispatcher: "CollectingDispatcher",
        tracker: "Tracker",
        domain: "DomainDict",
) -> Optional[List[Text]]:
    """ Set order of slots """
    return ['z_slot', 'a_slot'] 

When I deploy using Kubernetes with Helm Charts & Github Actions this does not seem te be working but when I run it locally it does work. At first my a_slot gets asked instead of my z_slot. I also checked the code on Github and it is the same as when I run it locally. Do you have any idea why this is happening?

Can you please confirm that your custom action is definitely being called, (and specifically the method required_slots)?

I can 100% confirm that it is being called, I added this test:

print("This is being called")

and got this as a result in the actions server:

This is being called