Skip to content

Demo Part 3 Step 3 Routing Queue AI Recording Tools

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

Import: part-3-step-3-routing-queue-ai-recording-tools.json

Goal

Keep the combined recording scenario and upgrade the AI branch into a managed tool-enabled voice agent:

  • switch AI startup back to Deferred
  • attach the voice agent explicitly
  • add memory
  • add PIN, goodbye, and knowledge-base tools

Changes Compared with Step 2

Reused node Change Why
dial_ai returns from Immediate to Deferred the voice-agent contract must be attached before the session starts
added Attach voice agent the AI leg now gets an explicit agent contract tools and memory need an attachment stage
added tool and response nodes the AI branch can now validate PINs, answer KB questions, and end the call cleanly the AI layer becomes operational rather than conversational only

Why This Works

  • Attach voice agent is the orchestration point for memory and tools. It turns the raw AI transport into a managed session.
  • dial_ai must return to Deferred here, otherwise the AI session could start before the workflow has attached tools and memory.
  • the tool nodes are attached to one AI agent contract, so the model can choose among validation, goodbye, and KB paths inside one session.
  • play_goodbye and hangup_customer make the goodbye path terminal on purpose, which avoids resuming the conversation after the workflow has committed to ending the call.

How to Test

  1. Import and activate the workflow.
  2. Trigger the queue offline branch into AI.
  3. Ask a KB-style question, provide a PIN, and test the goodbye path.

Expected Result

Tool path Result
PIN tool_pin runs, is_pin_correct evaluates, and the workflow responds through the AI tool response path
KB the agent can use kb_index and kb_section
goodbye the workflow confirms, plays goodbye, and hangs up the customer leg

What The Next Example Adds

Part 3 / Step 4 keeps this full AI/tool layer and adds callback-enabled queue behavior.

Clone this wiki locally