https://retellai.com/?utm_source=discord&utm_medium=seo logo
Hi everyone šŸ‘‹ Quick question — have any of you im...
# ask-retell-partners
a
Hi everyone šŸ‘‹ Quick question — have any of you implemented conditional logic in a multiprompt project in Retell AI? Here’s the situation: I’m building a collections flow where the customer is first offered to pay the full debt amount ({{debt_total}}). If they decline, the bot should check if a discount is available: Ā· It could be a minimum discount ({{min_discount}}, e.g., 20%) Ā· Or a maximum discount ({{max_discount}}, e.g., 50%) Ā· Or none at all Depending on which variables are present, the bot should: 1. Offer the 20% discount if available. 2. If the customer declines and the 50% discount is available, offer that one. 3. If neither is available, the call should end. I’ve tried two approaches: 1. Single state with multiple edges: One logic state connected to all 3 possible next states (min_discount, max_discount, end_call). But this hasn’t worked well — I can’t control the evaluation priority, and sometimes the bot skips the minimum discount even when it exists. 2. Chained logic states: I created a chain: if min_discount is missing, go to the max_discount state, and if that one is missing too, go to end_call. But even with required fields or presence-based checks, the transition happens regardless of whether the variable is actually defined or not — especially when the value is null or 0. Has anyone found a reliable way to conditionally transition based on whether a dynamic variable exists or has value (e.g., > 0)? Would using a boolean helper variable like min_discount_exists: true work better? Any ideas or workarounds would be greatly appreciated! Thanks šŸ™ https://cdn.discordapp.com/attachments/1294891368505937952/1443392400759193610/content.png?ex=6928e76d&is=692795ed&hm=0bf348ed60132fc033a328b355ad615e9edd03f8c024b2e0a07b3fc77d943b06& https://cdn.discordapp.com/attachments/1294891368505937952/1443392401015177348/content.png?ex=6928e76d&is=692795ed&hm=60fde08cbaf03b5f4534d3aa7933312cb0b84faf827df26382d79317e2bbd2b2&