Functions
Define workflow actions, HTTP requests, integrations, and built-in functions in YAML.
Functions give the assistant actions it can call during a conversation. Define
them as YAML arrays in functions.yaml. Each function needs name,
description, args, and execution; use args: [] when it takes no arguments.
Scope and names
| File | When its functions are available | Limit |
|---|---|---|
reception/functions.yaml | Throughout the call, including during workflows. | 16 |
reception/workflows/booking/01-details/functions.yaml | While that step is active, alongside assistant-level functions. | 17 |
The assistant-level file is optional and defaults to an empty list. Every step
requires its own file, which can contain [].
Names must match [a-z][a-z0-9_]{0,63}: start with a lowercase letter and use
lowercase letters, digits, or underscores, up to 64 characters. Names must be
unique in each file, and step functions must not reuse an assistant-level name.
Different steps can reuse names because their functions are not active together.
Descriptions must be nonempty and at most 2,048 characters. Explain when the assistant should call the function and any information it must collect first.
Execution types
execution.type | execution.operation | Purpose |
|---|---|---|
builtin | start_workflow | Enter the first step of a named workflow. |
builtin | transition | Continue, exit, regress and return, or jump to a specific step in any workflow of this assistant. |
builtin | save_variable | Save argument values for use later in the call. |
builtin | human_transfer | Transfer the caller using dashboard transfer settings. |
builtin | send_sms | Send an SMS using the configured sender. |
builtin | integration | Run an action on a connected integration. |
custom | No operation field | Send an HTTPS request to your service. |
Append the following examples to the appropriate functions.yaml array. Keep
the existing start_booking function when extending the receptionist example.
Arguments
Each argument requires a name, type, and nonempty description of at most
500 characters. Argument names use the same format as function names and must be
unique among siblings. call_sid is reserved for Neuroline.
| Type | Value or additional fields |
|---|---|
string | Text. |
number | A number, including fractions. |
integer | A whole number. |
boolean | true or false. |
any | An unrestricted value. |
object | Add a properties array of argument definitions. |
union | Add an alternatives array with at least two argument definitions. |
There can be at most 16 arguments in each list, including object properties and
union alternatives. Objects and unions can nest up to three levels. Fields such
as required, default, and enum are not supported; ordinary typed arguments
must be supplied when the function is called.
Save variables
Save collected values to the current call's context. Later steps can read them from the Variables context. Saving the same name again replaces its value; these values are not stored as a record for future calls.
- name: save_request
description: Save the caller's confirmed name and preferred appointment time before proceeding.
args:
- name: caller_name
type: string
description: The caller's full name.
- name: preferred_time
type: string
description: The requested date and time, including the timezone.
execution:
type: builtin
operation: save_variableAdd this alongside proceed and update the step prompt to call save_request
before advancing. This operation requires at least one argument.
For structured values, an argument can contain properties and alternatives:
args:
- name: request
type: object
description: Appointment preferences provided by the caller.
properties:
- name: party_size
type: union
description: The number of attendees, or a description if it is not yet known.
alternatives:
- name: exact_count
type: integer
description: The confirmed number of attendees.
- name: estimate
type: string
description: The caller's estimate in their own words.HTTP functions
- name: lookup_booking
description: Look up an existing booking after the caller provides its reference.
args:
- name: reference
type: string
description: The booking reference provided by the caller.
execution:
type: custom
url: https://api.example.com/bookings/lookup
method: POST
headers: {}
timeout: 5000Replace the example URL with your service's HTTPS endpoint. All execution fields
shown above are required. Supported methods are POST, PUT, PATCH, GET, and
DELETE. timeout is in milliseconds, from 1,000 to 20,000 in increments of
1,000. Assistant silence timeouts in config.yaml use seconds instead.
POST, PUT, and PATCH send arguments as JSON; GET and DELETE put them in
the query string. Neuroline adds call_sid automatically. Objects in query
parameters are JSON-encoded. Successful response text is returned to the
assistant; non-success responses and timeouts fail the function. Redirects are
not followed.
headers is a map of header names to string values, with at most 16 entries.
Header values are literal; repository files do not interpolate environment
variables or secret references. For supported providers, use an integration to
keep credentials in the dashboard.
Integration functions
First sync the assistant without integration functions. Then connect the provider on that assistant's integrations page in the dashboard and configure the resources it may use. Add its functions in a subsequent commit.
For example, this function lists slots from a connected Cal.com account:
- name: list_slots
description: List available times for an enabled Cal.com event type before offering an appointment.
args:
- name: event_type_id
type: string
description: Exact enabled Cal.com event type ID.
- name: start
type: string
description: Range start as an ISO 8601 date-time.
- name: end
type: string
description: Range end as an ISO 8601 date-time, no more than 31 days after start.
- name: time_zone
type: string
description: IANA time zone for the returned slots.
execution:
type: builtin
operation: integration
actionId: calcom.list_slotsactionId selects the provider action. With bindingId omitted, Neuroline
resolves the assistant's connected integration for that provider. An explicit
bindingId must identify a connection owned by this assistant and match the
action's provider. Missing, disconnected, ambiguous, or mismatched connections
fail the import.
Argument names, types, and structure must match the action's definition. You can customize descriptions; configured resource hints are retained. Update the step prompt to call the action and offer only returned availability. Listing slots does not create a booking.
Human transfer and SMS
- name: human_transfer
description: Transfer the caller to a person when they request one.
args: []
execution:
type: builtin
operation: human_transfer
- name: send_sms
description: Send a short SMS to the caller when they ask for or approve it.
args:
- name: to
type: string
description: Exact caller phone number from the call context.
- name: message
type: string
description: SMS body, up to 1000 characters.
execution:
type: builtin
operation: send_smsEnable and configure human transfers in the dashboard. The transfer function is available only when transfers are enabled and a transfer is currently available, including any working-hours restrictions.
Configure an SMS sender in the dashboard to make send_sms available. Messages
can be sent only to the caller's number from call context, are limited to 1,000
characters, and are capped at three per call. Keep the argument names and types
shown above for these built-in operations.