The api response switches to the (sub)flows

Hi Guys,

I’m pretty new to Botpress and I have a question.

I have the main flow, the starting flow and say 20 sub-flows. When my main flow starts it makes an API call to a server and the response for a GET is for instance 4. it would be great if the flow would then automatically go to sub-flow 4.

I have no idea how to do this. How do I use the response in the node? I can get the response as a text in my text nodes with {{session.response.body.id}}. So the API call work and I can find it.

But how can I make the switch to a sub-flow when the result of session.response.body.id == 4 to flow number 4?

Please help me with this. I would help me a lot!

thanks,

Jeroen