Skip to navigation

Variables

Use dynamic data in prompts, actions, and transfers

All Variables drawer open from the Variables button in the agent editor header, listing system variables and pre-call variables

Variables are placeholders that let your agent work with dynamic data in prompts, actions, call transfers, SIP headers, and webhook payloads. In prompts, system and pre-call variables use curly braces, for example {call_id}, and action results use angle brackets, for example <get_order.results.data.status>. Action fields, such as a custom action’s URL or request body, use angle brackets for every variable, for example <call_id>.

Synthflow supports four types of variables:

TypeWhen availableHow it’s created
System variablesEvery call, automaticallyProvided by Synthflow
Pre-call variablesBefore the conversation startsPassed into the agent before the conversation starts
Collected variablesDuring and after the conversationGathered from the user during the conversation
Action result variablesAfter a Custom Action runsReturned from an external API response

Select Variables in the agent editor header to open the All Variables drawer. It lists every variable available to the agent, grouped by type, with a search bar to find one quickly.

To see the value each variable had on a specific call, open the call’s Variables tab in Call logs.

System variables

System variables are built-in values that Synthflow populates automatically for every call. You do not need to define them.

VariableDescription
call_idUnique identifier for the current call session.
user_phone_numberFor inbound calls, the caller’s number. For outbound calls, the recipient’s number.
from_phone_numberThe number the call came from. For inbound calls, the caller’s number. For outbound calls, the number your agent called from.
to_phone_numberThe number the call went to. For inbound calls, the number that was dialed (a number you own). For outbound calls, the recipient’s number.
agent_current_timeThe current time in the agent’s timezone, as ISO 8601 with a UTC offset.

Example

Pass system variables in a custom action request body to identify the call in an external system. In the request body, type < to pick one from the list:

{
"id": "<call_id>",
"customer": "<user_phone_number>",
"from": "<from_phone_number>",
"to": "<to_phone_number>"
}

You can also reference system variables in prompts:

The caller's phone number is {user_phone_number}.

Pre-call variables

Pre-call variables, also called custom variables, are values you pass into the agent before the conversation starts. They inject external context without requiring the agent to collect it during the conversation.

Use pre-call variables to personalize conversations with user details, CRM data, campaign context, account status, or other backend data.

How to use pre-call variables

  1. Identify the data you want to inject (for example, a company name or user role).
  2. Pass it when you make a call, or return it from the inbound webhook for inbound calls.
  3. Reference the values in prompts, actions, transfers, SIP headers, or webhook payloads.
{
"custom_variables": {
"Company": "Synthflow",
"Role": "Sales Specialist"
}
}

For API-specific details, see Dynamic prompt injection.

Collected variables

Collected variables are values gathered from the user during the conversation after the user provides the requested information.

Use collected variables when the agent needs to remember information for later steps, such as a caller’s name, email address, appointment date, issue type, or transfer reason.

How they work

  1. The agent asks for specific information.
  2. The user provides the response.
  3. Synthflow stores the response as a variable, for example {user_email} or {appointment_date}.
  4. The variable can be used later in prompts, Branch nodes, Custom Actions, transfers, SIP headers, and webhooks.

In Flow Designer, Conversation nodes are the primary way to define collected variables. You can also use the Variables drawer to view available variables, see where they are used, and navigate back to their source.

Post-call webhook payload

Post-call webhooks include collected values in the collected_variables field when they are available. Only variables with collected: true are included.

{
"collected_variables": {
"user_name": {
"value": "Julian",
"collected": true
},
"appointment_date": {
"value": "2025-10-28",
"collected": true
}
}
}

For the full payload shape, see Post-Call Webhook.

Action result variables

Action result variables hold fields from a custom action’s response. You choose them under Output Variables when you initialize the action, and the agent can use them later in the call.

How they work

  1. A custom action sends its request.
  2. Your API returns a response.
  3. Synthflow stores each field you selected under Output Variables.
  4. You reference the stored fields in the prompt, or pass them to another action.

