Template Interpolation Agent, Say Node & Menu Node

Template Interpolation

Text fields (Say, Agent, Menu prompts) use {{expression}} interpolation:

Syntax

Purpose

Example

{{expression}}

Variable lookup or expression

Hello {{name}}, you have {{items.length}} items

  • {{expression}} — evaluated by the Expression Engine, matches the next }}

  • Simple variable names like {{name}} resolve to a variable lookup

  • Complex expressions like {{items.filter(x => x.active).length}} are fully evaluated

  • The double-brace delimiter avoids collision with JSON content in system prompts

  • Non-printable results (objects, arrays) are JSON-stringified; null/undefined produce empty string

  • Errors preserve the original text and log a warning

What Template Interpolation Means in an Agent Node, Say Node and Menu Node

  • Configure an Agent Node

  • Inside the System Prompt field, you typed: Testing {{

  • As soon as {{ is typed, a template helper dropdown appears

  • The dropdown lists:

    • Variables (var boolean, var number, var userEndpoint, etc.)

    • Slots from Test (agent node) (example tooltip: Variable – boolean)

    • Built‑in functions (fn $addDays, fn $format, fn $now, etc.)

    • JS native objects/functions (Date, Math, parseInt, String, etc.)

This confirms that the System Prompt supports template interpolation using {{ }} syntax, with access to typed variables and runtime helpers.

Last updated

Was this helpful?