https://discord.gg/botpress logo
'bp.dm.jumpTo' is supported in Studio Cloud, How t...
# šŸ¤help
g
Hi team, I’m trying to use bp.dm.jumpTo to immediately return a user to a menu node (Back / Cancel) while a long workflow is running. I’ve confirmed bp.dm.jumpTo exists at runtime, but calling it with: - conversationId - flowId from event.state.context.currentFlow (e.g. flow:Main) - nodeId from event.state.context.currentNode (e.g. node:menu) does not cause execution to jump; the workflow continues normally, and i see this in logs:
Copy code
[794e4c2115]    [bot-action]    [flow:Main] [node:jump_to_main] [card:]:     jumpTo failed: Could not find a flow matching the provided ID. Flow: flow:Main | Node: N/A.
This error should not happen unless your conversation is in a corrupted state (eg. in progress on an older version of the chatbot).
To reset your conversational manually, say "//state/reset" to your chatbot to force the state to reset.
If this error persists, please contact support.
i also tried just:
Main
as the flow, and it still couldn't I suspect jumpTo may require internal workflow/node identifiers (e.g. wf-, nd-) rather than the flow:* / node:* values exposed in event.state.context, but I don’t see a way to obtain those IDs from Execute Code cards. Could you clarify: - Is bp.dm.jumpTo officially supported in Studio Cloud? - If so, what is the correct call signature? - Which ID namespace does it expect? - How (if at all) can those IDs be obtained at runtime in Studio? If it’s unsupported, a confirmation would help so I can move forward with a different pattern. Thanks.
CODE I USED FOR REFERENCE `if (typeof bp?.dm?.jumpTo === 'function') { const conversationId = event.conversationId; const flowName = 'flow:Main'; // Replace with your target flow const nodeId = 'node:menu'; // Replace with your target nodeId try { await bp.dm.jumpTo(conversationId, flowName, nodeId); console.info(
jumpTo executed: ${flowName}:${nodeId}
); } catch (err) { console.error(
jumpTo failed: ${err.message} ${err}
); } } else { console.warn('bp.dm.jumpTo is not available.'); }`
The function does exist, but the try enters the catch so i am doing something wrong.
Thanks for your reply its much apprecieated, and yeah itd be amazing if we could. so I am on cloud (studio) and i have one long workflow, loads of nodes and code cards with some text cards. the workflow takes around 10 sec to complete, comprising of syncronous and asyncrounous codes (not all in one code block) executing one after another. it has quite a few nodes, but with no stops, once started, its running that ~ 10 secs of flow. the bot is hooked to a UI, when a user hits back on the UI (emphasising they want to go back to main, mid flow execution) the UI sends an event to the bot. Regarding the work around, i already had thought of using after incoming hook on that specific event.type, set flag, and use many expression cards to pivot off (since there are many nodes that can catch the pivot point). but that is kinda visually messy, not that its an issue, just not as clean as the jumpTo method which would enable me to keep the logic centralised, and the workflows clean(er).
also maybe not as quick/instantaneous as the jump to method... we may have to ask in feature requests.
l
Hey Phil! The majority of replies similar to this are just people scamming and using chat gpt. They will pretend to answer and then try to dm you for money.
That being said I will ask the team directly and get back to you when I can 🫔
g
HAH I got sent!
Nice one mate can count on you
w
i think you're gonna get major headaches by trying to build anything using node and workflow ids as references
why don't you just connect the "back" option to the menu?
g
the back option is for a UI. so user clicks back on UI while bot is mid flow and not stopping for 10 seconds. its not too difficult, when a user hits back on the ui, my webapp sends an event to the bot, the event is recieved in the advanced webchat trigger or hook, the flow is terminated and 'jumpsTo' the one desired node i need it to go to
l
According to the docs (ai) - bp.dm.jumpTo is not officially supported in Studio Cloud, and its required internal identifiers are not accessible at runtime. However I'll try getting a second opinion on this!
g
yeaa i know, however i did some checks on the function and it exists. - I verified it existed by logging its type in an Execute Code card (or hook):
typeof bp?.dm?.jumpTo === 'function'
→ returned function. - I inspected its apparent ā€œshapeā€ by printing the function itself / its source string, e.g.:
bp.dm.jumpTo.toString()
That output showed it taking three positional parameters (displayed like
(y, f, w) => …)
, which is why I then tried passing three arguments (conversationId, flowId, nodeId) in that order.
Sorry about this Ross šŸ˜† , theyll probably say its for internal use, not for users to use, it most likely is used to invoke the error, timeout, and maybe conversation end workflows or something
w
do you think that would work in that case specifically? stopping the bot mid-turn?
if by "not stopping for 10 seconds" you mean mid-processing
g
So I would think that it’d be similar to how the error workflow can invoke mid flow and terminate the whole thing.
Also it’s not like mid turn in the sense of how autonomous nodes work, because loads of standard nodes only with multiple cards in each wired in series, so each card you can exit.
Bit of a different use case
Tried to get bp.dm.jumpTo working for mid-flow navigation. - flow:Main → flow not found - I then used workflow ID from Studio URL (e.g. wf-main) fixed flow resolution → error changed to node not found - Inspected Network tab, found node IDs (nd-*) belonging to main flow - Passed valid dialog node ID (not handler/trigger) → flow + node resolve Engine then crashes with: - TypeError: Cannot read properties of undefined (reading '__stacktrace') Same error even after: - running through the target node first - targeting a paused node (Raw Input / Wait) Conclusion: jumpTo exists and partially executes, but Studio Cloud does not expose/retain the execution stack it requires. Even with correct IDs and paused nodes, it wont execute. This was the final error message after correctly obtaining IDS:
jumpTo failed: Cannot read properties of undefined (reading '__stacktrace') TypeError: Cannot read properties of undefined (reading '__stacktrace')
2 Views