Skip to content
Voicerecordstable

Record caller's voice

Captures audio from the caller and saves it. Use 'Save as: voicemail' to also email + archive the recording for the inbox; use 'Save as: recording' for ge…

What it does

Captures audio from the caller leg and saves it. The node sends a record_start to Telnyx with your chosen format, channel layout, max length, and beep-before-record preference, then advances on call.recording.saved once Telnyx finishes packaging the file. The recording's URL lands in vars.lastRecordingUrl (and a few mirror vars) so downstream nodes can play it back, send it as voicemail, or discard it. Optional Transcribe asks Telnyx for an automatic transcript, which arrives on the same event and is stashed in vars.lastRecordingTranscription.

Every recording also writes a row to the recordings table with kind: 'flow_record', the source node id, and your folder / filename-template choices. The audio bytes are archived to S3 generically — not just for voicemails — so flow-record audio is fully preserved and browsable in the storage UI. confirmVoicemail later retags the latest row as voicemail; discardVoicemail clears the voicemail-specific vars but leaves the flow_record row in place. If your flow records multiple times in the same call, each capture inserts a fresh row (idempotent on Telnyx's recording_id), and vars.lastRecordingUrl always points at the most recent.

When to use it

  • Voicemail capture — pair with a review menu and confirmVoicemail / discardVoicemail
  • Caller-feedback survey — record an open-ended response, file it into a "Survey" folder
  • "I agree" contractual confirmation — record the spoken consent into a dedicated compliance folder via Save to folder
  • Read-back QA capture during an order-taking flow (set Channels to dual so caller and agent are on separate channels for review)
  • Capture-and-replay scenarios where the caller hears their own message before deciding to send it

Configuration

Captures audio from the caller and saves it. Use 'Save as: voicemail' to also email + archive the recording for the inbox; use 'Save as: recording' for generic captures (compliance, replay, QA). The recording's URL is exposed as vars.lastRecordingUrl. To delete a recording mid-flow (e.g. after a 'review your message' menu), follow with the Discard recording node.

FieldLabelTypeRequiredDefaultNotes
saveAsSave asselectOptionalrecordingOptions: recording, voicemail. Voicemail saves to S3 AND sends the configured notification email AND archives in the voicemail inbox. Recording just stores the file — pair with later steps if you want to do more.
maxLengthSecsMax lengthselectOptional30Options: 30, 60, 120, 180, 300.
playBeepPlay beep before recording startsbooleanOptionalfalseStandard voicemail behavior.
trimSilenceTrim silence from start and endbooleanOptionalfalse
formatFile formatselectOptionalmp3Options: mp3, wav.
channelsChannelsselectOptionalsingleOptions: single, dual. Stereo is useful for QA review of agent + caller exchanges.
transcribeTranscribe to textbooleanOptionalfalseAuto-transcribe the recording and write it to vars.lastRecordingTranscription. Slower; small extra carrier cost.
saveToFolderIdSave to folderfolderOptional""Where this recording lands in S3. Leave blank to use the org's default Recordings folder. Use a custom folder for special captures (e.g. 'I agree' contractual recordings) so they're easy to find.
filenameTemplateFilename templatetextOptional{{date}}-{{callerNumber}}Optional. Tokens: {{date}}, {{datetime}}, {{callerNumber}}, {{callId}}. Sanitized to lowercase a-z, 0-9, dash, underscore. Defaults to the call ID.
extensionIdVoicemail box (extension)textOptional{{config.extensionId}}Optional. When set with Save as = Voicemail, the email notification routes to this extension's owner instead of the org default. Use this in queue/voicemail sub-flows so a caller who leaves a message after a no-answer reaches the agent that was being rung. Accepts a literal extension UUID OR a {{config.extensionId}} / {{vars.x}} template so reusable sub-flows can pass it through via runFlow args.

Outgoing events: call.recording.saved, call.hangup

Examples

Standard voicemail capture

A 60-second voicemail with a beep before the recording starts. The next step is typically a review menu, then confirmVoicemail / discardVoicemail.

{
  "id": "leave-message",
  "type": "record",
  "config": {
    "maxLengthSecs": "60",
    "playBeep": true,
    "trimSilence": true,
    "format": "mp3",
    "channels": "single"
  },
  "on": { "call.recording.saved": "review-menu", "call.hangup": "end" }
}

Compliance recording with custom folder + transcription

A longer, transcribed capture filed into a department-specific folder with a templated filename for easy auditing.

{
  "id": "consent-capture",
  "type": "record",
  "config": {
    "maxLengthSecs": "180",
    "playBeep": true,
    "format": "wav",
    "channels": "dual",
    "transcribe": true,
    "saveToFolderId": "fld_compliance_consents",
    "filenameTemplate": "consent-{{date}}-{{callerNumber}}"
  },
  "on": { "call.recording.saved": "thank-you", "call.hangup": "end" }
}

The transcription appears in vars.lastRecordingTranscription once Telnyx finishes processing — usable in a subsequent say as a read-back or in a customScript for keyword detection.

Gotchas

  • Multiple records in one call insert multiple rows. Re-recording doesn't replace; it appends. vars.lastRecordingUrl always points at the most recent capture, but every recording row persists. The recordings table is unique on telnyx_recording_id, so a re-fired webhook is idempotent.
  • Audio is archived for every recording, not just voicemails. Pre-migration 0049, only voicemails hit S3 and flow-record audio was lost. Now captureRecordingUrl archives every recording generically (idempotent S3 keys + archived_at gate). Plan storage costs accordingly if you record aggressively.
  • Recording on a pre-answer leg is a silent no-op. Telnyx rejects record_start on a leg that hasn't been answered. If the flow reaches record without an answer upstream, the carrier drops the command and the flow stalls waiting for call.recording.saved.
  • Folder + filename template are stashed on state.vars. They're consumed when call.recording.saved fires later, so a downstream node that runs before the save event (e.g. another record) can overwrite them. Latest write wins. confirmVoicemail can override again at commit time for voicemail-specific routing.
  • channels: 'dual' only matters for bridged calls. A solo caller recording with dual produces a stereo file with one silent channel. Use dual only when you're capturing a bridge and want caller + agent on separate channels for QA.
  • maxLengthSecs is enforced server-side. Telnyx auto-stops the recording at the configured cap and fires call.recording.saved. If the caller is mid-sentence, they'll be cut off. Pick the max with some headroom for realistic message length (60–120s for voicemail, longer for surveys).
  • Hang-up before save still saves. If the caller hangs up while the recording is in progress, Telnyx packages whatever was captured and fires call.recording.saved after the hangup. The worker's voicemail commit-on-hangup fallback uses this.