Get variable over to transferred agent

I have to make sure that a variable I’m passing to a call agent makes it over to any agent it transfers to. Is this possible, or does it work like this by default?

Based on the available documentation, the behavior depends on which type of transfer you’re using:

For Agent Transfer (agent-to-agent swap within Retell):

When using Agent Transfer, the destination agent has access to the full conversation history(1). This means context from the first agent is preserved, but the documentation doesn’t explicitly state that dynamic variables are automatically passed to the transferred agent(1).

A community member asked specifically about passing dynamic variables during agent transfer, stating: “Is there a pass to pass dynamic variables in an agent transfer? I’d like agent 1 to collect info from the caller to personalize agent 2.”(2) However, no definitive answer was provided in the available sources.

For Call Transfer (phone-based transfer):

When using the Transfer Call tool or node, you can use dynamic variables in the transfer destination phone number(3)(4). The documentation shows that the transfer number can be set to a dynamic variable that gets substituted at runtime(3)(4).

However, there’s no explicit documentation about passing custom dynamic variables to an agent bound to the destination number during a call transfer.

Recommendation:

I don’t have complete information from the sources about automatically passing custom dynamic variables between agents during transfers. You may want to:

Would you like a general answer based on my knowledge instead?

Will the FROM agent supply the info in the variable if I include this request in the agent prompt?

This is for an AGENT transfer, by the way. Is there any way I can get confirmation, that the “full conversation history” includes dynamic variables?

We had the same questions and needs, dynamic variables do get transferred on agent transfer (at least on the single prompt flow)

How to test:

Define a single prompt Agent A and add a variable like {{ test }} with a default value → setup transfer to Agent B and to the Agent B just add {{ test }} in the prompt. Use the chat feature to test transfer + variable’s value retrieval.

Note: To avoid confusion for Agent A to accidentally start speaking information about {{ test }} just avoid mentioning the variable in Agent A’s prompt.

We also tested the same for KB’s and it doesn’t work for KBs.

Hope this helps.