Skip to main content
This page documents two core ABL capabilities: rich content output formats (voice, cards, carousels, interactive actions, templates) and the expression language (operators, functions, template interpolation).

Rich Content

ABL supports multi-format output for delivering responses across different channels (web, mobile, voice, messaging platforms). The VOICE:, RICH_CONTENT:, and ACTIONS: blocks can be attached to any RESPOND statement, COMPLETE condition, or lifecycle handler.

Overview

A single response can include:
  • Plain text — the default RESPOND string.
  • Voice configuration — SSML markup or natural language voice instructions.
  • Rich content — Markdown, Adaptive Cards, HTML, Slack Block Kit, WhatsApp, or AG-UI.
  • Carousels — scrollable card collections with images and buttons.
  • Interactive actions — buttons, select menus, and input fields.
  • Templates — reusable named response definitions with interpolation.
The runtime selects the appropriate format based on the delivery channel.

Voice configuration

Voice configuration provides channel-specific voice output. The VOICE: block can appear alongside any RESPOND.

Syntax

Voice properties

SSML example

Natural language instructions

For voice platforms that accept style instructions rather than SSML:

Rich content formats

The rich-content block provides format-specific variants of a response. The runtime selects the variant matching the delivery channel.
In the .agent.abl format the block keyword is FORMATS:. The .agent.yaml format accepts rich_content: or formats:. (RICH_CONTENT: is a legacy alias accepted only in flow-step overrides.)

Syntax

Rich content properties

Channel-specific string formats: Structured template formats (channel-neutral; the runtime renders them per channel):
Named templates (in the TEMPLATES: block) may also declare a RENDERABLES: list — customer-owned structured payloads with name, payload, optional targets (api/sdk_websocket/http_async), fallbackText, and schemaRef. Data-rich templates (KPI, TABLE, CHART, LIST, CAROUSEL, …) also support collection binding via from: / template: to render one entry per array item.

Carousels

Carousels display a horizontal scrollable collection of cards, each with a title, subtitle, image, and action buttons.

Syntax

Interactive actions

Interactive actions add buttons, select menus, and input fields to a response. Users interact with these elements, and the agent handles the interactions via ON_ACTION blocks.

Syntax

Action element properties

Select element example

Input element example

Form submission

When the ACTIONS block contains input elements, you can specify a submitLabel and submitId for the form submission button:

ON_ACTION handlers

Handle user interactions with action elements in flow steps:
The ON_ACTION handler properties are described below. If a handler RESPOND includes rich FORMATS: before terminal routing, that payload is forwarded as the fallback final channel payload. The terminal target’s own rich payload takes precedence.

Templates

Templates are named, reusable response definitions declared in the TEMPLATES: block. They support {{}} interpolation and multi-format variants.

Syntax

Template properties

Referencing templates

Use TEMPLATE(name) in any RESPOND value:

Template interpolation

Templates use {{variable_name}} for value substitution and {{#if variable}}...{{/if}} for conditional sections:

Channel selection

The runtime selects the response format based on the delivery channel: If the preferred format is not available, the runtime falls back through the priority chain until it finds a defined format. Plain text (RESPOND) is always the final fallback.

Expressions and Functions

ABL expressions are used in conditions (WHEN, CHECK, constraint rules), value assignments (SET), template interpolation ({{}}), and function calls. This section documents the expression syntax and all 36 built-in functions.

Expression syntax

Comparison operators

Logical operators

Write logical operators in uppercase (AND, OR, NOT). ! is also accepted as a prefix negation.

Unary operators

Operator precedence

  1. Parentheses ()
  2. Unary operators (NOT, IS SET, IS NOT SET)
  3. Comparison operators (==, !=, >, <, >=, <=, contains, matches)
  4. AND
  5. OR
Use parentheses to override default precedence:

Variable paths and dot notation

Reference variables using dot notation to access nested values:

Path resolution rules

  • The evaluator looks up the full path in the session context.
  • The Platform resolves each segment left to right: user.address.city resolves user, then address on the result, then city.
  • If any segment resolves to null or undefined, the entire path resolves to undefined.
  • Array access uses bracket notation: items[0], items[2].name.

Template strings

Template strings use {{}} syntax for variable interpolation within RESPOND, summary, and other string properties:

Conditional sections

Templates support conditional rendering with {{#if}}...{{/if}}:

Function calls in templates

You can call built-in functions within template strings:

Built-in function reference

ABL provides 36 built-in functions organized into seven categories. All functions are called with FUNCTION_NAME(arg1, arg2, ...) syntax. Function names are uppercase.

Math functions

| Function | Signature | Description | Example | | -------- | ------------------------------- | ---------------------------------------------- | --------------------------------------------------- | ------------------------ | | ADD | ADD(a, b) -> number | Add two numbers. | ADD(2, 3) returns 5 | | SUB | SUB(a, b) -> number | Subtract b from a. | SUB(10, 3) returns 7 | | MUL | MUL(a, b) -> number | Multiply two numbers. | MUL(4, 5) returns 20 | | DIV | DIV(a, b) -> number | null | Divide a by b. Returns null for division by zero. | DIV(10, 2) returns 5 | | ROUND | ROUND(n, decimals?) -> number | Round to specified decimal places. Default: 0. | ROUND(3.14159, 2) returns 3.14 | | ABS | ABS(n) -> number | Absolute value. | ABS(-5) returns 5 | | MIN | MIN(a, b) -> number | Return the smaller of two numbers. | MIN(3, 7) returns 3 | | MAX | MAX(a, b) -> number | Return the larger of two numbers. | MAX(3, 7) returns 7 | Math functions coerce string arguments to numbers automatically: ADD("2", "3") returns 5.

String functions

The string functions gracefully handle null and undefined and return an empty string: UPPER(null) returns "". To prevent memory issues, the limit on string output is 100,000 characters.

Formatting functions

The mask patterns are explained below. The default mask character is *. Pass a third argument to use a different character: MASK(ssn, "last4", "x"). The date format uses the following notations: Example: FORMAT_DATE("2024-03-15T10:30:00Z", "YYYY-MM-DD HH:mm") returns "2024-03-15 10:30".

Type checking and coercion functions

Array functions

Object functions

OBJECT_KEYS and OBJECT_VALUES return an empty array for non-object inputs (null, arrays, strings). OBJECT_MERGE accepts any number of arguments and skips non-object values.

Utility functions

COALESCE considers 0 and false as valid (non-null) values: COALESCE(0, "fallback") returns 0. UNIQUE_ID generates a random alphanumeric string suitable for reference numbers. It is not cryptographically secure — do not use it for tokens or secrets.

Content-analysis functions (CEL guardrails)

CEL-based guardrail checks have access to an additional abl.* namespace of content-analysis helpers:
In CEL expressions the core functions above are also available under the abl. namespace with lowercase names (e.g. abl.upper(x)), and CEL-native operators (&&, ||, !, %, in, ternary ? :) and macros (size(), has()) can be used.

Nested function calls

Functions can be nested as arguments to other functions:
Nesting is limited to a maximum depth of 32 to prevent stack overflow.

Using expressions in ABL

In conditions (WHEN, CHECK, constraint rules)

In SET assignments

In template interpolation

In TRANSFORM pipelines

Type coercion rules

The evaluator applies these coercion rules during expression evaluation: