https://retellai.com/?utm_source=discord&utm_medium=seo logo
I have been stumped for 2 days
# ❓・ai-evy-support
k
@AI Evy I have been stumped for 2 days. in a multi-prompt I need to be able do an api call and then move on to the next node. once i do an api call it is waiting for the caller to say something before it will move on. I hav tried lots of different idea's but nothing is working unless the caller says something. Anyone have any idea's i can try? Thank you in advance for the help and suggestions
a
​ To learn more, see the sources I considered: [[1] Multi prompt agent not always transitioning to the next state](https://discord.com/channels/1186424376300679209/1303504848196472893) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Thanks for tagging me @kywilber. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, there's a documented pattern for ensuring reliable state transitions in multi-prompt agents after function calls [(1) ]() . The key is to make the state transition explicit and high-priority in your prompt. Here's the approach that worked for another user facing a similar issue : In your current state's prompt, add explicit transition instructions:
Copy code
Wait for the user response:
If positive response: Immediately and reliably initiate the transfer. You must invoke the [your_transition_function] function at this point without fail. This is critical and non-negotiable. There must be no delay or hesitation.
If negative response: [your fallback logic]
IMPORTANT: When invoking the [your_transition_function], treat it like a high-priority action. Do not skip or delay this step. It is a "make-or-break" moment in the conversation.
Alternative approach that proved more reliable: Instead of immediately transitioning after the API call, try this sequence : 1. Execute your API call 2. Play a brief confirmation message about the API result 3. Ask the user if it's okay to proceed 4. Then request the state transition This pattern of "API call → brief acknowledgment → user confirmation → transition" was found to transition more reliably between states . You can also use the "phrases" feature in Retell to help ensure the transition function is called .