For Inbound Calls to a Studio Flow, occasionally an Execution will become stuck, remaining in active status until manually ended. A stuck Execution occurs when an inbound call has ended, but Studio is still waiting for a final webhook event to mark the Execution as complete.
To avoid stuck Executions follow these best practices.
Enable Concurrent Calls
Concurrent Calls is a Studio Flow setting that allows the same Caller ID to have more than one active call in the same Flow at the same time, such as multiple calls from a call center or hotel. This setting is on by default for all new Flows.
However, for older Flows (or copies of older Flows) created before October 1, 2018, Concurrent Calls is not enabled by default. If an Execution becomes stuck, and Concurrent Calls is not enabled for that Flow, future calls from that same number will be blocked and callers will hear an out-of-service message.
Follow this guide to enable Concurrent Calls on older Flows.
Set the Status Callback and Fallback URLs
The most common cause of a stuck Execution is when Studio does not receive a final webhook from Programmable Voice that a call has ended. To address this, always set the Studio Flow Webhook URL for A Call Comes In, Call Status Changes, and the Primary Handler Fails fields on your Twilio phone number configuration.
Follow this guide to configure your Twilio phone number for Incoming Calls.
Answer Calls Quickly
For most Flows, Studio answers calls immediately with no ringing. However, if the Flow is designed to delay answering and the caller hangs up while the call is still in ringing status, Studio is unable to answer the call properly, and it creates a stuck Execution.
To avoid this, always answer an Incoming Call quickly with an immediate Say/Play widget as the first step in your Flow. If you need to do additional processing or data lookups via an HTTP Request or Run Function widget, add those after the Say/Play widget.
Note: Callers hear silence while HTTP Request and Run Function widgets are executing, so be sure they complete as quickly as possible.
Manually Ending an Execution
As long as Concurrent Calls is enabled for your Flow, stuck Executions have no negative side effects. However, if necessary, you can manually end them through Twilio Console or by deleting them via the REST API.
To find stuck Executions in Twilio Console, filter your Execution logs to view only Active Executions. Stop any Executions that are obviously too old, typically those that were created more than 4 hours earlier.