To capture, review, and analyze voice conversations, Dialogflow CX lets you export conversational audio to Cloud Storage.
Dialogflow CX provides two separate, independent mechanisms to export audio:
- Agent and flow settings: Configured using
AdvancedSettings.audio_export_gcs_destination. Applies to Dialogflow CX v3 session methods (DetectIntentandStreamingDetectIntent) as well as v2 and v2beta1 conversation participant methods (AnalyzeContent,StreamingAnalyzeContent, andBidiStreamingAnalyzeContent). - Security settings: Configured using
SecuritySettings.audio_export_settings. Applies to both v3 session methods and v2 and v2beta1 participant methods, and supports audio redaction, audio format selection, and data retention policies.
These two export mechanisms are independent. If you configure both, Dialogflow CX exports audio to both Cloud Storage destinations.
Comparison of audio export mechanisms
The following table summarizes the differences between agent or flow export and security settings export:
| Feature | Agent and flow settings | Security settings |
|---|---|---|
| Primary purpose | Immediate debugging, session-level playback in the Conversational Agents console, and logging | Long-term compliance, Sensitive Data Protection redaction, conversation analytics, and telephony call archival |
| Configuration level | Agent level (global default) or flow level (overrides agent-level setting for that flow) | Security settings resource level (reusable across agents and locations) |
| Console configuration |
|
|
| API fields and configuration | Configured in AdvancedSettings on Agent or Flow:
|
Configured in AudioExportSettings on SecuritySettings:
|
| Applicable API methods |
|
|
| End-user audio export | Supported for all applicable methods | Supported for all applicable methods |
| Text-to-speech (TTS) audio export | Supported automatically for DetectIntent and non-streaming TTS in StreamingDetectIntent (v3), as well as all participant methods (AnalyzeContent, StreamingAnalyzeContent, BidiStreamingAnalyzeContent). Streaming TTS in StreamingDetectIntent (when enable_streaming_synthesize is set) is not exported. |
Supported for DetectIntent, non-streaming TTS in StreamingDetectIntent, and all participant methods when you set store_tts_audio to true. |
| Audio redaction | Supported for end-user audio when the agent is configured with a security settings resource that has a redaction_strategy. |
Supported for LINEAR16, MULAW, and ALAW end-user audio when enable_audio_redaction is true and redaction_strategy is configured. If redaction fails or audio lacks word offsets, the audio file is not stored. Synthesized TTS audio is not redacted. |
| Audio format and extensions | Original audio encoding. No file extension is appended to exported files by default. | Telephony recordings can be configured as MULAW (.raw), MP3 (.mp3), or OGG (.ogg). Runtime input audio appends .wav if a WAV header is written; TTS audio appends .wav, .mp3, or .ogg based on output encoding. |
| Cloud Storage path structure | Flat directory containing individual utterance files: gs://BUCKET_NAME/PATH/PROJECT_ID_SESSION_ID_ENCODING_SAMPLE_RATE_CHANNELS_TIMESTAMP (where for synthesized TTS audio, CHANNELS is 2 for DetectIntent and 1 for participant methods; for input audio, CHANNELS matches the input channel count). |
|
| Required IAM permissions | Storage Object Creator (roles/storage.objectCreator) on the target bucket for the Dialogflow Service Agent (and partner telephony service accounts, if applicable). |
Storage Object Creator (roles/storage.objectCreator) on the target bucket for the Dialogflow Service Agent. The calling user also requires storage.buckets.getIamPolicy (and storage.buckets.setIamPolicy unless pre-granted). |
| Data retention policy interaction | Independent of data retention policies; governed by target bucket lifecycle. | Active whenever gcs_bucket is configured (not disabled by retention_strategy); governed by target bucket lifecycle. |
Precedence and interaction
Agent or flow settings and security settings operate independently:
- No override: Neither setting overrides, disables, or replaces the other.
- Independent exports: If you configure both an agent or flow export bucket and security settings audio export, Dialogflow CX exports conversation audio to both Cloud Storage destinations independently.
- Separate destinations: The two features use different directory path conventions and support different formatting and redaction options.
- Shared bucket redaction behavior: If
AdvancedSettings.audio_export_gcs_destinationandSecuritySettings.audio_export_settings.gcs_bucketpoint to the same Cloud Storage bucket, andenable_audio_redactionisfalse, Dialogflow skips Sensitive Data Protection redaction for that shared bucket even ifredaction_strategyis configured on the security settings (which skips redaction on yourAdvancedSettingsexports as well). Configuring separate buckets preventsenable_audio_redaction: falseon the security settings from disabling redaction on yourAdvancedSettingsexports. To ensure that audio written to the security settings destination is redacted, setenable_audio_redactiontotrueand configureredaction_strategy.
Required IAM permissions
To allow Dialogflow CX to write exported audio files to your Cloud Storage
bucket, grant the Storage Object Creator (roles/storage.objectCreator) role
on the target bucket to the following service accounts:
- Dialogflow Service Agent:
service-PROJECT_NUMBER@gcp-sa-dialogflow. - Partner built-in telephony service account (if you use partner telephony):
one-click@df-cx-ALPHANUMERIC_VALUE-ALPHANUMERIC_VALUE.
Replace PROJECT_NUMBER with the numeric Google Cloud project number where
your Dialogflow CX agent resides. To find the Dialogflow Service Agent in the
Google Cloud console, go to the IAM page and select Include Google-provided
role grants.
When you configure audio_export_settings in security settings by using the
console or API, Dialogflow validates the bucket policy and attempts to
grant the Storage Object Creator role to the Dialogflow Service Agent
automatically:
- The calling user account must have the
storage.buckets.getIamPolicypermission on the target bucket, even when IAM roles are granted manually beforehand. - The calling user account must also have the
storage.buckets.setIamPolicypermission on the bucket, unless the Storage Object Creator role has already been granted to the Dialogflow Service Agent. - If either required permission is missing during validation, the request
fails with a
PERMISSION_DENIEDerror.
Dialogflow ES compatibility
Audio export compatibility with Dialogflow ES depends on the request method:
- Participant methods (
AnalyzeContent,StreamingAnalyzeContent, andBidiStreamingAnalyzeContent): A Dialogflow v2 or v2beta1 client callingAnalyzeContent,StreamingAnalyzeContent, orBidiStreamingAnalyzeContentwith an Dialogflow ES agent can use Dialogflow CXSecuritySettings(configured through aConversationProfile) to export conversation audio. - Session methods (
DetectIntentandStreamingDetectIntent): In Dialogflow ES,DetectIntentandStreamingDetectIntentdo not support audio export to Cloud Storage. Audio export for session methods is available in Dialogflow CX.