Skip to main content

Flows & Dialogs

Build conversation flows for virtual assistants.

Overview

Dialog flows define how your virtual assistant handles conversations:
  • Intents — What users want to accomplish
  • Entities — Information extracted from messages
  • Dialogs — Conversation logic and responses
  • Transitions — How conversations move between states

Dialog Types

Standard Dialog

Structured conversation flow for specific tasks:
[User: Check order status]


[Collect Order Number]


[Validate Order Number]

    ┌────┴────┐
    ▼         ▼
[Valid]   [Invalid]
    │         │
    ▼         ▼
[Fetch    [Request
 Status]   Again]


[Deliver Response]

Agent Flow

Complex flows with AI agent capabilities:
Agent Flow: Research Assistant
Capabilities:
  - search_web
  - analyze_documents
  - summarize_findings
Behavior: |
  Research the user's question using available tools.
  Synthesize findings into a comprehensive answer.
  Cite sources when providing information.

Sub-Dialog

Reusable dialog components:
Sub-Dialog: Collect Address
Entities required:
  - street_address
  - city
  - state
  - zip_code
Validation: address_verification_api
Reusable: true

Building Dialogs

Dialog Builder

Visual drag-and-drop builder:
Node TypePurpose
MessageDisplay text, cards, or media
PromptCollect user input
ConditionBranch based on conditions
API CallExecute integrations
ScriptRun custom code
AgentInvoke AI agent
TransferHand off to human

Node Configuration

Message node example:
Node: Welcome Message
Type: message
Content:
  text: "Hello! I'm your order assistant. How can I help you today?"
  quick_replies:
    - "Check order status"
    - "Start a return"
    - "Track my package"
Transitions:
  - intent: check_order → order_status_flow
  - intent: start_return → return_flow
  - default → fallback

Transitions

Define conversation flow:
Transition TypeDescription
IntentMove based on detected intent
EntityMove based on extracted entity
ConditionMove based on variable value
DefaultFallback when no match
ErrorHandle errors gracefully

Entity Management

Entity Types

TypeUse CaseExample
Built-inCommon data typesDate, Number, Email
ListDefined optionsProduct names, sizes
RegexPattern matchingOrder ID: ORD-\d
CompositeGrouped entitiesFull address

Entity Extraction

Configure extraction:
Entity: OrderNumber
Type: regex
Pattern: "(?:order|ORD)?[-#]?(\d{5,8})"
Validation: |
  length >= 5 AND length <= 8
  starts_with_digit
Prompts:
  initial: "What's your order number?"
  retry: "I didn't catch that. Order numbers are usually 5-8 digits."
Max retries: 3

Entity Disambiguation

Handle ambiguous inputs:
Disambiguation: Size
Values: ["small", "medium", "large"]
On ambiguity:
  type: confirm
  message: "Did you mean {{matched_value}}?"
On multiple:
  type: select
  message: "Which size? Small, medium, or large?"

Context Management

Context Variables

Store and use conversation context:
// Set context
context.session.orderNumber = "12345"
context.session.customerTier = "premium"

// Use in messages
"Your order {{context.session.orderNumber}} is being processed."

// Use in conditions
if (context.session.customerTier === "premium") {
  // Premium customer handling
}

Variable Scopes

ScopeLifetimeUse Case
TurnSingle turnTemporary processing
SessionConversationOrder details, selections
UserAcross sessionsPreferences, history
GlobalAll usersConfiguration, flags

Interruption Handling

Configuration

Handle topic switches:
Interruption Handling:
  allow_interruptions: true
  hold_and_resume:
    enabled: true
    message: "No problem, let me help with that first."
  implicit_confirmation: true
  max_depth: 3

Scenarios

ScenarioHandling
New intentHold current, start new
ClarificationHandle inline, resume
CancelConfirm and exit
Go backReturn to previous step

Testing

Conversation Testing

Test dialog flows:
  1. Open Test panel
  2. Enter test utterances
  3. Verify intent detection
  4. Check entity extraction
  5. Validate flow navigation
  6. Review responses

Batch Testing

Run test suites:
Test Suite: Order Status Flow
Tests:
  - name: "Valid order number"
    utterance: "Where is my order 123456?"
    expected:
      intent: check_order_status
      entities:
        order_number: "123456"
      response_contains: "order status"

  - name: "Missing order number"
    utterance: "Where is my order?"
    expected:
      intent: check_order_status
      next_prompt: "order number"

Debug Mode

Enable detailed debugging:
  • Intent confidence scores
  • Entity extraction details
  • Flow transitions
  • Variable values
  • API call results

Best Practices

Dialog Design

  • Keep flows focused on single tasks
  • Use sub-dialogs for reusable components
  • Handle errors gracefully
  • Provide clear escape paths
  • Test edge cases thoroughly

Intent Training

  • Add 15-25 utterances per intent
  • Include variations and typos
  • Use real customer language
  • Regularly review misclassifications
  • Avoid overlapping intents

Conversation UX

  • Confirm understanding before actions
  • Provide clear options when ambiguous
  • Keep messages concise
  • Use quick replies for common paths
  • Allow natural conversation flow