Call Flow Variables
Call flow steps support variable substitution using Mustache syntax — wrap a variable name in double curly braces (e.g., {{call.caller}}) and Revenue.io replaces it with the actual value at the time the step executes.
Variables can be used in:
- Greeting and Voicemail Text-to-Speech messages
- SMS message body text
- Callout Apex Input fields
- Branch evaluation variable fields
- Prompt Save Response key (to name what you capture, then reference it later)
- Task Subject and Task Comments fields on Dial steps
System variables
These variables are automatically available in every call flow. Revenue.io populates them at the start of each call.
| Variable | Description |
|---|---|
{{call.caller}} / {{call.from}} | The caller’s phone number (E.164 format, e.g., +14155551234) |
{{call.to}} | The Revenue.io Smart Number the caller dialed |
{{call.fromAreaCode}} | The US area code extracted from the caller’s phone number (e.g., 415) |
{{call.fromCountryCode}} | The international country code from the caller’s phone number (e.g., 1 for US/Canada, 44 for UK) |
{{call.callKey}} | A unique ID generated by Revenue.io for each call — useful for correlating logs |
{{owner_id}} | The Salesforce User ID of the matched call owner. Only populated when the call has been matched to an owner. Useful for passing to a Callout step or including in an SMS body. |
Queue variables
These variables are populated dynamically based on the queue the call is being routed to. They are only meaningful when used in a Greeting step placed immediately before a Dial step to a queue — no other steps between them.
| Variable | Description |
|---|---|
{{queue_average_wait_time}} | Estimated wait time in minutes. Calculated as: (current calls in queue × avg call duration over the past 7 days) ÷ (agents currently available) |
{{queue_size}} | Number of callers currently waiting in the queue |
Example greeting: “Your wait time is approximately {{queue_average_wait_time}} minutes. There are {{queue_size}} callers ahead of you.”
Callout output variables
When a Callout step runs, the Apex class returns a Map<String, String>. Revenue.io stores the map under the Saved Output name you configure on the step. Individual keys within the map are accessed using dot notation:
{{savedOutputName.keyName}}Example: If your Callout’s Saved Output is named routingResult and your Apex class returns response.put('territory', 'West'), the value is available as {{routingResult.territory}}.
Callout output variables are available to all subsequent steps in the flow — Branch, Dial, SMS, Greeting, and so on.
Linking the Salesforce Task to a record ($whatId):
If your Apex class includes a key named $whatId in its response map, Revenue.io automatically sets the WhatId field on the resulting Salesforce Task — linking the call activity to the specified record (Account, Opportunity, Case, etc.)
response.put('$whatId', '0060000000XXXXX'); // links the Task to this Salesforce record IDNo additional step configuration is required. The $whatId key is consumed by Revenue.io which populates the “Related To” (WhatID) field after the call has concluded.
Saved prompt response variables
The Prompt step can capture whatever the caller enters and store it as a named variable for use in later steps. This is configured via the Save Response field on the step — enter a key name and Revenue.io saves the caller’s input under that name.
Reference the saved value in any subsequent step using Mustache syntax:
{{keyName}}Example — member ID routing:
- A Prompt step asks the caller to enter their Member ID. Save Response is set to
memberId. - A Callout step passes
{{memberId}}as an Apex Input to look up the caller’s account in Salesforce. - A Branch step evaluates the returned account tier and routes accordingly.
Saved prompt variables are available to all steps that follow the Prompt step in the flow. They are not available to steps that precede it.
Loop variables
When a Loop step runs, the Current Item Name you configure becomes a variable containing the current list element for that iteration. Reference it in the child step using Mustache syntax.
Example: If Current Item Name is currentAgentId, the child Dial step can reference {{currentAgentId}} to dial the agent dynamically.
Tips
- Variable names are case-sensitive.
{{call.caller}}and{{call.Caller}}are different. - If a variable has no value at execution time (e.g., the caller has no area code), the variable resolves to an empty string. Build No Value branches in your Branch steps to handle this case gracefully.