Overview
- When it runs: Before the agent speaks.
- Execution order: Multiple pre-call actions run sequentially in creation order.
- Variable scope: Variables created here are available through the entire interaction. Only variable values assigned in pre-call actions can be used to personalize the Initial Message and Guidelines.
Create a Pre-Call Action Flow
- Open Studio → Build → AI Agents → Actions tab → Pre-Call.
- Select “Create New Action” and fill in:
- Name: Short, descriptive identifier
- Description: What the action does and why
- Save the action, then click Save & Edit Flow to open the Flow Builder.
Flow Builder
The flow defines what happens before the call starts. Drag nodes from the sidebar and connect them starting from the Start node.API Request Node
Call an external HTTP API and map response fields to variables:- Method: GET, POST, PUT, DELETE, PATCH
- URL: Static URL (e.g.
https://api.example.com/crm/) - Query Params: Key-value pairs, variable-aware
- Headers: Static or variable-aware (e.g.
Authorization) - Body: JSON request body for non-GET methods; variables supported
- Auth Profile: Optional reusable credentials profile — see Auth Profiles for details. Also supports mTLS for APIs that require certificate-based mutual authentication.
- Test Request: Use “Send” to preview response in Data or Meta tabs
- Response Mapping: Map JSON paths to variables (e.g. save
firstNameto{{firstName}}).
Set Variable Node
Assign or overwrite a variable value at any point in the flow without making an API call:- Variable: Choose an existing variable or create a new one.
- Value: Enter a static value or reference another variable (e.g.
{{status}}).
Decision Node
Add conditional branching to your flow based on variable values or expressions:- Condition: Define one or more conditions that evaluate variables (e.g.
{{vipStatus}} == true). - Branches: True and False output paths to route downstream nodes.
Pre-call flows do not support Say nodes as they run before the caller is connected to the agent.
Best Practices
- Keep pre-call flows minimal and optimized to reduce first-utterance latency.
- Map only the fields you need from your backend to simplify variable usage.
- Use consistent, readable variable names (e.g.
customerFirstName,orderId).