jumpTo Function - purpose and limitations

I’ve integrated some API calls inside my chatbot by using actions. And inside those actions I’m trying to move the conversation from one flow or another, with specific nodes.

What works: If I call jumpTo a flow that has as a starting node a Choice skill, the flow moves correctly and the starting node appears on the chat.

What doesn’t work: If I call jumpTo to any other flow that doesn’t have a Choice skill as a starting node, the flow ends then and there.

What I’m doing is having a node with an action set buitin/getSomething at “onEnter” and based on certain results I’m trying to jump to another flow and the results are described above.

I’ve read every bit of reference online about jumpTo, but it isn’t clear to me what is it’s purpose and limitations.

UPDATE: I see that if I call jumpTo from a hook everything works, but if I call it from an action it doesn’t unless there is a Choice skill at the start of the node.

No one is using “jumpTo”, or has any idea about it’s limitations?

@alex any solution for this situation ?

it works after I make temp empty

event.state.temp = {} ;

Will try your solution…

Hi @Macaret, Jump To is fairly basic, all it does is change the current flow/node for the next processing cycle. The sessionId is not used either.

It accepts an event, clears its context, and set the specified flow/node. Changing temp will not impact that.

So basically, the jump to should be done while it’s processing something

im also facing same problem, im using jumpTo in action but nothing happens.
This is the code in action
const myMethod = async () => {
const stateId = bp.dialog.createId(event)
await bp.dialog.jumpTo(stateId, event, ‘main.flow.json’, ‘route’)
console.log(‘Hello!’)
}

return myMethod()

i need to jump to node called ‘route’ in my main.flow
@Macaret any luck with you problem?

As a clarification, jumpTo must be done outside of an action (preferrably inside a hook). The schema here gives an overview of the event engine: https://botpress.io/docs/12.1.3/build/overview#complete-overview-of-the-event-engine

When it gets to Process Event, the instruction queue is built, then it processes actions and other instructions. The queue is not reset by jumpTo at that point

@allardy it doesn’t make any sense to make it called through hooks only ! I need to jump to another node after preform operation.

In my example I am using rasa NLU and after user enter some text I need to route it based on intent type , how can I achieve that without jumpto function

Hi @ashrafateef, I agree that it’s not the most useful feature. However, it does make sense to use hooks in your example using Rasa.

  • You have a hook calling rasa to fetch the intent & required information
  • The hook then jumps to the correct node, or redirects to a node where you can configure transitions to other flows / nodes.

May I know why you want to query your NLU provider through an action instead of using hooks ?

@allardy but this hook is for all my bots not for this single bot

@ashrafateef Hooks are global at the moment, but you can check the requested bot ID by checking event.botId , then just do nothing if the ID doesn’t match