✗ how_to (wrong)
✗ low (wrong)
escalate: noSummary
Developer is trying to understand why workers intermittently transition to Unavailable after a reservation timeout in Flex/TaskRouter, and wants to know how to configure or control that behavior.
Suggested first response
Thank you for the detailed write-up — this is a great question and the intermittent nature is the key clue here. To address your core question: TaskRouter does have a built-in mechanism called the 'Activity on Timeout' (or 'timeout activity') setting at the Workflow level, specifically on the Workflow's Routing Step or Filter configuration. If a reservation times out, TaskRouter can automatically move the worker to a designated Activity SID — but if this is not explicitly set, the behavior can fall back to workspace-level defaults or remain unchanged, which may explain why you see it happen inconsistently rather than 100% of the time. The non-determinism you're observing (30–40% of timeouts) is a strong signal that this is not a deliberately configured transition, but rather a race condition or a workspace/workflow default being applied inconsistently — possibly influenced by client connectivity state at the moment of timeout (e.g., the Flex client briefly losing its WebSocket connection to TaskRouter at the same moment the timeout fires, which can cause TaskRouter to treat the worker as unreachable and move them to an offline-adjacent activity). Here are the steps we'd recommend: (1) Check your Workflow configuration in the Twilio Console under TaskRouter > Workspaces > your workspace > Workflows, and inspect each Routing Step for any 'Activity on Timeout' or 'Activity on Reservation Timeout' field — note the SID configured there, if any. (2) Review your Workspace's default Activity setting, as this can serve as a fallback. (3) Pull the Worker Activity history log (available via the TaskRouter REST API at /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/WorkerChannels or the Worker Statistics endpoint) for the affected worker around the time of a timeout event to see what triggered the activity change — the 'reason' field in the activity transition event should indicate whether it was a TaskRouter-initiated change or a client-initiated one. (4) Check for any Flex Insights or Event Streams data around those timestamps for the worker SID you provided. You are correct that DequeuePostWorkActivitySid would not apply here since the task was never accepted. Could you confirm whether you have any 'Activity on Timeout' SID configured in your Workflow Routing Steps, and share the output of a GET request to your Workflow resource so we can review the full configuration? That will help us determine whether this is a configuration gap or something worth escalating further.
634 output tokens · 18.3s · 1 attempt(s)