Passing Variables to be used in the Message to Ope...
# support
j
Anyone know if i can pass the assistantOverrides and variableValues from the assitant to the transferCall tool? I want to use the name variable i am passing to the assistant in the transferCall tool. I am using warm transfer - experimental mode, and want to use the variables in the Message to Operator to tell the operator who they are going to be speaking to I want to use a Message to Operator like this: Hi, {{title}} {{firstName}} {{lastName}} is interested in a quote. I am connecting you both now. The Assistant has those variables but they don't get passed to the transferCall tool so the agent does not say the variables. Not sure how to get them from the assistant to the tool - or is it not possible within the UI and only by invoking the tool via the api?
v
Thank you for your detailed question! Based on the documentation, dynamic variables like
{{name}}
can be set via
assistantOverrides.variableValues
in API requests, but setting or referencing these variables directly in the UI for the transferCall tool's operator message is not clearly supported. The API provides more flexibility for passing and using such variables. To clarify: Are you currently triggering the transferCall action entirely through the Vapi dashboard UI, or are you able to use the API/SDK for more advanced variable handling? This will help determine if a workaround or API-based solution is possible for your use case. Sources: - [Vapi Dynamic Variables Documentation](https://docs.vapi.ai/assistants/dynamic-variables) - [Vapi Call Forwarding & Warm Transfer](https://docs.vapi.ai/call-forwarding)
j
@User @User I am currently only using the UI but could use the API if via the UI is not possible
u
Same issue
c
This option uses the transfer assistant’s access to the full conversation history to automatically extract variables (name, title, reason, etc.) and generate the operator introduction. Instead of manually passing variables or using a webhook, you let the LLM read the transcript and craft the message itself. This works by enabling
contextEngineeringPlan: "all"
and setting the transfer assistant to generate the first message automatically. --- Configuration Example
Copy code
json
{
  "type": "transferCall",
  "destinations": [
    {
      "type": "number",
      "number": "+14155551234",
      "transferPlan": {
        "mode": "warm-transfer-experimental",
        "contextEngineeringPlan": {
          "type": "all"
        },
        "transferAssistant": {
          "firstMessageMode": "assistant-speaks-first-with-model-generated-message",
          "model": {
            "provider": "openai",
            "model": "gpt-4o",
            "messages": [
              {
                "role": "system",
                "content": "You are a transfer assistant. Use the full conversation history to introduce the caller to the agent. Include their title, full name, and purpose of the call. Example: 'Hi, Mr. John Smith is interested in a quote. I'm connecting you now.' Keep it brief and professional."
              }
            ]
          }
        }
      }
    }
  ]
}
---
u
ok but lets say i have a customer id number that i want to give to the warm transfer operator that is not said in the conversation but is passed as a variable in the assistantOverrides. This ID is not used in the conversation (10 digit number) - how can i get this to the operator?
ok but lets say i have a customer id number that i want to give to the warm transfer operator that is not said in the conversation but is passed as a variable in the assistantOverrides. This ID is not used in the conversation (10 digit number) - how can i get this to the operator? @Kyle
c
Hi James, Short answer: yes, this is possible, but the variable must be passed into the warm transfer assistant itself, not directly into the
transferCall
tool UI. With
warm-transfer-experimental
, the transfer assistant has its own model and prompt, and that’s where you reference variables like a customer ID. As long as
assistantOverrides.variableValues.customerId
is set when the call is created, the transfer assistant can use it. Here’s a minimal example to illustrate the pattern:
Copy code
{
  "type": "transferCall",
  "destinations": [
    {
      "type": "number",
      "number": "+1234567890",
      "transferPlan": {
        "mode": "warm-transfer-experimental",
        "transferAssistant": {
          "model": {
            "provider": "openai",
            "model": "gpt-4o",
            "messages": [
              {
                "role": "system",
                "content": "You are a transfer assistant. The customer ID for this call is {{customerId}}. When the operator answers, say: 'Hello, I have customer ID {{customerId}} on the line.'"
              }
            ]
          }
        }
      }
    }
  ]
}
Key point: -
{{customerId}}
must be provided via
assistantOverrides.variableValues
when starting the call - The transfer assistant prompt is where that variable is consumed and spoken to the operator
h
I dont think this is correct, as he stated he did provide variables via assistantOverrides.variableValues when starting the call. the transfer assistant seems to only have the call transcript, in order for it to recite the customers number i needed to have the initial agent verify the number in the call before transferring. {{customer.number}} does not work. Also it seems callerId does not work like in the other transfer tools, it is stuck on assistant number for outbound call transfers
c
We did some testing with
warm-transfer-experimental
and found this information: Only the raw transcript or message history is not passed to the operator. The operator will receive **one of the following only**: • A spoken summary (if
summaryPlan
is enabled), or • A custom spoken message (if
transferPlan.message
is set), or • The default greeting If you need the operator to have more context, the supported options are: • Enable
summaryPlan
to generate a more comprehensive summary, or • For SIP integrations, pass a summary via SIP headers using
blind-transfer-add-summary-to-sip-header
Regarding callerId with
warm-transfer-experimental
— we’re still investigating this behavior. Please share a call ID where you’re seeing the issue and we’ll take a closer look on our side.
h
passed to the operator is not what we are talking about. In the warm-transfer-experimental transfer tool there is a transfer assistant, who talks to the operator. The transfer assistant is generated by the prompt in the warm-transfer-experimental transfer tool. Currently the transfer assistant can not read variables passed in assistantOverrides.variableValues, it only has a transcript from the call with the main assistant. I spoke with support in an email and they said they where working on a fix for this.
c
apologies for the confusion. by operator we were referring to the transfer assistant. if you pass {{messages}} it will include messages from all roles: system, bot, user, tool_call, tool_call_result. if you include the
assistantOverride.variableValues
in the system prompt, it will appear in {{messages}}, and therefore will be passed to the transfer assistant if you provide it the {{messages}} variable.
h
I appreciate the responses, in the warm transfer documentation they use the word operator for the person answering the transferred call. " if you include the assistantOverride.variableValues in the system prompt" are you talking about the system prompt for the call? meaning when the call is created? From my discussions with support the warm transfer assistant can not get variables included in assistantOverride.variableValues The Warm transfer assistant is created by the transfer tool itself, inside "destinations" They said they are working on a way to include variables in the warm transfer assistant, do you know if they have patched this in yet?
Copy code
"destinations": [
    {
      "type": "number",
      "number": "+15555555555",
      "callerId": "",
      "description": "transfer destination for builders",
      "transferPlan": {
        "mode": "warm-transfer-experimental",
        "sipVerb": "refer",
        "transferAssistant": {
          "model": {
            "model": "gpt-4o",
            "messages": [
              {
                "role": "system",
                "content": "## Purpose. This is the prompt for the warm transfer assistant, and variables do not work here, but you can instruct it to get info from the call transcript and repeat it."
              }
            ],
            "provider": "openai"
          },
          "firstMessageMode": "assistant-waits-for-user",
          "maxDurationSeconds": 120,
          "silenceTimeoutSeconds": 30
        }
      }
    }