https://retellai.com/?utm_source=discord&utm_medium=seo logo
Hello RetellAI Support Team, We are implementing a...
# ❓・ai-evy-support
b
@AI Evy Hello RetellAI Support Team, We are implementing a survey flow inside a voicebot, and we need some guidance regarding the best way to handle a dynamic number of questions. Here is the scenario: We have an endpoint to retrieve all survey questions (each question includes its id and text). Then, for each customer answer, we need to call another endpoint to register the response, which requires the specific questionId, the apiKey, and the customer’s response. The challenge is that the number of questions is not fixed (it can be 7, 9, or more). We want the voicebot to: Fetch all questions at the start. Ask them one by one, waiting for the customer’s response. After each answer, immediately call the register endpoint with the proper id. Continue until all questions are answered. Close the survey politely. Could you confirm if this iterative logic can be implemented directly in RetellAI? Or do you recommend another approach (e.g., preloading all questions vs. handling them dynamically)? Thank you very much for your support!
a
Thanks for tagging me @blow_666. I'll look through relevant sources and get back to you shortly.
​ To learn more, see the sources I considered: [[1] API Integration](https://www.retellai.com/glossary/api-integration) [[2] AI Voice Agents for Real-Time Survey Feedback | Retell AI](https://www.retellai.com/blog/utilizing-ai-voice-agents-for-real-time-survey-feedback) [[3] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
them sequentially, and making API calls after each response) isn't explicitly documented in the available sources. For detailed guidance on implementing this specific survey workflow, I'd recommend: - [Contact Sales]() - [) Would you like a general answer based on my knowledge instead?
### Answer Based on the available documentation, I can provide some guidance on implementing survey flows in Retell AI, though the specific iterative logic you're describing isn't explicitly covered in the sources. Retell AI supports API integrations that enable voice agents to interact with external systems and trigger actions automatically [(1) ]() . The platform allows agents to call external APIs, which would support your need to fetch questions and register responses . For survey implementations, Retell AI voice agents can be designed to engage users in real-time conversational experiences [(2) ]() . The platform supports creating dynamic call flows and custom actions based on user responses . Key capabilities that may help with your survey flow: **Dynamic Variables**: You can use dynamic variables with the
{{variable_name}}
syntax to inject personalized data into your agent's responses [(3) ]() . This could help with referencing question IDs or customer information during the survey . **Tool Configurations**: Dynamic variables can be used in custom function URLs and tool descriptions , which could support your API endpoint calls for fetching questions and registering responses. **Conversation Flow**: Retell AI offers a Conversation Flow feature that allows you to build AI phone agents with dynamic call flows rather than rigid scripts, enabling you to specify what the AI agent should say at different points and define custom actions based on user responses [(2) ]() . However, the specific iterative logic you're describing (dynamically fetching a variable number of questions, processing
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.