Skip to main content
Scripts are the blueprint of your conversations. They define the structure, logic, and deterministic behavior that guides how your agents interact with users. Unlike pure AI conversations that can be unpredictable, scripts provide a controlled framework while still allowing natural language understanding.

What is a script?

A script is a visual, node-based flow that defines:
  • Conversation structure: The path conversations can take
  • Deterministic actions: System operations that execute predictably
  • AI guidance: Instructions and examples for natural responses
  • State management: Variables that track conversation data
  • Tool invocation: When and how to call external services
Scripts are built in a visual IDE similar to Typebot.io or n8n, but specifically designed for conversational AI with voice and text channels.

Script architecture

Core structure

Every script consists of four main components:
Components explained:
  1. General: Name, description, and metadata
  2. Nodes: Individual building blocks (AI responses, tools, logic)
  3. Edges: Connections that define flow between nodes
  4. Variables: State storage for conversation data

Visual representation

Scripts are built in a drag-and-drop canvas:

Node types

Scripts are built from different types of nodes, each serving a specific purpose:

Start node

Every script begins with a start node:
This is the entry point when the script is activated. A script can only have one start node.

AI response node

Defines what the AI should say and provides examples:
Example configuration:
The AI uses the response as guidance and the examples to understand tone and variation. The actual response is generated naturally, not templated.
Provide 3-5 examples to give the AI enough variety while maintaining consistency. The AI will generate unique responses that match the style.

User query node

Defines what information you’re asking the user for:
Example configuration:
The AI will ask the question naturally and extract the relevant information (the date) from the user’s response.

System tool node

Executes deterministic system operations:
Available system tools:

Example: DTMF input node

Use case: Secure PIN collection
Always use EncryptInput: true when collecting sensitive information like PINs, credit card numbers, or SSNs. This ensures the AI never sees the raw data.

Example: End call node

Configuration:

FlowApp node

Executes external integrations via the FlowApp plugin system:
Example: Cal.com booking
The FlowApp executes, returns data, and the script continues based on the output ports (success, failure, etc.).
FlowApps are reusable C#/.NET plugins. Once installed, any script can use them without writing code. See the FlowApp documentation to build your own.

Custom tool node

Executes HTTP-based custom tools:
This allows calling any REST API directly from your script without building a full FlowApp.

Edges and flow control

Edges connect nodes and define the conversation flow:

Conditional branching

Nodes can have multiple output ports:
The FlowApp returns a result that determines which edge to follow.

Loops and retries

Edges can create loops for retry logic:

Variables and state management

Variables store conversation state across nodes:

Variable types

Visibility controls

IsVisibleToAgent determines if the AI can see the variable:
IsEditableByAI controls if the AI can modify it:
Use Scriban template syntax to reference variables in nodes: {{ variables.user_name }} or {{ variables.retry_count }}

Script execution flow

When a script runs:
  1. Start node activates when the script is loaded
  2. Current node executes its logic (AI generation, tool call, etc.)
  3. Output port is selected based on the result
  4. Edge is followed to the next node
  5. Variables are updated as nodes execute
  6. Process repeats until an End Call node or transfer occurs

Example execution trace

Multi-script orchestration

Scripts can interact with each other:

Add script to context

Loads an additional script while keeping the current one active:
Use case: Add payment collection flow to appointment booking flow

Transfer to agent

Hands the conversation to a different agent (and their scripts):
Use case: Escalate technical support to supervisor agent
When transferring, variables can be passed to the new agent/script if they’re configured in both contexts.

Best practices

Keep scripts focused

One script = one purpose:
  • ✅ “Appointment Booking Script”
  • ✅ “Payment Collection Script”
  • ✅ “Account Verification Script”
  • ❌ “Do Everything Script”

Use meaningful node names

Your team will thank you:

Design for failure

Always handle error paths:

Test with real conversations

The visual IDE helps, but test with actual voice/text:
  • Users will say unexpected things
  • AI might extract data incorrectly
  • External APIs will fail
  • Timing and latency matter

Use variables strategically

Don’t create variables for everything:

Next steps

Build a script

Step-by-step guide to creating your first conversation flow

Workflows

Add deterministic action flows for complex logic

Tools

Learn about system tools and custom integrations

FlowApps

Build reusable plugins for external services