Customer Intent Routing with Switch

v1.1 Feature

Demonstrates v1.1 switch/case — route customer queries to specialized handlers.

7 nodes · 6 edgesv1.1 features
v1.1switchcustomer-serviceagent
Visual
receive_queryapi
sequentialclassify_intent
classify_intentagent
switchbilling_handler
billing_handleragent
sequentiallog_interaction
tech_handleragent
sequentiallog_interaction
sales_handleragent
sequentiallog_interaction
fallback_handlerhuman
sequentiallog_interaction
log_interactiondata
ex-switch-intent-routing.osop.yaml
osop_version: "1.1"
id: "switch-intent-routing"
name: "Customer Intent Routing with Switch"
description: "Demonstrates v1.1 switch/case — route customer queries to specialized handlers."
tags: [v1.1, switch, customer-service, agent]

nodes:
  - id: "receive_query"
    type: "api"
    purpose: "Receive customer query via chat API."
    runtime:
      endpoint: "/api/chat"
      method: "POST"

  - id: "classify_intent"
    type: "agent"
    subtype: "classifier"
    purpose: "Classify customer intent using NLP."
    runtime:
      model: "claude-haiku-4-5"

  - id: "billing_handler"
    type: "agent"
    subtype: "llm"
    purpose: "Handle billing inquiries — refunds, invoices, payment issues."
    runtime:
      model: "claude-sonnet-4-6"
      system_prompt: "You are a billing specialist."

  - id: "tech_handler"
    type: "agent"
    subtype: "llm"
    purpose: "Handle technical support — debugging, how-to, feature questions."
    runtime:
      model: "claude-sonnet-4-6"
      system_prompt: "You are a technical support agent."

  - id: "sales_handler"
    type: "agent"
    subtype: "llm"
    purpose: "Handle sales inquiries — pricing, plans, upgrades."
    runtime:
      model: "claude-sonnet-4-6"
      system_prompt: "You are a sales consultant."

  - id: "fallback_handler"
    type: "human"
    purpose: "Escalate unclassified queries to human agent."

  - id: "log_interaction"
    type: "data"
    purpose: "Log conversation to analytics pipeline."

edges:
  - from: "receive_query"
    to: "classify_intent"
    mode: "sequential"
  - from: "classify_intent"
    to: "billing_handler"
    mode: "switch"
    when: "outputs.classify_intent.intent"
    cases:
      - value: "billing"
        to: "billing_handler"
      - value: "technical"
        to: "tech_handler"
      - value: "sales"
        to: "sales_handler"
    default_to: "fallback_handler"
  - from: "billing_handler"
    to: "log_interaction"
    mode: "sequential"
  - from: "tech_handler"
    to: "log_interaction"
    mode: "sequential"
  - from: "sales_handler"
    to: "log_interaction"
    mode: "sequential"
  - from: "fallback_handler"
    to: "log_interaction"
    mode: "sequential"