Skip to content

Demo Part 1 Step 2 Trunk to Queue With AI Offline

Andrey Egorov edited this page May 18, 2026 · 2 revisions

Import: part-1-step-2-trunk-to-queue-with-ai-offline.json

Goal

Keep the same basic queue behavior, but replace the plain offline branch with an AI fallback:

  • no representatives online
  • create a WebSocket AI leg
  • bridge the caller to that AI leg
  • let the WebSocket leg start immediately without a separate attachment stage

Changes Compared with Step 1

Reused node Change Why
offline_is_live now routes into dial_ai instead of ending at a plain announcement the offline branch now becomes a live AI handoff
dial_ai WebSocket Start Mode = Immediate this step has no attached voice agent yet, so the AI session must start on its own
dial_ai uses shortened OpenAI instructions the AI leg should not mention tools that do not exist yet
play_offline becomes a background, voice-interruptible handoff prompt it explains the AI fallback while the session is already taking over

Why This Works

  • the queue side stays on the same basic structure as step 1. That keeps the new concept isolated to offline AI handoff.
  • offline_is_live still checks that a live caller leg exists before the workflow moves into the AI branch.
  • dial_ai uses Immediate because there is no Attach voice agent node yet. The transport has to start by itself.
  • dial_ai goes directly to bridge_ai, so the caller is connected to the AI leg without an extra orchestration layer.
  • play_offline remains in the flow as a background prompt. It explains the fallback, but because it is background media it does not block the AI conversation from starting.

How to Test

  1. Import and activate the workflow.
  2. Ensure no queue representatives are online.
  3. Place a caller into the queue.
  4. Let the queue reach the Offline branch.

Expected Result

Stage Result
offline branch dial_ai creates the WebSocket leg
handoff caller is bridged to the AI leg through bridge_ai
prompt play_offline plays as a handoff announcement while AI is already active

What This Part Achieves

Part 1 now forms one complete line:

  • basic queue
  • then the same queue with AI replacing the offline dead-end

Clone this wiki locally