https://retellai.com/?utm_source=discord&utm_medium=seo logo
Make a booking Voice agent for beginner,
# ❓・bug-report
n
I’m a beginner working on building a voice agent with Retell AI. My goal is to create a simple booking assistant where the user can: Provide details like name, date, and time. Store these values in dynamic variables. Call an external GET API to check availability. If available, call a POST API to confirm the booking. I already managed to create a few states, set a global prompt, and send a GET request with variables. Now I want to learn the best way to structure the agent for my flow. Specifically, I’d like guidance on: When to use global prompt vs state prompts. Whether each question (name, date, time) should be in a separate state or if I can capture multiple details in one state. How to properly store user inputs in dynamic variables and use them in later API calls. The recommended approach to call external APIs with collected variables in Retell AI. I can also share my current agent JSON export if that helps. Could you please guide me (with best practices or examples) on how to set this up? Thanks a lot 🙏 https://cdn.discordapp.com/attachments/1411963149678284932/1411963149980139570/29-08_Multi-State_Agent.json?ex=68b690a7&is=68b53f27&hm=e1f91e30cf924ecbcceea074251b9a9ce7a23d2c4f2cc81147e76b527af78e2b& https://cdn.discordapp.com/attachments/1411963149678284932/1411963150802092113/image.png?ex=68b690a8&is=68b53f28&hm=93b9f6cf8e2867886cd71cf9243018a0a89c68a9a19fc54c3a2bc59ee9b7fdaa& https://cdn.discordapp.com/attachments/1411963149678284932/1411963151213400065/image.png?ex=68b690a8&is=68b53f28&hm=7d1154416449f3311e88fc713aa106e19f33fd7c21c7ffb6abe03866fb3ea554&
o
Global prompt will apply to the entire conversation , if you want to set a certain style or a certain response rules that the agent should follow at the entire conversation or you want to give it a context like the customer name or address , or today date etc.. for the state prompt you to use for specific task like ask for the information before it goes to the next state , or ask for the user preferred date and time it general a single task that will only work for this state
for the questions (name, date, time) you can ask them all in one sate
you can extract the dynamic variables from the call using the extract dynamic variables function https://docs.retellai.com/build/single-multi-prompt/extract-dv#extract-dynamic-variables
and if you want to make external API call you can use custom functions
n
yes @Omar Ashraf | Community Lead i do all of this but whay is the right way can i go in right way please check my screeshot and JSON and tell me is there any another way to do it with same requirement pls guide for that i check a documentation and make it,please review it if it possible
a
I think you can also use an extract varible. I was messing with that last night. It was pretty cool tbh
n
Hi @AngryOfficer Thanks for your answer, right now i am doing that one only, i make a function extract_dynamic variable and list all those variable into that and when i send any query to any endpoint using post request i just call that function to extract variable value,it that correct way to do that, can you please tell me,
o
- You need to give it date and time so the agent knows what day and date we are currently in , you can use the dynamic variable `{{current_time_[timezone]}} `Current time in specified timezone, for example: {{current_time_Australia/Sydney}}
- When want to save a variable you need to call your function name , don't just say save -> last name , you need to use the function name
- I see you putting how to extract the date and the time for the function on the main prompt , you should put it in the side the function parameter description.
- and in the satats you don't need to tell your agent you are assitanit that work on etc.. all the general stuff like the agent personality , the rules he should follow etc.. should be in the general prompt.
a
I just found this plsce. I have no idea
So I am in the same boat as this now and I am having a hard time figuring out this. So are you saying I can have a different prompt for booking? How do I tell retell to do the different prompt instead of the general prompt
o
I believe you are using conversation flow you don't need to prompt it to call the function ,you can use the function node , he is using the multi prompt so he need to prompt to use the function because he doesn't have function node ,you have it.
a
ahhh. Ya I am using the conversational flow
and I would function it to either n8n or zapier I assume?
o
Yes you can use N8N /make / Zapier , your own backend code, or for booking you can use the cal.com native integration.
a
this is what my flow looks like but again its not doing anything in cal.com for some reason even though I have it set up https://cdn.discordapp.com/attachments/1411963149678284932/1414373094130192456/image.png?ex=68bf5517&is=68be0397&hm=c0f39eaa8efe5b030a9472bdc4379074a36f085d6b0b2f051a64a6ad59113172&
o
I respond to you at the other ticket , lets kept it in one ticket.
a
ok