Skip to main content

What are Functions?

Functions give your AI agent the ability to perform actions during calls. They enable real-time capabilities like transferring calls, ending conversations, booking appointments, and executing custom logic. Two Categories:
  • Built-in Functions - Pre-configured actions (transfer, end call, scheduling)
  • Custom Functions - Your own logic (API calls, custom code)

Built-in Functions

Ready-to-use functions for common call management and scheduling tasks.

Call Management

Control call flow and routing.

Scheduling (Cal.com)

Book appointments and check availability using Cal.com integration.

Custom Functions

Create your own functions with API integrations or custom code.

Three Types

Modes

Basic Mode - API integration without code
  • Configure API endpoints
  • Map variables to parameters
  • Perfect for existing APIs
Advanced Mode - Write custom code
  • Python (pre-call, in-call)
  • JavaScript (post-call)
  • AI-powered code generation

Custom Functions Guide

Complete guide to creating custom functions

How Functions Work

Built-in Functions

  1. Add Function - Configure in agent settings
  2. Set Parameters - Phone numbers, descriptions, Cal.com details
  3. AI Triggers - AI decides when to call based on description
  4. Action Executes - Function runs automatically

Custom Functions

Pre-Call:
[Pre-Call Function] → [System Prompt Updated] → [Call Starts]
In-Call:
[AI Detects Trigger] → [Function Executes] → [AI Uses Result]
Post-Call:
[Call Ends] → [Conditions Check] → [Function Executes]

Common Use Cases

Built-in Functions

  • Transfer: Route to human agents, specialists, departments
  • End Call: Complete resolved conversations gracefully
  • Scheduling: Book appointments, check calendars

Custom Functions

Pre-Call:
  • Fetch user preferences from database
  • Customize greeting based on region
  • Load context from CRM
In-Call:
  • Check product availability
  • Validate customer data
  • Query databases
  • Call external APIs
Post-Call:
  • Calculate next date of action (NDOA)
  • Update CRM with call results
  • Send follow-up emails
  • Generate reports

Quick Start

1

Choose Function Type

Built-in for common tasks, custom for specific needs
2

Configure Function

Set parameters (built-in) or create logic (custom)
3

Add Description

Tell AI when to trigger the function
4

Test

Make test calls to verify function behavior

Best Practices

  • Clear descriptions - Be specific about when AI should call functions
  • Test thoroughly - Verify functions work in different scenarios
  • Error handling - Handle failures gracefully in custom functions
  • Keep focused - One function, one purpose
  • Monitor usage - Review function calls in analytics
Start with built-in functions for standard tasks, then add custom functions as your needs grow.

Next Steps

Choose a function category to get started: