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 is the Main Flow?

Every Script has exactly one Main Flow. When a call starts:
  1. The Script is loaded
  2. The Main Flow is identified via the Script’s main_flow_id
  3. The assistant begins execution at step 0 of the Main Flow
  4. The conversation continues until an end condition is reached

Main Flow Structure

A Main Flow contains an ordered sequence of steps, each step can branch to other steps or sub-flows based on conditions.

Starting the Conversation

The first step of the Main Flow handles the opening message: Outbound Calls:
  • The assistant may wait briefly for the caller to speak
  • Example: “Hi, this is Sarah from Voxworks.”
Inbound Calls:
  • The assistant speaks first with a greeting
  • Example: “Thank you for calling Voxworks. How can I help you today?”

Flow Navigation

From any voice step, conditions determine where to go next:
Condition TypeDescriptionExample
Specific matchUser response matches a defined scenario”User wants to book” → Booking step
OtherwiseFallback when no specific condition matchesClarification step

Knowledge Base and Guidelines

When a user asks a question or raises a topic during the conversation, the assistant checks the Knowledge Base and Guidelines for relevant information. If the assistant has information to respond:
  1. The assistant answers the question using available knowledge
  2. The conversation stays on the current step
  3. The assistant continues with the current step’s objective
This allows the assistant to handle ad-hoc questions without derailing the flow. For example:
Step: "Would you like to schedule a demo?"

User: "How much does it cost?"

→ Assistant answers from Knowledge Base: "We offer flexible pricing
  on a cents per minute basis. Would you like to schedule a demo
  to discuss your specific needs?"

→ Conversation remains on the same step, waiting for demo response
If the assistant doesn’t have relevant information, it follows the Guidelines for handling unknown questions (e.g., offering to follow up later).

Ending the Conversation

The Main Flow ends when:
  1. End condition reached — A step’s condition has end_flow: success or fail
  2. User hangs up — The participant disconnects
  3. Maximum duration — The configured time limit is reached
  4. Assistant hangup — The assistant determines the call should end
When the Main Flow ends, the call terminates.

Main Flow vs Sub-Flows

AspectMain FlowSub-Flow
EntryAutomatic at call startInvoked by a Flow step
ExitEnds the callReturns to parent flow
RequiredOne per ScriptOptional, unlimited
ReusabilitySpecific to ScriptCan be shared across Scripts

Maximising Reusability

While the Main Flow is specific to each Script, you can maximise reusability by keeping it minimal:
  1. Opening message — Greet the caller
  2. Flow step — Route immediately to a reusable sub-flow
  3. Closing messages — Handle success and failure outcomes from the sub-flow
This pattern lets you reuse the core conversation logic across multiple Scripts, with only the opening and closing messages varying per Script.

Interrupts

During a conversation, users may interrupt the assistant while it is speaking. How interrupts are handled depends on the step type:
Step TypeInterruptibleBehaviour
VoiceYes (default)User can interrupt; assistant stops speaking and processes the interruption
ToolNoUser cannot interrupt while the tool executes
FunctionNoUser cannot interrupt while the function executes
Voice steps can be configured to disable interrupts using the interruptible: false setting when you need the assistant to complete critical information without being cut off. For more on interrupt handling limitations, see Assistant Behaviour.

Best Practices

  1. Start with a clear opening — Set expectations immediately
  2. Keep the main path simple — Use sub-flows for complex branches
  3. Handle common objections — Include conditions for typical responses
  4. Plan your exit points — Define clear end conditions
  5. Test the full journey — Walk through every possible path

Next Steps