Skip to main content

Overview

The Flow Builder engine is a single-loop state machine that processes one user message at a time. Understanding it helps you build faster, more efficient flows — especially for voice where latency matters.

The Processing Loop

When a user sends a message:
  1. Receive message — Input is added to conversation history
  2. Process current node — Engine executes the active node
  3. Chain through silent nodes — Variable, Logic, Extraction, Function, Request nodes execute automatically in sequence
  4. Stop at Conversation or End — Loop stops when it reaches a response-generating node
Only Conversation nodes produce user-facing responses. All other nodes execute silently. The engine can chain through multiple nodes in a single turn, transparently to the user.

Node Processing Order

Node TypeWhat HappensBlocks?
ConversationLLM call with prompt + historyYes — waits for LLM
Tool/FunctionExecutes HTTP tool callYes — waits for API
ExtractionLLM extracts structured dataYes — waits for LLM
VariableSets values synchronouslyNo — instant
LogicEvaluates conditions, picks pathNo — instant
RequestMakes HTTP requestYes (if await: true)
EndFires webhook, returns end messageNo

Streaming (SSE)

Flow Builder uses Server-Sent Events to stream responses in real-time — critical for voice where TTS starts speaking as soon as the first tokens arrive.

SSE Event Types

EventDescription
tokenIndividual LLM token chunks
fillerSpeak-during-execution text from Tool/Function nodes
clearDiscard partial response — a transition is happening
tool_callsTool/function call detected
doneTurn complete with final state
errorError during processing
The clear event is key for voice: when the LLM starts responding but then transitions, clear tells TTS to stop the partial response and prepare for the new node’s output.

Safety Limits

LimitValuePurpose
Max transitions per turn10Prevents infinite loops
Max tool call rounds5Limits recursive execution
Conversation history cap40 messagesControls context window
Request timeout10 secondsPrevents hung API calls
Hitting the 10-transition limit means there’s likely a loop — check for Logic nodes that cycle without a Conversation node in between.

LLM Resolution Order

The engine determines which model to use by checking (in order):
  1. Node override — Model set on the specific node
  2. Flow default — Model set at the flow level
  3. Fallbackgpt-4o-mini
Supported providers: OpenAI, Anthropic, and OpenRouter.

Conversation Node

The core node type

API Key Setup

Configure your LLM provider

Voice Connection

Deploy to voice with streaming

Testing

Test your flow