Documentation

IVR actions reference

Every ivr_* action: required parameters, optional fields, and what each one returns.

Each IVR action is a class extending BaseAction from automation/abstracts. They share the same execution shape: validate(config) → execute(context) → ActionResultresult.data.twiml is the rendered TwiML, result.nextStepId advances the flow (or stays null while the action waits for caller input).

Source folder: appengine/src/automation/actions/ivr/.

ivr_speak

Reads a text-to-speech message to the caller.

{
  "actionType": "ivr_speak",
  "config": {
    "message": "Hello {{caller}}, welcome to Acme.",
    "voice": "Polly.Joanna-Neural",
    "language": "en-US",
    "nextStepId": "menu"
  }
}
FieldTypeDescription
message*string

TTS text. Max 4096 characters. Supports {{variable}} interpolation.

voicestring

Twilio voice id. Defaults to Polly.Joanna. See the README for the full Polly / Google list.

languagestring

BCP-47 tag. Defaults to en-US.

nextStepIdstring

Step to run next. If omitted, the call ends after the message.

ivr_collect_input

Gathers DTMF digits or speech.

{
  "actionType": "ivr_collect_input",
  "config": {
    "prompt": "Please enter your 5-digit account number.",
    "inputType": "dtmf",
    "numDigits": 5,
    "timeout": 8,
    "saveAs": "accountNumber",
    "nextStepId": "lookup",
    "onTimeout": "voicemail"
  }
}
FieldTypeDescription
prompt*string

What the caller hears before the prompt opens.

inputTypestring

dtmf (default) | speech | dtmf speech.

numDigits*number

Required for dtmf input.

timeoutnumber

Seconds to wait before triggering onTimeout. Defaults to 5.

saveAs*string

Variable name for the captured value.

nextStepIdstring

Step to run after capture.

onTimeoutstring

Step to run on timeout. If omitted, the call ends.

ivr_menu

Plays a menu and routes by digit.

{
  "actionType": "ivr_menu",
  "config": {
    "greeting": "For sales press 1, for support press 2.",
    "saveAs": "selection",
    "options": [
      { "digit": "1", "label": "sales",   "nextStepId": "sales" },
      { "digit": "2", "label": "support", "nextStepId": "support" }
    ],
    "timeout": 5,
    "onTimeout": "voicemail"
  }
}
FieldTypeDescription
greeting*string

Menu prompt. Each option's Press {digit} for {label} is appended automatically.

options*array

At least one option. Each: { digit, label, nextStepId, speechKeywords?, announcement? }.

saveAs*string

Variable that captures the chosen digit.

timeoutnumberSeconds. Default 5.
onTimeoutstringStep to run on timeout.

ivr_transfer

Hand off to a phone, agent, or queue.

{
  "actionType": "ivr_transfer",
  "config": {
    "transferType": "phone",
    "to": "+14155550100",
    "record": true,
    "announcement": "Connecting you now."
  }
}
FieldTypeDescription
to*string

Destination — phone number, queue name, or agent client identity.

transferTypestring

phone (default) | agent | queue.

agentIdentitystring

Required when transferType: 'agent'. The Twilio Client identity to dial (user:email).

queueNamestring

Used with transferType: 'queue'. Defaults to general.

recordboolean

Record the call leg. Defaults to true.

announcementstring

Played to the caller before the dial.

Transfer ends the flow — nextStepId is ignored.

ivr_forward

Ring multiple targets. More flexible than ivr_transfer for ring groups.

FieldTypeDescription
targets*array

List of { type: 'phone'|'agent'|'queue'|'sip', value: string, label?: string }.

ringModestring

simultaneous (default) | sequential.

ringDurationnumberSeconds per attempt. Default 20.
callerIdstringOverride the caller ID shown to ringing devices.
whisperEnabledbooleanPlay whisperMessage to the answering target before bridging.
screeningEnabledbooleanRequire keypress to accept the call.
greetingstringPlayed to the caller before ringing starts.
fallbackstringvoicemail | ai-assistant | automation | hangup. Used when no one answers.

