Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.voxworks.ai/llms.txt

Use this file to discover all available pages before exploring further.

What are Sub-Flows?

A Sub-Flow is a self-contained conversation module that:
  • Can be called from the Main Flow or other Sub-Flows
  • Executes its own sequence of steps
  • Returns control to the parent flow when complete

Why Use Sub-Flows?

Sub-Flows help you:
BenefitDescription
ReusabilityUse the same conversation module in multiple places
MaintainabilityUpdate one sub-flow instead of duplicating changes
OrganizationKeep complex flows manageable by breaking them into modules
ConsistencyEnsure the same process is followed every time

How Sub-Flows Work

When a Flow Step invokes a sub-flow:
  1. Context saved — The parent flow’s position is pushed to the flow stack
  2. Sub-flow starts — Execution begins at step 0 of the sub-flow
  3. Sub-flow runs — Steps execute until an end condition
  4. Return — Control returns to the parent flow with a success or failure result
  5. Continue — The parent flow evaluates the result and continues based on its conditions
Main Flow
   Step 0: Opening
   Step 1: Qualify
   Step 2: [Flow Step → Booking Sub-Flow]
              Booking Step 0: Check availability
              Booking Step 1: Confirm time
              Booking Step 2: Book appointment → Return
   Step 3: Confirm and close (continues after sub-flow returns)

Sub-Flow Exit Conditions

Sub-Flows return to their parent with either a success or failure result:
Exit TypeDescriptionParent Condition
SuccessSub-flow completes its objectiveTriggers the Success (true) condition in parent
FailureSub-flow cannot complete its objectiveTriggers the Otherwise condition in parent
The parent Flow Step uses these conditions to route the conversation appropriately:
Flow Step: Enter Booking Sub-Flow
   Condition: true (success)
   → Next: confirmation_step
   → Script: "Great, you're all booked in!"

   Condition: false (failure)
   → Next: alternative_step
   → Script: "Sorry the booking system isn't working."
This pattern allows you to handle both outcomes gracefully in the parent flow.

Common Sub-Flow Patterns

Appointment Booking

Booking Sub-Flow
   Step 0: Check calendar availability (Tool)
   Step 1: "I have availability on [Calendar - Availability - Spoken]. Which works best?"
   Step 2: Confirm selection
   Step 3: Create booking (Tool)
   Step 4: Return with booking confirmation

Information Collection

Contact Info Sub-Flow
   Step 0: "What's the best email to reach you?"
   Step 1: Validate email (Function)
   Step 2: "And your phone number?"
   Step 3: Validate phone (Function)
   Step 4: Return with collected data

Objection Handling

Objection Sub-Flow
   Step 0: "I understand your concern. Can you tell me more?"
   Step 1: Address specific objection
   Step 2: "Does that help address your concern?"
   Step 3: Return based on user response

Best Practices

  1. Keep sub-flows focused — Each should do one thing well
  2. Name clearly — Use descriptive names like “Booking Flow” or “Email Collection”
  3. Document inputs/outputs — Make it clear what data is expected
  4. Handle failures gracefully — Include conditions for unsuccessful outcomes
  5. Test independently — Verify sub-flows work before integrating

Next Steps