The runtime is a stateless flow walker. Each turn loads the published ConversationFlow (or draft in simulator), walks nodes until awaiting input or session end, and returns bot messages plus debug metadata.
Intent matching order
- Welcome event on session start when enabled.
- Small talk topics — pattern score before intents.
- Substring match on training phrases.
- LLM match — full intent classifier when substring misses.
- Knowledge fallback — hybrid search when no intent matches.
- Fallback event / fallback intent.
Node types (assistant sub-flows)
| Type | Behavior |
|---|---|
| start / end | Session entry and termination |
| intent | Entry node for matched intent sub-flow |
| message | Bot text; {{ session.var }} templates; rich UI blocks |
| entity | Slot capture with reprompt and max_attempts |
| decision | Expression branch on edges |
| router | Multi-way branch with priority-ordered edge conditions |
| service | HTTP tool — real httpx call, JSONPath outputs |
| python | Sandboxed script — session read/write |
| set | Assign session variable |
| handoff | Human agent transfer |
| fallback | Default branch |
| subflow | Invoke another flow graph |
| knowledge | Hybrid retrieval + optional LLM synthesis from chunks |
instruction_agent nodes (workflow graph)
Configured in workflow flow JSON with instructions, tools[], optional model, temperature, max_steps, greeting. Uses AgenticLoop with Claude (Anthropic). Memory persists under session variable _agent_memory_{nodeId}. ToolBridge executes workspace/agent tools registered on the node.
Knowledge nodes
- Query from static template, last user message, and/or conversation summary.
- Retriever — vector + keyword hybrid (pgvector + tsvector).
- synthesize_answer — uses configured LLM provider for answer synthesis.
- Respects knowledge_fallback_min_score when used as runtime fallback path.
Service nodes
- Template URL, headers, body with {{ variables }}.
- Workspace secrets resolved at runtime — never stored in flow JSON.
- Retries, timeout, JSONPath mapping to session.*.
- Response body stored on session for simulator trace.
- Auto-stored at session.<service_id> for downstream access.
Python nodes
- Sandboxed execution with session, user, workspace, and flow variable scopes.
- Access to tool_response from the most recent service call in the same turn.
- print() output appears in the simulator debug trace.
- Wall-clock timeout enforced (default 2 seconds).
Safety limits
- 64 steps per turn cycle guard.
- Python node wall-clock timeout (default 2 seconds).
- Monthly LLM spend cap per assistant — blocks enrichment and intent LLM matcher.
Agent-level orchestration
The agent runtime sits above the flow engine for multi-intent assistants: tracks the active intent, routes utterances to intent sub-flows, returns to root when a sub-flow completes, and handles welcome/fallback at agent scope.
Workflow graph runtime
Legacy workflows use a dedicated graph runtime (not the engine's intent matching). The simulator walks nodes from triggers/root_agent through agents, knowledge, router/decision branches, tool nodes, nested workflow handoffs, and end nodes.
- Routing — select_workflow_successor_node evaluates edge condition.expr against last user text and variables.
- Tool nodes — ToolBridge executes workspace tools; trace event workflow.tool.executed.
- Sub-workflow — workflow nodes load the referenced graph and enter its first runnable node.
- Publish validation — rejects script, datastore, set, human, parallel, wait; requires reachable agent/knowledge/end from entries.
- Chain runtime — workflow_chain_runtime.py runs primitive chains (assistant, agent, webhook, human, decide, notify, schedule) with persisted WorkflowChainRun steps and outbound webhook URL safety checks.