https://retellai.com/?utm_source=discord&utm_medium=seo logo
I am having trouble with the multi prompt agent
# 💬・general
j
@AI Evy I am having trouble with the multi prompt agent. Right now i have set up all of the stages and put the path conditions on when to go to the next stage in the edge box that is created. but when i test it in the chat, the agent never moves on from stage 1 is this normal? how should i go about fixing this issue
a
Thanks for tagging me @jrok1308. I'll look through relevant sources and get back to you shortly.
### Answer This is a common issue with multi-prompt agents. Based on the documentation and community discussions, here are several approaches to fix state transition problems: 1. Define clear transition logic in your prompts According to the documentation, you should define state transition logic directly in your prompts [(1) ]() . For example:
Copy code
Ask if user is interested in an in person tour.
 - if yes, transition to schedule_tour.
 - if no or hesitant, call function end_call to hang up politely and say will reach out if any other interesting properties pop up.
2. Use specific phrases to trigger transitions Community members have found success by adding more explicit language in their prompts to ensure reliable state transitions [(2) ]() . One approach is to make the transition instructions more emphatic:
Copy code
Wait for the user response:
If positive response: Immediately and reliably initiate the transfer. You must invoke the transfer_call_six function at this point without fail. This is critical and non-negotiable. There must be no delay or hesitation.
3. Consider conversation flow instead Some users have reported that complex multi-prompt agents can feel "quirky" and have found conversation flow to be more reliable for complex scenarios [(3) ]() . One community member noted: "I tried a 400-line single-agent to multi prompt, and had challenges. It just felt quirkly... Then just went to conversation flow as it is much easier to see the flow and debug" . 4. Test your edge conditions Make sure your path conditions in the edge boxes are specific enough to match user responses. The system needs clear criteria to determine when to transition between states [(4) ]() . Try implementing more explicit transition instructions in your prompts first, and if you continue having issues with complex flows, consider using conversation flow for better control and debugging capabilities.
​ To learn more, see the sources I considered: [[1] Build a multi-prompt agent](https://docs.retellai.com/build/single-multi-prompt/write-multi-prompt) [[2] Multi prompt agent not always transitioning to the next state](https://discord.com/channels/1186424376300679209/1303504848196472893) [[3] Discord message from @harrison_91123 on 2025-02-14](https://discord.com/channels/1186424376300679209/1186462578310910112/1339769666276560967) [[4] Multi prompt agent not always transitioning to the next state](https://discord.com/channels/1186424376300679209/1412769473227657329) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
hey quick question - if i click "convert to chat agent" on my voice agent, does it: A) create a NEW chat agent (and keep my voice agent working) OR B) replace my voice agent and turn it into chat only (breaking my phone system) i have a live production voice agent handling real patient calls right now so i can't mess it up. just want to add chat to my website but keep phone calls working. basically - will i end up with 2 agents (voice + chat) or just 1 chat agent? thanks!
@AI Evy hey quick question - if i click "convert to chat agent" on my voice agent, does it: A) create a NEW chat agent (and keep my voice agent working) OR B) replace my voice agent and turn it into chat only (breaking my phone system) i have a live production voice agent handling real patient calls right now so i can't mess it up. just want to add chat to my website but keep phone calls working. basically - will i end up with 2 agents (voice + chat) or just 1 chat agent? thanks!
a
Thanks for the follow-up, @jrok1308. I'll get back to you soon.
### Answer Based on the documentation, when you click "Convert to Chat Agent" on an existing voice agent, it replaces your voice agent and converts it into a chat-only agent (Option B) [(1) ]() . The documentation states that during conversion, voice-specific functions like call transfers, DTMF (press digits) , and telephony features will be automatically removed . This means your phone system would stop working. To keep your production voice agent running while adding chat, you should instead create a new chat agent from scratch . The documentation provides two options: 1. Navigate to the Agents section → Click "Create New Agent" → Select "Chat Agent" 2. Or convert an existing voice agent (but this replaces it) Since you need both voice and chat capabilities, create a separate chat agent rather than converting your existing production voice agent. This way you'll end up with 2 agents: your original voice agent handling phone calls, plus a new chat agent for your website.
​ To learn more, see the sources I considered: [[1] Create chat agent](https://docs.retellai.com/build/create-chat-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
Hi Retell Support, I'm trying to create a Public Key for the chat widget but keep getting an error when adding my allowed domain. Setup Details: - Key Name: Q-Chat-Agent-Website-Key - Domain I'm trying to add: quinio-care-connect.lovable.app - This is a Lovable.app hosted website (published and live) - Agent Type: Chat Agent (Multi-Prompt) - Agent ID: agent_0e63af8edfb903d2b07c05a5ec What I've Tried: 1. Domain without protocol: quinio-care-connect.lovable.app (error) 2. Domain with https://: https://quinio-care-connect.lovable.app (error) 3. With wildcard: *.lovable.app (error) 4. Leaving field empty (error) Questions: 1. What is the exact format required for the Allowed Domains field? 2. Are there restrictions on lovable.app subdomains? 3. Do I need to verify domain ownership first? 4. Is there a way to create the key without adding domains initially? I need this key to embed the chat widget on my healthcare clinic's website. The site is live at https://quinio-care-connect.lovable.app Please provide the correct format or steps to resolve this. Thank you! @AI Evy
a
Thanks for the follow-up, @jrok1308. I'll get back to you soon.
### Answer Based on the Public Keys documentation, the correct format for allowed domains should be simple domain names without protocols [(1) ]() . The documentation provides examples like
example.com
and
app.example.com
. For your specific case, try: -
quinio-care-connect.lovable.app
(without The documentation confirms that domains are added in the Public Keys section by navigating to your Retell dashboard, clicking on the public key you want to configure, adding the domains where your public key can be used, and saving your changes . For testing purposes, the documentation also mentions that you can add
localhost
to your allowed domains list to enable development and testing on your local machine before deploying to production . If you're still experiencing errors with the standard domain format (
quinio-care-connect.lovable.app
) , I recommend reaching out to Retell support directly, as there may be platform-specific validation issues not covered in the documentation. You can visit [Contact Sales]() or check [) for additional support options. The documentation doesn't mention any restrictions on specific hosting platforms like lovable.app, domain verification requirements, or the ability to create keys without initially adding domains .
​ To learn more, see the sources I considered: [[1] Public Keys](https://docs.retellai.com/accounts/public-keys) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy I'm integrating a Retell Chat Agent into my website with a custom inline chat interface (not using the widget). I'm getting a 404 error when calling the API and need clarification on the correct implementation. MY SETUP: - Agent Type: Chat Agent - Agent ID: agent_0e63af8edfb903d2b07c05a5ec - Public Key: public_key_cdf60e2cdde4a83d743a4 - Secret API Key: I have it (key_xxxxx) - Backend: Supabase Edge Functions (Deno runtime) - Goal: Custom full-screen inline chat UI (not the floating widget) WHAT I'M TRYING TO DO: 1. Create a chat session programmatically from my backend 2. Send user messages to the agent 3. Receive agent responses 4. Display in custom React UI CURRENT ERRORS: - Getting 404 error when calling: POST /create-web-call - Getting 404 error when calling: POST /v2/create-web-chat - Edge function error: "Failed to create chat: 404" QUESTIONS I NEED ANSWERED: 1. CHAT SESSION CREATION: - What is the correct API endpoint to create a chat session for a Chat Agent? - Is it /create-web-call, /v2/create-web-chat, /create-chat, or something else? - What is the exact request format (headers, body)? - What does the response contain (session ID, access token)? 2. SENDING MESSAGES: - What is the correct endpoint to send user messages? - Is it /create-chat-completion or something else? - What parameters are required (chat_id, call_id, session_id)? - How do I reference the session created in step 1? 3. RECEIVING RESPONSES: - How do I get the agent's response after sending a message? - Is it synchronous (in the response) or async (webhook)? - What format is the response in? 4. WEBHOOKS: - My agent has n8n webhook configured - will it trigger automatically? - Do I need to do anything special to enable webhook calls? - Does the webhook get the full conversation context? 5. AUTHENTICATION: - Should I use the Secret API Key or Public Key for backend API calls? - Where does the Authorization header go? - Format: "Bearer key_xxxxx" or different? 6. CHAT VS VOICE AGENTS: - Are the API endpoints different for Chat Agents vs Voice Agents? - Can Chat Agents use the /create-web-call endpoint? - Is there a separate chat-specific API? 7. WIDGET VS CUSTOM IMPLEMENTATION: - Can Chat Agents be used without the widget? - If I must use the widget, can I customize it to be inline/full-screen? - Is there an SDK for programmatic chat agent access? 8. COMPLETE WORKING EXAMPLE: - Can you provide a complete code example showing: * Create chat session * Send message * Receive response - Preferably in JavaScript/TypeScript IDEAL SOLUTION: I want to build a custom chat UI where: - User clicks "Book Appointment" - Full-screen chat opens (not floating widget) - User types messages - Agent responds via my n8n backend - Custom styling and UX control Is this possible with Chat Agents? If not, what's the recommended approach? ADDITIONAL CONTEXT: - I'm building a healthcare appointment booking system - Agent needs to verify patient identity (name, DOB) via n8n - Patient data stored in PostgreSQL - HIPAA compliance required - Currently using the widget works, but need inline UI Please provide: 1. Correct API endpoints and formats 2. Complete implementation example 3. Any limitations I should know about 4. Best practices for custom chat implementations Thank you!
a
Thanks for the follow-up, @jrok1308. I'll get back to you soon.
### Answer --- ## Chat Session Creation The correct API endpoint to create a chat session for a Chat Agent is POST /create-chat [(1) ]() . This is the documented endpoint for creating chat sessions with Retell AI agents . Correct request format:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;

const chatResponse = await client.chat.create({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' }) ;
console.log(chatResponse.agent_id) ;
Response contains: - `chat_id`: Unique identifier for the chat session - `agent_id`: The agent handling the chat - `chat_status`: Current status (e.g., "ongoing") - `start_timestamp`: When the chat began - Additional fields like
retell_llm_dynamic_variables
,
metadata
, etc. The endpoints you tried (
/create-web-call
,
/v2/create-web-chat
) are not documented in the official API references . --- ## Authentication For backend API calls, you should use your Secret API Key (not the Public Key) . The authorization header format is:
Copy code
Authorization: Bearer YOUR_RETELL_API_KEY
Public Keys are designed for frontend use and are specifically required for the chat widget [(2) ]() , but backend programmatic API calls require the secret API key [(1) ]() . --- ## Sending Messages & Receiving Responses Based on the available documentation, the
/create-chat
endpoint creates a chat session , but the sources don't explicitly document: - A separate endpoint for sending individual messages after session creation - Whether responses are synchronous or webhook-based for programmatic chat implementations The documentation shows that chat sessions have a
message_with_tool_calls
array that contains the conversation history , and
transcript
field with the full conversation , but doesn't detail the message-by-message API flow for custom implementations. --- ## Webhooks According to the agent configuration documentation, you can set a
webhook_url
at the agent level [(3) ]() . When configured, this webhook will receive chat events . The
webhook_timeout_ms
parameter controls the timeout (default 10000ms) . --- ## Chat Widget vs Custom Implementation The Chat Widget was introduced in the June 2025 changelog [(2) ]() , and the documentation emphasizes that you can "embed a Retell Chat agent directly into your website or app" using a simple copy-paste embed script . However, the available sources don't provide detailed documentation for building a fully custom chat UI without using the widget or the Web SDK. The primary documented approach is the widget implementation . --- ## What's Missing from the Documentation I don't have information in the sources about: 1. A specific endpoint for sending individual messages after chat creation 2. How to receive streaming or r
eal-time responses in a custom implementation 3. Whether Chat Agents support the same programmatic message-sending API as voice agents 4. Complete examples of custom chat UI implementations without the widget --- ## Recommended Next Steps Since the documentation doesn't cover custom chat implementations in detail, here are potentially relevant sources to explore: - [Create Chat API Reference]() For your specific use case (custom inline chat UI with full control) , I'd recommend: 1. Contact Retell Support for guidance on custom chat implementations: - Visit [Contact Sales]() - Visit [) 2. Consider the Chat Widget with customization - while the sources don't detail inline/full-screen customization options, this may be possible through CSS or configuration not documented in the available sources. Would you like me to provide a general answer based on typical API patterns, or would you prefer to contact Retell support for the specific custom implementation details? --- **
​ To learn more, see the sources I considered: [[1] Create Chat](https://docs.retellai.com/api-references/create-chat) [[2] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[3] List Agents](https://docs.retellai.com/api-references/list-agents) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy Subject: Conversational Flow Agent - Function Configuration I'm building a Conversational Flow agent and need clarification on how to properly configure functions and variables: Questions: Where do I define functions in Conversational Flow agents? In Multi-Prompt agents, there's a global Functions section In my Conversational Flow agent's Global Settings, I don't see a Functions option Do I define functions in each individual Function Node on the canvas? Or is there a different location I'm missing? How do I call functions from Conversation Nodes? Can I call functions directly from conversation prompts using syntax like "CALL function_name"? Or must I use Function Nodes on the canvas? If using Function Nodes, how do I pass parameters from variables extracted in Conversation Nodes? How do Extract Variables work in Conversational Flow? Do I need Extract Variable nodes on the canvas? Or are variables automatically extracted when I reference them in conversation prompts (e.g., "Store in appointment_date variable")? How do I access extracted variables in transitions and subsequent nodes? What are the node types available and when to use each: Conversation Node (I understand this) Function Node (when to use? how to configure?) Extract Variable Node (when to use?) Logic Split Node (how is this different from transitions?) Transition configuration: Can I use variable-based conditions (e.g., appointment_date IS NOT NULL)? Or only phrase-matching (e.g., "assistant message contains 'X'")? What's the best practice for reliable state transitions? My use case: Healthcare appointment booking agent with functions for: check_availability (checks calendar) verify_patient_identity (checks database) schedule_appointment (creates calendar event) notify_booking_start (soft-locks slot) notify_booking_cancelled (releases lock) All functions call external webhooks (n8n workflows). Please provide documentation links or step-by-step guidance for Conversational Flow function configuration.
a
Thanks for the follow-up, @jrok1308. I'll get back to you soon.
### Answer ## Where to Define Functions in Conversational Flow In Conversational Flow agents, functions are not defined in Global Settings [(1) ]() . Instead, you add functions first, then select them inside individual Function Nodes on the canvas [(2) ]() . This approach allows you to reuse functions across multiple nodes without recreating them if you delete a node . ## How to Call Functions You cannot call functions directly from Conversation Nodes using syntax like "CALL function_name" . Conversation Nodes are specifically designed for dialogue and "will not call any functions or perform any actions" [(3) ]() . To execute functions, you must use Function Nodes on the canvas [(2) ]() . The function associated with a Function Node is called automatically when entering that node . ## How Extract Variables Work Variables are not automatically extracted when you reference them in conversation prompts [(3) ]() . You need dedicated Extract Dynamic Variable Nodes on the canvas [(4) ]() [(3) ]() . The Extract Dynamic Variable Node is "used to extract information from conversation and store them as dynamic variable" and "It's not intended for having a conversation with the user" [(4) ]() . You cannot extract variables inside Conversation Nodes [(5) ](
ls/1186424376300679209/1186462578310910112/1429479310925758515) [(3) ]() . To create a variable in an Extract Dynamic Variable Node, fill in [(4) ]() : - Variable Name – A short reference name - Description – What this value should be - Variable Type – Choose from Text, Number, Enum, or Boolean - Enum Options – Only when type is enum ## Node Types and When to Use Each **Conversation Node**: Handle dialogue and user interactions [(6) ]() **Function Node**: Execute custom functions and API calls [(6) ]() [(2) ]() . Use when you need to call external webhooks or APIs. The function executes when entering the node [(2) ]() . **Extract Dynamic Variable Node**: Extract and store dynamic variables from conversations [(6) ]() [(4) ]() . Use when you need to capture specific information like appointment dates or patient names. **Logic Split Node**: Create conditional branches based on variables [(6) ]() . This is different from transitions because it specifically evaluates variable conditions to route the conversation flow. ## Transition Configuration You can use both variable-based conditions and phrase-matching [(7) ]() . Equation conditions (evaluated first, top to bottom) :
Copy code
- {{appointment_date}} exists
- {{appointment_date}} does not exists
- {{user_age}} > 18
- {{current_time}} > 9 AND {{current_time}} < 18
Prompt conditions (evaluated after equation conditions) : - "User said something about booking a meeting" - "User said something about cancelling a meeting" Note: You can only use variables passed in as dynamic variables for equation conditions . For information extracted by the LLM during the call, use prompt conditions . ## For Your Healthcare Use Case For your appointment booking system with external webhook functions: 1. Add your functions first (check_availability, verify_patient_identity, etc.) before creating Function Nodes [(2) ]() 2. Use Extract Dynamic Variable Nodes to capture patient information like name, DOB, appointment date [(4) ]() 3. Use Function Nodes to call your n8n webhooks - the function executes automatically upon entering the node [(2) ]() 4. Use transition conditions with equation-based checks (e.g.,
{{patient_verified}} == true
) to route between nodes [(7) ]() 5. Connect nodes by clicking and holding the circle to draw connections between them [(6) ]() **
​ To learn more, see the sources I considered: [[1] Conversation Flow Overview](https://docs.retellai.com/build/conversation-flow/overview) [[2] Function Node Overview](https://docs.retellai.com/build/conversation-flow/function-node) [[3] Discord message from @renovia_70920 on 2025-10-30](https://discord.com/channels/1186424376300679209/1186462578310910112/1433525353967652947) [[4] Extract Dynamic Variable Node](https://docs.retellai.com/build/conversation-flow/extract-dv-node) [[5] Discord message from @q40478 on 2025-10-19](https://discord.com/channels/1186424376300679209/1186462578310910112/1429479310925758515) [[6] Node Overview](https://docs.retellai.com/build/conversation-flow/node) [[7] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
Thanks for the follow-up, @jrok1308. I'll get back to you soon.
### Answer I'm here to help! Could you please clarify what specific question you have about Retell AI? I'm ready to assist with topics like: - Multi-prompt agent configuration - Chat agent setup and widget embedding - Public key configuration and domain whitelisting - Conversational Flow agent design - Function calling and webhooks - API integration - Or any other Retell AI feature Just let me know what you need help with!
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
message has been deleted
j
Subject: Multi-Prompt State Transitions Not Working Reliably I have a 4-state Multi-Prompt healthcare booking agent. Transitions between states fail ~50% of the time - agent gets stuck and won't move forward. Current Setup: State 1: Greeting → State 2: Collect Details → State 3: Verify Patient → State 4: Execute Booking Edge Conditions: assistant message contains "specific phrase" + function results Edge conditions example: S1→S2: assistant message contains "When would you like to come in" S2→S3: check_availability returned available=true AND message contains "verify your information"
@AI Evy Subject: Multi-Prompt State Transitions Not Working Reliably I have a 4-state Multi-Prompt healthcare booking agent. Transitions between states fail ~50% of the time - agent gets stuck and won't move forward. Current Setup: State 1: Greeting → State 2: Collect Details → State 3: Verify Patient → State 4: Execute Booking Edge Conditions: assistant message contains "specific phrase" + function results Edge conditions example: S1→S2: assistant message contains "When would you like to come in" S2→S3: check_availability returned available=true AND message contains "verify your information" KEY QUESTIONS: How do edge conditions actually evaluate? Real-time during conversation or only at checkpoints? Does slight phrase variation break them? When are functions called vs transitions checked? Does function complete BEFORE edge condition checks? Can agent transition while function is running? Do variables persist across states? If I set appointment_date in State 2, can State 3 access it? Can I use variables in edge conditions? What makes transitions reliable? Should I use explicit trigger phrases like "TRANSITION_TO_STATE_3" instead of natural phrases? Should functions be called at end of state or middle? How do I debug stuck agents? Can I see edge condition evaluation in real-time? Any debug mode showing which conditions passed/failed? Best practices for production? How many states is too many? Should edge conditions check functions, phrases, or both? Are there known Multi-Prompt reliability issues? MY USE CASE: Healthcare booking with external webhooks (n8n), database verification, soft-locking to prevent double-bookings. Critical requirement: Agent MUST reliably move through all 4 states - State 2 fires notify_booking_start, State 3 fires notify_booking_cancelled if verification fails. WHAT I NEED: How to make Multi-Prompt state transitions 100% reliable Or should I rebuild in Conversational Flow? Documentation links for Multi-Prompt edge conditions Example of working 4-state agent with reliable transitions Thanks!
a
Thanks for the follow-up, @jrok1308. I'll get back to you soon.
### Answer Based on your reliability issues with Multi-Prompt state transitions, you should strongly consider switching to Conversation Flow for your healthcare booking use case [(1) ]() [(2) ]() . ## Why Multi-Prompt May Be Failing Multi-prompt agents experience behavioral drift and function calling issues as complexity increases [(1) ]() . The documentation explicitly states that you should "consider upgrading to multi-prompt when your single prompt exceeds 500 words or uses more than 3 functions" . With your 4-state agent using multiple external webhooks, you're hitting the complexity threshold where multi-prompt becomes unreliable . Community reports confirm this pattern - one user noted: "I tried a 400-line single-agent to multi prompt, and had challenges. It just felt quirky... Then just went to conversation flow as it is much easier to see the flow and debug" [(3) ]() . ## Conversation Flow Advantages for Your Use Case Conversation Flow provides [(1) ]() [(2) ]() : 1. Predictable Behavior - Each state has a clear, focused purpose [(1) ]() 2. Better Function Control - Tools available only when appropriate 3. Easier Debugging - Issues isolated to specific states 4. State-Specific Functions - Only relevant tools available in each state For your healthcare booking scenario with soft-locking
requirements, Conversation Flow's structured approach addresses the exact problems you're experiencing [(1) ]() [(2) ]() . ## Transition Mechanics in Conversation Flow In Conversation Flow, transitions use two types of conditions evaluated in a specific order [(4) ]() : Equation conditions (evaluated first, top to bottom) :
Prompt conditions (evaluated after equation conditions) : - "User said something about booking a meeting" - "User said something about cancelling a meeting" Variables do persist and can be used in equation-based transition conditions . This directly addresses your question about using
appointment_date
across states. ## Known Multi-Prompt Issues There's a documented incident where "Conversation Flow agent potentially stay silent after function node" when "a function and response is happening at same time" [(5) ]() . While this was specific to Conversation Flow and was resolved, it illustrates timing issues between function execution and state transitions that can affect reliability. Community reports show edge condition evaluation challenges in multi-prompt agents [(6) ]() [(7) ]() . Users found that explicit transition instructions in prompts helped, but didn't fully resolve reliability issues [(7) ]() . ## Recommendation For your production healthcare booking system requiring 100% reliability with external webhooks and soft-locking, rebuild in Conversation Flow [(1) ]() [(2) ]() . The structured node-based approach with explicit transition conditions will provide the predictability and debugging capabilities you need . Conversation Flow is specifically designed for "more difficult conversations while maintaining context throughout the flow" [(2) ](
locking-complex-interactions-with-retell-ais-conversation-flow) , which matches your 4-state booking workflow with database verification and webhook integration. **
​ To learn more, see the sources I considered: [[1] Single/Multi Prompt Agent Overview](https://docs.retellai.com/build/single-multi-prompt/prompt-overview) [[2] Retell AI’s Advanced Conversation Flow | Retell AI](https://www.retellai.com/blog/unlocking-complex-interactions-with-retell-ais-conversation-flow) [[3] Discord message from @jrok1308 on 2025-10-18](https://discord.com/channels/1186424376300679209/1186462578310910112/1429218557765484544) [[4] Step 3: Add transition conditions](https://docs.retellai.com/build/conversation-flow/transition-condition) [[5] Conversation Flow agent potentially stay silent after function node](https://retell.discourse.group/t/conversation-flow-agent-potentially-stay-silent-after-function-node/135) [[6] Multi prompt agent not always transitioning to the next state](https://discord.com/channels/1186424376300679209/1412769473227657329) [[7] Multi prompt agent not always transitioning to the next state](https://discord.com/channels/1186424376300679209/1303504848196472893) ​
Copy code
- {{appointment_date}} exists
- {{user_age}} > 18
- {{current_time}} > 9 AND {{current_time}} < 18
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
Subject: Where to Add Functions in Conversation Flow Agent? I'm building a Conversation Flow agent and need to configure custom functions that call external webhooks. My Question: Where exactly do I add/define functions BEFORE using them in Function Nodes? What I see: Left sidebar has a "Function" button that adds Function Nodes to canvas Global Settings panel (right side) has no "Functions" section When I add a Function Node to canvas, it asks me to "select a function" but I have nothing to select What I need: I have 6 custom functions with JSON schemas and webhook URLs. Where do I: Define the function name Add the JSON schema (parameters) Configure the webhook URL Save the function so it appears in Function Node dropdown Is there a separate "Functions" page/menu I'm missing? Please provide: Screenshot showing where to add functions Or step-by-step: "Click X → Go to Y → Add function" @AI Evy
a
Thanks for the follow-up, @jrok1308. I'll get back to you soon.
### Answer Based on the documentation, here's how to add custom functions in Conversation Flow: ## Where to Add Functions You need to add the function first, then select it inside the Function Node [(1) ]() . This approach ensures that if you delete the node, you don't need to re-create the function again . ## Step-by-Step: Creating a Custom Function When you're in the Function Node configuration, follow these steps to create a custom function [(2) ]() : 1. Configure function details - Add a name and description for the custom function - The name should be unique and separated with underscore - Example:
get_user_details
with description "Get user details based on name and age" 2. Select HTTP Method - Choose the HTTP method (GET, POST, PATCH, PUT, or DELETE) 3. Add endpoint URL - Add the URL where Retell will send the request to execute your custom function - This has to be a valid URL *4. Set request headers (optional) * - Define custom headers to include with the request - Header values can be static or include dynamic variables *5. Set query parameters (optional) * - Define query parameters to include in the request URL - Query parameter values can be static or include dynamic variables 6. Define parameters - Define the parameters for the custom function using JSON schema format or JSON form - Only available for POST, PATCH and PUT requests Example parameter schema :
Copy code
json
{
 "type": "object",
 "properties": {
 "city": {
 "type": "string",
 "description": "The city of the weather"
 }
 },
 "required": [
 "city"
 ]
}
*7. Set response variables (optional) * ## Important Notes - Functions in Conversation Flow work with all HTTP methods: GET, POST, PUT, PATCH, and DELETE - You can add custom headers and query parameters - The function associated with a Function Node will be called when entering that node [(1) ]() For your 6 custom functions with JSON schemas and webhook URLs, you'll create each one following this process, and they'll then appear in the Function Node dropdown for selection.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Function Node Overview](https://docs.retellai.com/build/conversation-flow/function-node) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
j
I have Retell MCP tools available. Can I use MCP to programmatically: 1. Create a Conversation Flow agent 2. Add nodes (Conversation, Function, Extract Variable, Logic Split) 3. Configure node prompts and settings 4. Define custom functions with JSON schemas 5. Connect transitions between nodes If yes, what MCP commands/endpoints are available for Conversation Flow automation? I want to build a 29-node healthcare booking agent and automate the setup instead of manual clicking. @AI Evy
a
Thanks for the follow-up, @jrok1308. I'll get back to you soon.
### Answer Yes, you can programmatically create and configure Conversation Flow agents using the Retell AI API [(1) ]() . The API provides endpoints to automate the setup of your 29-node healthcare booking agent. ## Creating a Conversation Flow Agent You can use the POST /create-conversation-flow endpoint to programmatically create a Conversation Flow agent . Here's the structure:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const conversationFlowResponse = await client.conversationFlow.create({
 model_choice: { model: 'gpt-5', type: 'cascading' },
 nodes: [
 {
 id: 'start',
 instruction: { text: 'Greet the customer and ask how you can help them.', type: 'prompt' },
 type: 'conversation',
 },
 ],
 start_speaker: 'agent',
}) ;
console.log(conversationFlowResponse.conversation_flow_id) ;
## What You Can Configure Programmatically Based on the API documentation, you can programmatically configure : 1. Nodes - All node types including Conversation, Function, Extract Variable, and Logic Split nodes [(1) ]() [(2) ]() 2. Node instructions - Using either
prompt
or
static sentence
types [(1) ]() 3. Custom functions - With JSON schemas, HTTP methods (GET, POST, PUT, PATCH, DELETE) , endpoint URLs, headers, and query parameters [(1) ]() [(3) ]() 4. Transitions - Via the
edges
array with transition conditions [(1) ]() 5. Tools - Custom functions with full configuration 6. Global settings - Including
global_prompt
,
model_temperature
,
tool_call_strict_mode
,
default_dynamic_variables
, and
knowledge_base_ids
## Example Request Body Structure The API accepts a comprehensive configuration object :
## MCP Integration Note While MCP tools are mentioned in the sources [(4) ]() [(5) ]() , the documentation shows that MCP tools can be configured within Conversation Flow agents through the
mcps
array in the API request [(1) ]() [(6) ]() . However, there are known issues with MCP response variables not being properly extracted in some scenarios [(4) ]() [(5) ]() . For your 29-node healthcare booking agent, the programmatic API approach using
/create-conversation-flow
is the recommended method to automate setup instead of manual clicking [(1) ]() . **
​ To learn more, see the sources I considered: [[1] Create Conversation Flow](https://docs.retellai.com/api-references/create-conversation-flow) [[2] Node Overview](https://docs.retellai.com/build/conversation-flow/node) [[3] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[4] mcp tool variables not extracted](https://discord.com/channels/1186424376300679209/1426340769924382791) [[5] Conversation Flow Agent - MCP Response Variables not working](https://discord.com/channels/1186424376300679209/1406261286270144564) [[6] Get Conversation Flow](https://docs.retellai.com/api-references/get-conversation-flow) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
Copy code
json
{
 "global_prompt": "You are a helpful customer service agent.",
 "tools": [
 {
 "type": "custom",
 "name": "get_customer_info",
 "description": "Get customer information from database",
 "tool_id": "tool_001",
 "url": "<https://api.example.com/customer%22,>
 "method": "GET"
 }
 ],
 "start_node_id": "start",
 "model_temperature": 0.7,
 "tool_call_strict_mode": true,
 "default_dynamic_variables": {
 "company_name": "Retell Inc",
 "support_hours": "9 AM - 5 PM"
 },
 "start_speaker": "agent",
 "model_choice": {
 "type": "cascading",
 "model": "gpt-5"
 },
 "nodes": [
 {
 "id": "start",
 "type": "conversation",
 "instruction": {
 "type": "prompt",
 "text": "Greet the customer and ask how you can help them."
 },
 "edges": [
 {
 "id": "edge_1",
 "transition_condition": {
 "type": "prompt",
 "prompt": "Customer wants to book appointment"
 },
 "destination_node_id": "book_appointment"
 }
 ]
 }
 ]
}