---
title: "Best Practices for Conversation Relay Provider Failover"
description: "Twilio Conversation Relay uses separate third-party providers for transcription (ASR) and text-to-speech (TTS), each of which can fail under high load or during outages. To maintain uninterrupted Voice AI calls, developers must implement an application-level failover strategy that switches providers when errors occur. Failures manifest differently depending on timing: startup failures end the session with an ErrorCode, while mid-call TTS failures keep the call alive and require the WebSocket server to detect the error and send an end message with handoffData. The action URL handler must branch on specific error codes (64114 for ASR, 64111/64112 for TTS) and return new TwiML with alternative providers. To prevent infinite loops, the strategy limits retry attempts, changes providers on each attempt, and includes a final fallback that does not use Conversation Relay, such as or ."
---

# Best Practices for Conversation Relay Provider Failover

[Twilio](https://yomu.fyi/company/twilio) · Daniel Jansson · Nov 4, 2026

**Type:** Tutorial

## Summary

Twilio Conversation Relay uses separate third-party providers for transcription (ASR) and text-to-speech (TTS), each of which can fail under high load or during outages. To maintain uninterrupted Voice AI calls, developers must implement an application-level failover strategy that switches providers when errors occur. Failures manifest differently depending on timing: startup failures end the session with an ErrorCode, while mid-call TTS failures keep the call alive and require the WebSocket server to detect the error and send an end message with handoffData. The action URL handler must branch on specific error codes (64114 for ASR, 64111/64112 for TTS) and return new TwiML with alternative providers. To prevent infinite loops, the strategy limits retry attempts, changes providers on each attempt, and includes a final fallback that does not use Conversation Relay, such as or .

## Context

Twilio Conversation Relay failover for Voice AI agents in production.

## Approach / What changed

Set an action URL on with attempt number and current providers. On startup failure, return new TwiML with different ttsProvider or transcriptionProvider. On mid-call TTS failure, the WebSocket server must send an end message with handoffData containing the failure reason, then the action URL handler returns new TwiML. Branch on error codes 64114 (ASR), 64111/64112 (TTS). Limit attempts to 2-3, change providers each time, and have a final fallback that does not use Conversation Relay, such as or .

## Takeaways

- Startup failures (ASR or TTS) end the session with SessionStatus=failed and an ErrorCode; the action URL handler must check ErrorCode, not only SessionStatus, to trigger failover.
- Mid-call TTS failures keep the call connected; the WebSocket server must detect error messages (64111/64112) and send an end message with handoffData to allow the action URL to switch providers.
- To avoid failover loops, limit attempts to 2-3, change providers on each attempt, and always include a final fallback that does not use Conversation Relay, such as or .

## FAQ

### How do I detect a mid-call TTS failure?

The WebSocket server receives an error message with code 64111 or 64112. The call stays connected and the caller hears silence. Your server must send an end message with handoffData containing the failure reason, then the action URL handler returns new TwiML with a different ttsProvider.

### What error codes indicate a provider failure?

64114 indicates an ASR provider failure (unreachable or timeout). 64111 indicates a TTS provider service error (5xx or timeout). 64112 indicates a TTS provider conversion error (invalid voice or quota). These are the codes to branch on for failover.

### How do I prevent a failover loop?

Carry an attempt number in the action URL query string. Limit attempts to 2-3. Change providers on each attempt. Do not fail over on configuration errors (64101, 64106). Always have a final fallback that does not use Conversation Relay, such as <Say> or <Dial>.

**Tags:** [ASR](https://yomu.fyi/topic/asr), [Conversation Relay](https://yomu.fyi/topic/conversation-relay), [Failover](https://yomu.fyi/topic/failover), [Twilio](https://yomu.fyi/topic/twilio), [Voice AI](https://yomu.fyi/topic/voice-ai)

- Source: [Twilio](https://www.twilio.com/en-us/blog/developers/best-practices/conversation-relay-failover)
- Source URL: https://www.twilio.com/en-us/blog/developers/best-practices/conversation-relay-failover
- Ingested by Yomu: 2026-11-05T03:00:16.843Z

[Read original post](https://www.twilio.com/en-us/blog/developers/best-practices/conversation-relay-failover)
