The AI Function lets you connect your AI integrations to automation processes and external tools. With it, your AI agent can:
-
Collect user data.
-
Trigger workflows.
-
Retrieve information from external systems.
-
Return results directly to the user.
Why Use AI Functions?
Normally, AI canβt access real-time or external data. With AI Functions, you can fill that gap:
-
Example 1: Real-time dataUser: βWhatβs the weather like in New York?ββ AI Function triggers a Weather API β AI provides the answer.
-
Example 2: Lead qualificationIf youβre a real estate agent, AI Functions can automatically collect details from prospects (e.g., budget, location, property type) before handing them over to you.
-
Example 3: Human handoffChitchatbot.ai includes a built-in AI Function (
connect_user_to_human) that instantly transfers a conversation to a live agent. This is active by default for all accounts.

How to Create an AI Function
-
Go to AI Center β AI Tools β AI Functions.
-
Click Add to create a new function.
-
Fill in the following details:

Name
-
Use clear, descriptive names (at least 2 words).
-
Example: Use
get_current_weatherinstead of justweather.
What does this trigger do?
-
Describe the function starting with βAllows the user toβ¦β
-
Example: βAllows the user to book an appointment.β
What data to collect?
-
List the exact data fields you want.
-
Use meaningful names (
email,city,date) instead of random strings. -
Example: For an appointment, collect
date,email, andreason.
What flow is triggered? (Optional)
-
If needed, specify a flow to process the collected data.
-
Example: Trigger an external request to a Weather API.
What is the output message?
-
Define the result the user should see.
-
Example: βYour booking was confirmed.β
-
Important: AI will rewrite and send this message to the user.
β Best practice: Store the message in a custom text field and use that field as the output.
- β Avoid sending it directly from the flow builder.
Example AI Functions
1. book_appointment
-
Does: Allows the user to book an appointment.
-
Data:
date,email,reason -
Output: βYou have successfully booked an appointment.β
2. connect_user_to_human
-
Does: Allows the user to speak to a human agent.
-
Flow: Triggers an Inbox Action that transfers the chat to a human.
-
Output: βYou are now connected to a human agent. We will get back to you soon.β
3. get_current_weather
-
Does: Allows the user to check current weather.
-
Data:
city -
Flow: Connects to a Weather API.
-
Output:
{{data_from_api}}
4. join_email_list
-
Does: Allows the user to subscribe to an email list.
-
Data:
email -
Output: βSuccessβ
5. request_shipping_quote
-
Does: Allows the user to request a shipping quote.
-
Data:
origin_address,destination_address,dimensions,weight -
Flow: Calculates a shipping quote.
-
Output:
{{quote}}
Enabling/Using AI Functions
After creating a function:
-
Edit your AI Agent or AI Action.
-
Enable the function so it can be called during conversations. Agent > AI Tools > Select the function you just created to link it to that agent.

Important Notes
-
Your prompt can strongly influence how an AI function behaves.
-
AI may try to fill in missing details automatically if the user doesnβt provide them. Example: For a restaurant booking, include in your prompt:
βIt is crucial to ask the user for the date and number of guests when making a reservation.β
This ensures AI collects the right data before triggering the function.