Each result is named after the action and the field’s path in the response. If an action named get_order returns {"status": "shipped"}, the result is get_order.results.data.status.

In-call messaging replies

In-Call Messaging actions populate a dedicated reply variable when the customer responds by text:

VariablePopulated by
sms_replyA reply to an in-call SMS action.
whatsapp_replyA reply to an in-call WhatsApp action.

The variable is set as soon as the reply arrives, whether the action was configured to block the agent until then or to let the call continue in the background. If no reply arrives before the call ends, the variable remains empty.

Variables in prompts

The Prompt editor inserts each kind of reference with its own character, or with the matching button in the prompt toolbar:

TypeButtonInserts
{Pre-call variablesA pre-call variable, such as {customer_name}. System variables use the same braces, such as {user_phone_number}.
<Action resultsA field from an action’s output, such as <get_order.results.data.status>.
#ActionsAn action attached to the agent, so the prompt can say when to run it.

Action results list in the prompt editor

Select Variables in the agent editor header to see every variable the prompt can use, grouped into System Variables, Pre-Call Variables, and Action Results.

Action placeholders and mapping

Several actions let you embed placeholders with angle-bracket names, for example <customer_name> or <queue_ref>, in specific configuration fields such as the SMS message body, call transfer targets or SIP headers, or the lead_email input on real-time booking. Each distinct name becomes an input variable on that action.

On custom actions, placeholders go in the URL, the headers, and the request body. A system variable name, such as <call_id>, is filled in automatically and does not become an input variable.

After you attach the action to an agent, you choose where each input variable gets its value.

Choose how an input variable gets its value

In the agent editor, select the attached action to open its panel. Under Input Variables, choose a source for each variable:

Input variable mapping source options

SourceUse it when
Collect by AgentThe agent should ask the caller for the value. Describe in the text box how to collect it.
Action OutputA previous action returns the value.
SystemThe value comes from a system variable, such as call_id.
Pre-Call VariablesThe value is passed into the agent before the conversation starts.
Fixed ValueThe value is the same on every call.
Collected VariablesFlow Designer agents only. The value was collected earlier in the flow.

To set the sources through the API, use Attach an action.

Field-by-field setup lives in each action guide:

Mapping limits

  • A Fixed Value is always sent as text.
  • A value that is not available when the action runs is sent as the placeholder text, such as <customer_id>, and the action runs without an error.
  • Action Output refers to the other action by its name. Renaming that action breaks the mapping.

Where to use variables

Angle-bracket placeholders on supported actions are covered in Action placeholders and mapping. Variables can also be referenced in several other places across your agent configuration:

  • Prompts: Personalize your agent’s behavior, for example "Hi {lead_name}, thanks for calling {company_name}.".
  • Custom Actions: Pass variables in API parameters or body fields on Custom Actions, shape JSON with placeholders, and reuse response fields in later steps.
  • Real-Time Booking: When you attach real-time booking, define variables so details the caller gives you, like <user_name> or <user_email>, flow into the booking request.
  • Call Transfers: On call transfers, define variables to capture context like <caller_name> or <issue_type> for whispers, summaries, or SIP headers.
  • Post-call SMS: On Post-call SMS, define variables to personalize templates, for example "Hi <customer_name>, your appointment is confirmed for <appointment_date>.".
  • Webhooks: Reference variables when configuring webhook payloads.
  • Flow Designer nodes: Use variables in Conversation, Message, Branch, and Custom Action nodes in the Flow Designer.
  • SIP headers: Pass system variables in SIP X-headers for telephony integrations, as described in Pass call context.

FAQ

Yes. System variables, pre-call variables, collected variables, and action result variables are available in both Flow Designer and Prompt Builder agents.

Yes, through the inbound webhook. An inbound agent does not know who is calling before the call starts, so you cannot pass custom_variables up front as you do for outbound calls. Your webhook endpoint receives the caller’s number and returns custom_variables for that call. To fetch context during the call instead, use a custom action.