Skip to content
VoicediscardVoicemailstable

Discard recording

Deletes the most recent recording from S3 (and skips the email if it was queued as a voicemail). Use after a 'review your message' menu when the caller ch…

What it does

Drops the pending voicemail without committing it. The node clears the _pendingVoicemailUrl, lastRecordingUrl, and any pending folder / filename template state, then auto-advances via node.on['voicemail.discarded'] to the next step. No email is sent, the recordings row stays tagged flow_record (not voicemail), and the caller hears whatever your downstream nodes say next.

Use this on the "cancel and re-record" branch of a voicemail review menu, or as the explicit "do nothing with that audio" path on a flow that captured a recording for some reason but decided not to keep it as a voicemail. Note that the audio bytes are still archived to S3 — the generic archive in captureRecordingUrl runs for every recording. discardVoicemail only prevents the voicemail-specific tagging and notification email; the row remains in the recordings table as a flow_record for later cleanup or auditing.

When to use it

  • "Press 2 to re-record" branch of a review menu — discard, then loop back to the record step
  • "Press 3 to cancel" branch when the caller doesn't want to leave a message after all
  • After an upstream customScript flagged the recording as too short or as silence to suppress
  • As the cleanup step before re-entering the main flow when a flow recorded the caller for some non-voicemail purpose

Configuration

The node has no configuration fields — it just discards.

Deletes the most recent recording from S3 (and skips the email if it was queued as a voicemail). Use after a 'review your message' menu when the caller chooses to cancel — the upstream record node will have already saved the file.

This node has no configurable fields.

Outgoing events: voicemail.discarded

Examples

Re-record loop

After a review menu, "press 2" lands here, which clears the pending voicemail and loops back to record again.

{
  "id": "discard-and-retry",
  "type": "discardVoicemail",
  "config": {},
  "on": { "voicemail.discarded": "record-prompt", "call.hangup": "end" }
}

The node advances synchronously after clearing state — no webhook is involved.

Gotchas

  • Audio is already on S3. Discarding clears the voicemail-specific vars but does not delete the archived file. The generic captureRecordingUrl archive happens at call.recording.saved time, before this node ever runs. The recordings row stays tagged flow_record. If you need bytes deleted from storage, do it via the recordings/storage admin tools, not this node.
  • No webhook event. Like confirmVoicemail, this node advances synchronously. Wire voicemail.discarded as the outgoing edge — that's the only event the node looks up. Other edges (e.g. call.speak.ended) won't be followed.
  • Discarding twice is harmless. Re-entering the node when there's no pending voicemail just clears already-clean state. Useful as a defensive cleanup before terminal nodes.
  • The hangup-fallback on confirmVoicemail does NOT respect a prior discard. If you discard, then the caller starts speaking again (e.g. you loop back to a re-record), and they hang up mid-second-recording without confirming, the worker's hangup fallback will commit the new recording as voicemail. That's usually what you want — but worth knowing.