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