Issue
Some users may observe that certain calls in their Twilio Studio Flow do not reach an expected widget (such as "sendToFlex"), even though the flow transitions indicate they should. Instead, these executions may show a "Stop Execution" event in the logs. This behavior appears sporadic and does not affect every call.
Symptoms
- Studio Execution logs show "Stop Execution" for some calls.
- The expected widget (e.g., "sendToFlex") is not reached for affected calls.
- No explicit error message is shown.
- The issue occurs sporadically, not for every call.
Product
Studio
Environment
Twilio Console
Cause
This behavior typically occurs when the inbound call is disconnected (e.g., the caller hangs up or sends a SIP CANCEL) before the Studio Flow reaches a TwiML widget. If the call ends while Studio is processing a non-TwiML widget (such as Set Variable, Split, etc.), the execution may remain active or appear "stuck." When Studio tries to transition to a TwiML widget after the call has already ended, it cannot proceed, resulting in a "Stop Execution" event.
For example, if a SIP CANCEL is received and acknowledged with a 487 response before the flow reaches "sendToFlex," the execution cannot continue.
Resolution
To ensure Studio executions are properly completed and to avoid stuck or incomplete executions:
-
Configure the Status Callback URL for Your Phone Number:
- Go to your Studio Flow in the Twilio Console.
- Copy the Webhook URL for your Studio Flow.
- Go to the Active Phone Numbers section in the Twilio Console.
- Select your phone number.
- Paste the Studio Flow Webhook URL into the "Call Status Changes" field.
-
No Custom Code Required:
- You do not need to write any custom callback function or code. Twilio will automatically send the necessary status updates to your Studio Flow when the Status Callback URL is configured.
-
Monitor Executions:
- If you continue to see stuck executions, review your call logs for early disconnects or SIP CANCEL events.
- You can manually end stuck executions from the Twilio Console or via the Studio REST API.
Additional Information
If some calls do not reach the expected widget in your Studio Flow and show "Stop Execution," check for early call disconnects and ensure your Status Callback URL is correctly configured. No custom code is needed just proper setup in the Twilio Console.
Below you will find references to useful documents:
- Understanding and Avoiding Stuck Executions in Twilio Studio
- Twilio Studio REST API: End an Active Execution
Please reach out Twilio Support for further assistance.