Navigation: Back to the root vs back with modals

Hello Everyone,
I am experiencing certain issue regarding navigation and there are certain things I cannot get as a I am a newbie to mobile dev.

My users go through the steps of training algorithm (around 8 modals) after which I want them to get back to home screen automatically. I am using modals because I do not want them to see a menu bar throughout this journey. Nevertheless when I am using back to the root, it moving them to the first open modal, not the home screen where the journey actually started.
Do you guys see any potential solutions that could be helpful here?

The flow is like:
home screen link → open page in a modal true → open next page in a modal

additionally i noticed that it is not possible to link to page without the modal once a modal chain has started. Any advice how I could directly move users to home screen after a couple of modal screens?

@Mevi I just saw you gave a great help on navigation and modals here,

do you have any ideas?

@Lukasz_Kwiatkowski, looks like this is still working somewhat unintuitively, but here’s a workaround to get back from the modal chain:

  1. Create a true/false app variable like trainingCompleted with initial value of false
  2. When user has completed the last task in the final modal, use “Set app variable” to set it to true, then use “Navigate back to root” as you have previously
  3. On the first modal page of your chain (where you end up when you use “Navigate back to root”), place the following logic after Page focused:

This way when the first modal gets navigated to and focused again and trainingCompleted is true, “Navigate back to root” will get triggered a second time and the user will get returned to the home page.