Skip to main content
Variables are the backbone of dynamic prompting in Adaline. They let you build a single prompt template that adapts to countless scenarios — replacing static content with placeholders that can be swapped at runtime. Instead of maintaining separate prompts for different customers, use cases, or contexts, you create one powerful template with variables.

How variables work

When you type {{variable_name}} anywhere in a prompt message, Adaline automatically detects it and creates a corresponding entry in the Variable Editor panel. You can then set values for each variable before running the prompt in the Playground. Defining variables in the Adaline Editor

Variable name constraints

Variable names must follow specific rules to ensure compatibility across the platform: Allowed characters:
  • Letters: a-z and A-Z
  • Numbers: 0-9
  • Underscores: _
  • Hyphens: -
ValidInvalid
{{user_question}}{{user question}} (spaces)
{{product_name}}{{user.question}} (period)
{{user-id}}{{user@name}} (special characters)
{{item_123}}{{user/name}} (slash)

Variable types

Adaline supports three types of variables, each suited to a different content modality:

Text variables

The most common variable type. Define them directly in your prompt text using the {{variable_name}} syntax. Without variables:
Write a haiku about nature that captures a peaceful moment.
With variables:
Write a haiku about {{topic}} that evokes {{emotion}} and includes {{element}}
Set values for text variables in the Variable Editor: Setting variable values in the Variable Editor

Image variables

Image variables let you dynamically swap visual inputs without changing the prompt structure. To create one:
  1. Click the image button in a message block.
  2. Select From Variable and give it a descriptive name.
  3. In the Variable Editor, attach the actual image (URL, base64, or file upload).
See Use Images in Prompts for detailed setup steps.

PDF variables

PDF variables work the same way as image variables but for document inputs. To create one:
  1. Click the PDF button in a message block.
  2. Select From Variable and give it a descriptive name.
  3. In the Variable Editor, attach the actual PDF (URL, base64, or file upload).
See Use PDFs in Prompts for detailed setup steps.

Variable sources

Variables can be powered by different sources depending on your workflow needs: Choosing a variable source
SourceDescriptionUse case
StaticDirect text, image, or PDF content set manually in the Variable Editor.Simple testing with fixed inputs.
APIFetches live data from external HTTP endpoints at runtime.Injecting real-time data like user profiles, product catalogs, or live metrics.
PromptExecutes another prompt and uses its output as the variable value.Building agent-like workflows with prompt chaining.
To change a variable’s source:
1

Create a variable

Add a {{variable_name}} placeholder in your prompt text, or create an image/PDF variable through the respective buttons.
2

Select the source type

In the Variable Editor, click on the variable and select the desired source type: static value, API, or Prompt.Selecting a variable source
For detailed configuration of dynamic sources, see:

Dynamic sources in datasets

When your variable uses an API or Prompt source and you have a linked dataset, the dynamic source is executed for each row individually. This means:
  • API variables make a unique HTTP request per row, with placeholders like {{userId}} resolved from that row’s data.
  • Prompt variables execute the referenced prompt once per row, passing the row’s context.
  • Results are stored in the dataset cells and can be used for subsequent evaluations.
Dynamic variable sources in Adaline

Best practices

  • Use descriptive names — Choose names like {{user_purchase_history}} instead of {{var1}} so that team members can understand the prompt at a glance.
  • Keep variables focused — Each variable should represent one piece of data. Avoid packing multiple values into a single variable.
  • Test with linked datasets — Connect a dataset to your variables to efficiently test across many different input combinations.

Next steps

Use APIs in Prompts

Fetch live data from external endpoints at runtime.

Use Other Prompts in Prompts

Chain prompts together for complex workflows.