ivr_record

Records a single chunk of caller audio.

FieldTypeDescription
saveAs*stringVariable for the recording URL.
promptstringPlayed before recording starts.
maxLengthnumberSeconds. Default 120.
transcribebooleanDefault true.
finishOnKeystringDTMF that ends recording. Default #.
nextStepIdstringStep to run after recording.
onTimeoutstringStep to run if no audio captured.

Result variables: {saveAs} (URL), {saveAs}_duration, {saveAs}_transcription if transcribed.

ivr_voicemail

Recording with greeting, transcription, and notifications baked in.

FieldTypeDescription
greetingstringVoicemail greeting. Has a default.
maxLengthnumberSeconds. Default 120, max 600.
transcribebooleanDefault true.
playBeepbooleanDefault true.
timeoutnumberSilence timeout to stop recording. Default 10.
finishOnKeystringDefault #.
notifyEmailstringEmail to notify with the message + transcript.
notifyPhonestringPhone to notify via SMS.
nextStepIdstringOptional step after the recording webhook returns.

Stored in S3, linked to a voicemail (or call_log) record. Notifications go through Broadcast.

ivr_play_audio

Plays an audio file URL.

FieldTypeDescription
url*stringDirect URL to MP3 / WAV.
loopnumberTimes to repeat. Default 1.
nextStepIdstringStep to run after playback.

ivr_send_sms

Sends an SMS during the call. Doesn't pause the call leg.

FieldTypeDescription
message*stringSMS body. Max 1600 chars.
tostringDefaults to {{caller}}.
fromstringDefaults to {{calledNumber}}.
announcebooleanSpeak announceMessage first.
announceMessagestringDefault: "We are sending you a text message with more information."
nextStepIdstringStep to run after the SMS is queued.

ivr_send_email

Sends an email during the call. Goes through the org's email provider via the Broadcast module.

FieldTypeDescription
to*stringRecipient.
subject*stringSubject.
bodystringHTML body. Required if template not set.
templatestringTemplate id. Required if body not set.
fromstringOverride sender. Defaults to org default.
nextStepIdstringStep to run after queue.

ivr_ai_assistant

Hands the call to the voice assistant via <Stream>.

{
  "actionType": "ivr_ai_assistant",
  "config": {
    "assistantId": "assistant-abc",
    "greeting": "Hi! I'm Acme's virtual assistant. How can I help?",
    "handoffMessage": "Connecting you to our assistant.",
    "context": "Caller is a high-priority customer. Reference: ABC-12.",
    "fallbackStepId": "voicemail"
  }
}
FieldTypeDescription
assistantId*stringThe ai_assistant record id.
greetingstringFirst line the AI says (overrides onboardingPrompt).
handoffMessagestringPlayed to the caller before the WebSocket opens.
contextstringFree-text appended to the assistant's system prompt.
phoneConfigIdstringPhone routing record id, used to load IVR context for the AI.
fallbackStepIdstringStep to run if the WebSocket fails to open.
fallbackMessagestringSpoken before hangup if no fallback step.

The action's TwiML opens <Connect><Stream url="wss://.../simple-voice/stream/{orgId}/{assistantId}?caller=..."> — see Voice streaming.

ivr_twilio_pay

PCI-compliant payment via Twilio Pay.

FieldTypeDescription
amount*string|numberCharge amount.
currency*stringISO currency code.
paymentConnector*stringPay connector name configured in Twilio (Stripe, Braintree, etc.).
descriptionstringCharge description. Default Payment.
saveAsstringVariable for result. Default paymentResult.
promptbooleanPlay default Twilio Pay prompts.
onFailurestringStep to run if payment fails or is cancelled.
nextStepIdstringStep to run on success.

Result variables: {saveAs} (full result), {saveAs}_confirmation (confirmation code), {saveAs}_error.

ivr_hangup

Ends the call.

FieldTypeDescription
messagestringOptional last message before hanging up.

No nextStepId — terminal.