Ciaran
02/23/2026, 1:05 PMAI Evy
02/23/2026, 1:05 PMAI Evy
02/23/2026, 1:06 PMout_of_office variable from your inbound webhook and referencing it in your prompt using dynamic variable syntax.
1. Return the variable from your inbound webhook:
Your webhook response should nest dynamic variables under `call_inbound`:
[(1) ]() , [(2) ]()
json
{
"call_inbound": {
"dynamic_variables": {
"out_of_office": "true"
}
}
}
[(1) ]() , [(2) ]()
2. Reference it in your single prompt:
Use the {{out_of_office}} syntax in your agent's prompt with conditional instructions:
[(3) ]()
If {{out_of_office}} is "true", say: "Thank you for calling. Our office is currently closed. Please call back during business hours." Do not deviate from this message and end the call politely.
If {{out_of_office}} is "false", proceed with normal conversation...
Important notes:
- All dynamic variable values must be strings (e.g., "true" not true)
- If the variable isn't provided, it remains in raw form with curly braces intact
For more robust conditional routing, you might consider using Conversation Flow with equation-based transitions, which lets you set conditions like {{out_of_office}} = "true" to route to specific nodes without relying solely on prompt instructions.
[(4) ]()AI Evy
02/23/2026, 1:06 PMAI Evy
02/23/2026, 1:06 PMCiaran
02/23/2026, 1:33 PMAI Evy
02/23/2026, 1:33 PMAI Evy
02/23/2026, 1:33 PMintro variable for out-of-office messaging, here's a prompt structure you can use:
You are a helpful assistant for [Your Company Name].
{{intro}}
If {{intro}} appears with curly braces (meaning no custom intro was provided) , greet the caller with: "Hello, thank you for calling [Your Company Name]. How can I help you today?"
If {{out_of_office}} is "true":
- Deliver only the message in {{intro}}
- Do not engage in any other conversation
- Politely end the call after delivering the message
- Do not answer questions or provide additional information
If {{out_of_office}} is "false" or not set:
- Proceed with normal conversation
- [Add your regular agent instructions here]
[(1) ]()
Key points:
- The {{intro}} variable will be replaced with your custom message when provided
- You can check if a variable is unset by adding logic for when it "appears with curly braces"
- All dynamic variable values must be strings
You can also set a default value for {{intro}} at the agent level in the dashboard, which serves as a fallback when the variable isn't included in the call request.AI Evy
02/23/2026, 1:33 PMAI Evy
02/23/2026, 1:33 PMCiaran
02/23/2026, 1:37 PMAI Evy
02/23/2026, 1:37 PMAI Evy
02/23/2026, 1:38 PM{{intro}}
Then from your inbound webhook, pass the appropriate intro value based on office status:
- If out of office: "intro": "Thank you for calling. Our office is currently closed. Please call back during business hours. Goodbye."
- If in office: "intro": "Hello, thank you for calling [Company Name]. How can I help you today?"
This way the dynamic variable controls exactly what the agent says first.
In your prompt, you can then add:
If {{out_of_office}} is "true":
- Do not engage in any other conversation after the greeting
- Politely end the call immediately
- Do not answer questions
If {{out_of_office}} is "false":
- Proceed with normal conversation
[(2) ]()
Alternative: If you need more reliable conditional branching, Conversation Flow with equation-based transitions (e.g., {{out_of_office}} == "true") gives you deterministic control without relying on the LLM to interpret prompt instructions.
[(3) ]() , [(4) ]()AI Evy
02/23/2026, 1:38 PMAI Evy
02/23/2026, 1:38 PMCiaran
02/23/2026, 2:06 PMAI Evy
02/23/2026, 2:06 PMAI Evy
02/23/2026, 2:07 PMend_call) depends on the LLM to actually invoke it, and this isn't always 100% reliable. [(1) ]()
Here's how to improve your prompt structure for better results:
1. Use explicit conditional checking before every response:
## Response Guidelines
- Before every response, check if {{out_of_office}} is "true".
- If {{out_of_office}} == "true":
- Say exactly: "Hello, you've reached [AGENT] at [COMPANY NAME]. Thank you for your call! We're currently closed, our operating hours are Monday to Friday, from 9 AM to 6 PM. Please call us back during these hours, and we'll be happy to assist you."
- Immediately call the function: end_call
2. Consider your LLM choice and temperature:
Function calling reliability depends heavily on the LLM model. GPT-4.1 or GPT-4o tend to perform better for function calling. Using a lower temperature value (closer to 0, between 0.0-0.3) improves consistency and makes function calling more deterministic.
3. Make sure end_call is properly configured as a function:
The function needs to be added to your agent's function calling setup with a clear description so the LLM knows when to invoke it. [(2) ]()
If reliability remains an issue: Conversation Flow with equation-based transitions ({{out_of_office}} == "true") gives you deterministic control without relying on the LLM to interpret prompt instructions. [(3) ]()AI Evy
02/23/2026, 2:07 PMAI Evy
02/23/2026, 2:07 PMCiaran
02/23/2026, 2:20 PMAI Evy
02/23/2026, 2:20 PMAI Evy
02/23/2026, 2:21 PM{{intro}} variable with the appropriate message already set, plus a single {{should_end_call}} flag.
[(1) ]()
From your webhook, determine the priority and set variables accordingly:
json
{
"call_inbound": {
"dynamic_variables": {
"intro": "Merry Christmas! Our office is closed for the holidays...",
"should_end_call": "true"
}
}
}
In your prompt, use this structure:
[(2) ]()
## Response Guidelines
- Before every response, check if {{should_end_call}} is "true".
- If {{should_end_call}} == "true":
- The greeting in {{intro}} has already been spoken.
- Immediately call the function: end_call
- Do not respond to anything the user says.
- Do not generate additional responses.
- If {{should_end_call}} is "false" or appears with curly braces:
- Proceed with normal conversation.
- [Your regular agent instructions here]AI Evy
02/23/2026, 2:21 PMend_call still doesn't trigger reliably, Conversation Flow with equation-based transitions gives you deterministic control—you can create a node specifically for closed-hours that transitions based on {{should_end_call}} == "true" without relying on the LLM.
[(4) ]()AI Evy
02/23/2026, 2:21 PMAI Evy
02/23/2026, 2:21 PMCiaran
02/23/2026, 2:40 PMAI Evy
02/23/2026, 2:40 PMAI Evy
02/23/2026, 2:40 PMjson
{
"call_inbound": {
"dynamic_variables": {
"intro": "Merry Christmas! Our office is closed for the holidays. Please call back after December 26th.",
"should_end_call": "true"
}
}
}
2. Set your Begin Message field to:
{{intro}}
[(2) ]()
3. Use a sectional prompt with explicit response control:
[(1) ]()
## Identity
You are a phone assistant for [Company Name].
## Style Guardrails
Be concise: Keep responses under 2 sentences.
## Response Guidelines
- If {{should_end_call}} is "true":
- Do NOT say anything else after the greeting.
- Immediately call the function: end_call
- Do NOT respond to user input.
- Do NOT generate additional responses.
- If {{should_end_call}} is "false" or appears with curly braces:
- Proceed with normal conversation.AI Evy
02/23/2026, 2:40 PMintro message
[(3) ]() , [(2) ]()
- The Begin Message with {{intro}} ensures the exact text is spoken first
- Lower your model temperature (0.1-0.3) for more deterministic behavior
[(4) ]()
If the agent still deviates, Conversation Flow with equation-based transitions provides deterministic control without relying on the LLM to follow prompt instructions.
[(5) ]()AI Evy
02/23/2026, 2:40 PMAI Evy
02/23/2026, 2:40 PMCiaran
02/23/2026, 2:45 PM## Response Guidelines
- If {{should_end_call}} is "true":
- Do NOT say anything else after the greeting.
- Immediately call the function: end_call
- Do NOT respond to user input.
- Do NOT generate additional responses.
- If {{should_end_call}} is "false" or appears with curly braces:
- Proceed with normal conversation.
It should be something like... Say {{intro}} and then if {{should_end_call}} is "true" ...AI Evy
02/23/2026, 2:45 PMAI Evy
02/23/2026, 2:45 PM{{intro}}, that message is already spoken first. Your prompt doesn't need to instruct the agent to "say {{intro}}" again—it will have already been delivered.
[(1) ]()
Here's the adjusted prompt structure:
## Response Guidelines
- The greeting in {{intro}} has already been spoken as the Begin Message.
- Before every response, check if {{should_end_call}} is "true".
- If {{should_end_call}} == "true":
- Do NOT say anything else.
- Immediately call the function: end_call
- Do NOT respond to user input.
- Do NOT generate additional responses.
- If {{should_end_call}} is "false" or appears with curly braces:
- Proceed with normal conversation.
- [Your regular agent instructions here]
Why this works:
- The Begin Message field handles the initial {{intro}} delivery automatically
- The prompt then only needs to handle what happens after that message
- The LLM checks the {{should_end_call}} flag and either ends the call or continues normally
If you want the agent to explicitly say {{intro}} within the prompt itself (not using Begin Message) , you'd need to switch to Conversation Flow where you can have a dedicated node that speaks a specific message and then transitions based on equation conditions like {{should_end_call}} == "true".
[(2) ]()AI Evy
02/23/2026, 2:45 PMAI Evy
02/23/2026, 2:45 PMCiaran
02/23/2026, 2:46 PMAI Evy
02/23/2026, 2:46 PMAI Evy
02/23/2026, 2:46 PM{{intro}} directly in your prompt. Dynamic variables work in prompts using the {{variable_name}} syntax. [(1) ]()
If you're using a dynamic message (where the LLM generates its own opening) rather than a static Begin Message, you need to explicitly instruct the agent to say the intro in your prompt:
## Response Guidelines
- First, say exactly: {{intro}}
- After speaking the intro, check if {{should_end_call}} is "true".
- If {{should_end_call}} == "true":
- Immediately call the function: end_call
- Do NOT respond to user input.
- Do NOT generate additional responses.
- If {{should_end_call}} is "false" or appears with curly braces:
- Proceed with normal conversation.
, [(2) ]()
Important: When a dynamic variable has no assigned value, it remains in its raw form with curly braces intact. [(1) ]() You can add defensive logic:
If {{intro}} appears with curly braces, use a generic greeting instead.
Keep in mind that function calling reliability depends on the LLM model—GPT-4.1 tends to perform better for these cases. Using a lower temperature (0.0-0.3) also improves consistency. [(2) ]()AI Evy
02/23/2026, 2:46 PMAI Evy
02/23/2026, 2:47 PMCiaran
02/23/2026, 2:49 PMAI Evy
02/23/2026, 2:49 PMAI Evy
02/23/2026, 2:49 PM{{intro}} is generally the better approach for your use case. Here's why:
Custom Begin Message with `{{intro}}`:
- The message is spoken immediately and exactly as you set it from your webhook
[(1) ]()
- No LLM interpretation or generation involved for the opening line
- More deterministic and reliable behavior
[(2) ]()
Dynamic message with prompt instructions:
- The LLM generates its own opening, which introduces variability
- You're relying on the LLM to follow your prompt instruction to "say exactly {{intro}}"
- More prone to the agent "going rogue" as you've experienced
[(3) ]()
Recommendation: Set your Begin Message to {{intro}} and handle all the conditional logic (christmas, new_years_day, out_of_office, else) in your inbound webhook. Pass the exact message you want spoken as the intro value, plus a should_end_call flag. This way:
[(1) ]()
1. The exact greeting is spoken first without LLM interpretation
2. Your prompt only needs to handle the end_call logic afterward
Dynamic variables work in the Begin Message field.
[(2) ]()AI Evy
02/23/2026, 2:49 PMAI Evy
02/23/2026, 2:49 PMCiaran
02/23/2026, 3:42 PMAI Evy
02/23/2026, 3:42 PMAI Evy
02/23/2026, 3:42 PM{{out_of_office}} == "true") without relying on the LLM to interpret prompt instructions
- Single Prompt handles your regular conversation logic once you've confirmed it's a normal business hours call
This approach minimizes hallucinations for the conditional logic since Conversation Flow uses predefined pathways rather than LLM interpretation.
Your flow would look something like:
1. Entry node checks {{christmas}}, {{new_years_day}}, {{out_of_office}} variables
[(2) ]()
2. If any are "true" → route to appropriate closed-hours node with the specific message, then end call
[(1) ]()
3. If none are true → transfer to your single prompt agent for normal conversation
Glad you found a solution that works! 🙂AI Evy
02/23/2026, 3:42 PMAI Evy
02/23/2026, 3:42 PMCiaran
02/27/2026, 9:32 AMAI Evy
02/27/2026, 9:32 AMAI Evy
02/27/2026, 9:32 AM{{user_id}} or name collection before proceeding, but there's no escape path for callers who just want general information without identifying themselves.
Solutions:
1. Add an "else" or fallback transition — Create a transition condition like "User asks a general question" or "User declines to provide information" that routes to a general FAQ node instead of looping back to ask for their name again.
2. Make nodes smaller with clearer transitions — When nodes have too much content or complex logic, they're more likely to loop. Try splitting the identification flow into separate, simpler nodes. [(1) ]()
3. Add transition fine-tune examples — If the node isn't transitioning when it should, add fine-tune examples showing when the agent should move to the next node vs. when to stay. [(3) ]()
4. Use a Logic Split node with an "else" condition — After checking {{user_id}}, add a split that includes an explicit "else" path for users who don't want to identify. [(2) ]()
Example structure:
- Node 1: Check {{user_id}} exists → if yes, proceed; if no, ask for name
- Node 2: Ask for name → transition on "User provides name" OR "User asks general question without identifying"
- Node 3: General FAQ node for unidentified callers
The key is ensuring every node has a valid exit path for all possible uAI Evy
02/27/2026, 9:32 AMAI Evy
02/27/2026, 9:32 AMAI Evy
02/27/2026, 9:32 AMCiaran
02/27/2026, 9:36 AMAI Evy
02/27/2026, 9:36 AMAI Evy
02/27/2026, 9:36 AMAI Evy
02/27/2026, 9:36 AMAI Evy
02/27/2026, 9:36 AMCiaran
02/27/2026, 11:24 AMAI Evy
02/27/2026, 11:24 AMAI Evy
02/27/2026, 11:25 AMAI Evy
02/27/2026, 11:25 AMIf {{user_id}} appears with curly braces, the variable is not set.
Otherwise, the user has been identified.
For Conversation Flow (using Equations) , you can check:
Equation: {{user_id}} exists
Result: True if variable is set
Practical example for your single prompt:
## Response Guidelines
- If {{user_id}} appears with curly braces (meaning the variable is unset) :
- Ask for the caller's name
- Ask if they're calling on behalf of a pharmacy
- If the user asks "how does it work" at any point:
- Provide the explanation
- Then return to collecting their information if {{user_id}} is still unset
- If {{user_id}} has a value (no curly braces) :
- Proceed with the identified user flow
, [(2) ]()
The key limitation is that in a single prompt, you're relying on the LLM to interpret these conditions correctly—it's not deterministic like Conversation Flow's equation-based transitions.
[(3) ]()AI Evy
02/27/2026, 11:25 AMAI Evy
02/27/2026, 11:47 AMCiaran
02/27/2026, 11:47 AMAI Evy
02/27/2026, 11:47 AMuser_name, phone_number)
- Description – A brief explanation of what this value should be
- Variable Type – Choose from Text, Number, Enum, or Boolean
- Enum Options – Options to choose from (only when type is enum)
Variable Types available:
- Text - Any word or sentence (e.g., "headache", "John Smith")
- Number - A numeric value (e.g., 42, 98.6)
- Enum - A value from a predefined list (e.g., "Yes", "No", "Maybe")
- Boolean - True or false
3. Save the Extract Dynamic Variable Tool
Click the save button.
4. Update your prompt to instruct when to extract
Add explicit instructions in your prompt for when to invoke the extraction. For example:
When user states his name and phone number, please extract the information by calling the `extract_user_details` function.
Example for your use case:
You could create variables like:
- caller_name (Text) - "The name of the person calling"
- is_pharmacy (Boolean) - "Whether the caller is calling on behalf of a pharmacy"
Then in your prompt:
When the user provides their name, extract it using the extract_user_details function.
When the user confirms whether they are calling for a pharmacy, extract that information as well.AI Evy
02/27/2026, 11:47 AMAI Evy
02/27/2026, 11:47 AM