https://discord.gg/botpress logo
Loop Issue with Greeting Card Buttons when User En...
# šŸ¤help
p
Hi everyone, I’m running into an issue with my Greeting Card setup in Botpress. As you can see in the screenshot, the opening message presents two button options: • Request a consultation • Book an appointment directly with a consultant If the user clicks one of these options, everything works perfectly, the flow continues and the bot collects details like name and phone number or answers questions. However, if the user types a message instead of selecting one of the buttons, the bot falls into a loop: it keeps displaying the Greeting Card again with the same options. Here’s what I’ve already tried: • In an Autonomous Node, I solved this by giving the AI Node an instruction that says:
Copy code
### Behavior for Button Responses

When you display buttons/options:
    1.    Remember that you are waiting for a button response.
    2.    If the user clicks a button: process the selection normally.
    3.    If the user instead types TEXT:
    •    Analyze whether the text matches one of the displayed options.
    •    If YES: handle it as the corresponding button click.
    •    If NO: politely say, ā€œBitte wƤhle eine der angezeigten Optionenā€
    •    Show the same buttons again.
    •    Wait for another response.

IMPORTANT: Do NOT start over — stay in the same context!
• For the Greeting Card, I’ve tried several approaches, using an Intent, an AI Transition, and even an Execute Code block (as shown in the screenshot), but none of them have resolved the loop issue. Ideally, I’d like to find a global solution that applies across the entire workflow, so that any node offering button options behaves the same way. But if that’s not possible, I’d also be fine with a node-level fix for each Card that uses buttons. Has anyone found a good way to handle this scenario? Thank you šŸ™šŸ¾ https://cdn.discordapp.com/attachments/1430503701608530061/1430505231170408458/opener-loop.png?ex=68fa0550&is=68f8b3d0&hm=63ef6d1f3c84c7f7a84187c3c1e3cbb524b636bb5e05b3c0de18653620cef13e&
w
Try to prompt AN to write a multiple-choice question the first time the user interacts, specifying the text and options.
p
Just to clarify, what does "AN" stand for in this context? Does it refer to an AI Node or something else?
w
your Autonomous Node
p
I’ll give this a try, but I’m wondering if there’s a way to achieve this without using an Autonomous Node. Here’s the situation: our bot is set to automatically pop up about 4 seconds after the website loads, which means a conversation starts right away. As a result, our AI spend would increase quite a bit if we trigger a full conversation each time. That’s why we currently use a greeting card instead, to keep the AI usage lower. So I’d really appreciate any suggestions or best practices on how to achieve a similar ā€œfirst interaction with optionsā€ setup without relying on an Autonomous Node.
w
well your cost will increase regardless since you automatically trigger a conversation
and that trigger counts as a incoming event in botpress's pricing
but 1. you should use "single choice" instead of multiple choice
single choice means the user can only choose one option, not that the user is only presented a single option (i fell for that one once too)
and 2. you can add a "retries" on your single choice card with the "retries" set to 0
and achieve something like this
so you can basically trash your autonomous node
if you really want to retry, you can increase the "retry" amount and set your desired retry message
but if you want to retry with an ai-generated message you can follow the example above and tie the node to an AI TASK or AI generate text or whatever you want
l
Did this not loop back to the single choice?
w
nope since i set the retries to 0
w
I agree with you; a single choice should try to match a free text within the options. I suggest using the advanced setting Add transition to handle failure, and you need to decide if your users can cancel. https://cdn.discordapp.com/attachments/1430503701608530061/1430821826975498291/image.png?ex=68fb2c2a&is=68f9daaa&hm=681f81939d6f9e26f11b6f085e970a150b02de8da032f6511646fd8b58e600e8&
w
oh that's a nice option, i've never seen it before
thank you so much for the tip!!
w
Under the Advanced panel are hidden 🤣 interesting options
p
Hey @white-nest-40686 and @wide-umbrella-5226 , just wanted to say thanks again, the retry setup works great now! The only thing I’ve noticed is that the retry sometimes seems to reset on its own. It happened twice already where the value went back to 2.
w
maybe 0 isn't really an allowed value - some things (like the summary agent) don't let you set it too low as well
maybe the cancellation is a good alternative
(and turn off "confirm before cancelling")
p
I will test this with the test bot
Will give you later feedback. Thanks
w
i don't know if it can help you, but i just create a workflow integration https://discord.com/channels/1108396290624213082/1432520798798745600/1433091582227386408