What is the "Functions (with AI)" Component in wolkvox Studio and How to Configure It
Table of Contents
Introduction
The "Functions (with AI)" component is designed to enhance the capabilities of the "Conversations" component. It allows artificial intelligence not only to understand the natural language of customers but also to execute real actions during the conversation, such as querying external APIs, managing databases, or interacting with third-party systems.
This component enables the creation and storage of PHP functions that the AI in the "Conversations" component can autonomously invoke at the right moment, based on the conversation context. The functions do not require the virtual agent to "exit" the conversational flow to execute additional logic: everything happens transparently and in real time while the assistant continues interacting with the customer.
How Does It Work with the "Conversations" Component?
The "Functions (with AI)" component acts as a library of PHP functions available to the "Conversations" component. Once the functions are created, they can be individually activated or deactivated from the configuration panel of the "Conversations" component, under the "Functions" tab. The AI decides when and how to call each function based on the detected intent in the conversation.
Availability
The "Functions (with AI)" component is available for routing points of the following types:
- Voice (IVR): The assistant recognizes the customer's request via voice (ASR), determines which function to execute, and responds with voice synthesis (TTS), all within the same call.
- Chat (ChatBot): The assistant interprets text messages, and even images or screenshots sent by the user (such as tables with data), to execute multiple operations in a chained manner within a single chat session.
Important Note: Only one instance of the "Functions (with AI)" component can exist per canvas. This component is placed independently of the main flow: it is not connected via arrows to other components in the routing point. It functions as a global library that the "Conversations" component accesses during execution.
Suggested Use Cases
Voice Routing
- Dialing Campaign Management: A supervisor calls the IVR, verbally indicates which predictive campaigns to activate or pause, and the system executes the operations via the wolkvox API without manual intervention.
- Balance or Account Status Inquiry: The customer calls and requests information about their balance; the AI queries the billing system using a PHP function and responds with updated data.
- Ticket Creation in External Systems: During a call, the assistant gathers the customer's problem information and automatically opens a ticket in tools like Zendesk, Freshdesk, or internal systems via API.
- Identity Verification: The AI queries an internal database to validate whether the customer's document number or PIN is correct before proceeding with the service.
- Appointment Scheduling: The assistant collects the date, time, and type of service, and registers the appointment directly in the company's scheduling system through a function that consumes its API.
Chat Routing
- Campaign Management via Image: The chat agent can receive a screenshot with a table of campaigns, identify the IDs, and execute the requested actions on each one.
- Dynamic Inventory Queries: The customer asks about product availability; the AI calls the corresponding function, queries the ERP or inventory system, and responds with availability, prices, and delivery times in real time.
- Quotation or Summary Generation: Based on the conversation, the AI can build and send summaries of what was agreed, registering them in the customer's CRM via a PHP function.
- Customer Data Update: The user requests to change their email or address; the AI executes the function that updates the record in the system and confirms the change within the same conversation.
- Automatic Notifications and Alerts: When a specific intent is detected, the AI can trigger alerts via email, SMS, or internal systems using PHP functions with external integrations.
How to Configure the "Functions (with AI)" Component
- Add the component to the canvas. From the wolkvox Studio canvas, in the "Cognitive" tab, search for and drag the "Functions (with AI)" component to the workspace.
- Important: Place this component outside the main flow. It should not be connected with arrows to any other component. Its presence on the canvas is sufficient for it to be available to the "Conversations" component.
- Double-click on the "Functions (with AI)" component to open its configuration panel.

In the "Function Name" field, you will find a dropdown menu listing the already created functions. To create a new one:
Click on the "+" button located next to the dropdown menu.

In the function name field, the AI will automatically create a descriptive name that matches what the function does. For empty functions, the name "new_pending" will be created.

To delete an existing function, select it from the dropdown menu and click the "-" button.

Use the "Draft the Request:" field to describe in natural language what the function should do. Then click the "Generate with AI" button. The AI will produce the corresponding PHP code, including validations, API calls, and error handling.

- The "Description" field is automatically filled by the AI. It briefly describes what the function does (e.g., "Starts or stops a specific wolkvox campaign using its ID and the desired status"). You can manually edit it if desired.
- In the "PHP" area, you can manually modify the code: If you already know the logic and necessary endpoints, directly edit the PHP code of the function.
- Tip: If the function requires credentials such as authentication tokens, API keys, or specific URLs for your environment, review the code generated by the AI and incorporate them manually in the corresponding fields before saving.
- Click the "Save" button to store the changes.
- Then click the "Close" button to exit the panel.
- Important Warning: If you close the panel using the "X" button in the top left corner, the configuration will not be saved, even if you previously clicked "Save." Always use the "Close" button to exit properly.

For the AI to use the created functions, you must enable them within the "Conversations" component:
- Double-click on the "Conversations" component on the canvas to open its configuration panel.
- Go to the "Functions" section.
- You will see a table with all available functions from the "Functions (with AI)" component, showing their name, description, and variables. Enable the ones you want to use by checking their corresponding checkbox.
- Unselected functions remain available in the "Functions (with AI)" component but will not be invoked by the AI in this conversational flow. This allows you to maintain a reusable function library and selectively activate them in each routing point.
- In the "Goal, Conversation Tone" tab, write a prompt that is consistent with the enabled functions. The AI will use this context to know when and how to invoke each function.
- Tip: The prompt should guide the AI on the assistant's purpose, process constraints (such as ID formats), and any contextual information that helps the AI invoke the functions correctly and timely.
- Click "Save" to apply the changes.
- Remember to compile your flow once you finish configuring all the components you have placed.
