Skip to main content
Variables let you inject runtime data into your prompts. This guide covers how to add variables and define their types.

Adding Variables

Variables are placeholders in messages that get replaced at runtime:
"Customer {{customer_name}} asks: {{query}}"
Becomes:
"Customer Alice asks: How do I reset my password?"

Insert a Variable

1

Open message editor

Click on the message you want to edit.
2

Type /variable

In the editor, type /variable to open the variable menu.
3

Select or create

  • Select an existing property
  • Or create a new one
4

Configure

Set the variable format:
  • Inline: Embedded in text
  • Block: On its own line

Message Editor

The TipTap editor provides a rich editing experience:
Message editor with TipTap
Features:
  • Rich text formatting
  • Variable insertion via /variable command
  • Auto-save as you edit
  • Visual distinction between text and variables

Variable Syntax

Variables appear as {{variable_name}} in the editor:
System: You are a support agent for {{company_name}}.

User: Customer: {{customer_name}}
Query: {{query}}

Relevant documents:
{{search_results}}

Properties

A Property defines a variable’s type and metadata.

Creating Properties

1

Open Properties

In your task, click Properties in the sidebar.
2

Create Property

Click Create Property.
3

Define the type

Configure the property:
  • Name: Variable name (e.g., query)
  • Type: string, number, object, array, etc.
  • Description: What this variable represents
  • Required: Whether it must be provided

Property Types

TypeUse CaseExample
stringText valuesUser queries, names
integerWhole numbersCounts, IDs
numberDecimalsScores, prices
booleanTrue/falseFlags
objectStructured dataUser profiles
arrayListsSearch results

String Formats

Strings can have special formats:
{
  "type": "string",
  "format": "date"
}
Available formats:

Complex Types

Objects

Define nested structures:
{
  "type": "object",
  "properties": {
    "id": {"type": "string"},
    "name": {"type": "string"},
    "email": {"type": "string", "format": "email"}
  },
  "required": ["id", "name"]
}
In the editor:
User profile: {{user}}
In code:
session_data = Input(
    user=User(id="123", name="Alice", email="alice@example.com")
)

Arrays

Define lists:
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "title": {"type": "string"},
      "content": {"type": "string"}
    }
  }
}
In the editor:
Search results:
{{documents}}
In code:
session_data = Input(
    documents=[
        Document(title="FAQ", content="..."),
        Document(title="Guide", content="...")
    ]
)

Input Schema Auto-Sync

When you add variables to messages, the prompt’s input schema updates automatically.

How It Works

1. You add {{query}} to a message

2. System detects the variable

3. Links to property "query"

4. Adds "query" to input schema

5. Codegen produces typed model with "query" field

Viewing the Input Schema

  1. Open your prompt
  2. Click Schema tab
  3. See all variables and their types

Schemas Tab

View all schemas in the Schemas tab:
Schemas tab overview
The tab shows:
  • Input Schemas: Auto-generated from prompt variables
  • User-Defined Schemas: Custom schemas for tools and structured output

Variable Formatting

Inline Variables

Embedded within text:
"Hello {{customer_name}}, how can I help?"

Block Variables

On their own line, typically for larger content:
Context from search:
{{search_results}}

Choosing Format

Use Inline WhenUse Block When
Short valuesLong content
Part of a sentenceStandalone section
Names, IDsJSON, documents

Referencing the Same Property

You can use the same property multiple times:
System: You help customers of {{company_name}}.

User: {{company_name}} customer {{customer_name}} asks:
{{query}}
The same value is substituted everywhere.

Required vs Optional

Mark properties as required or optional:
{
  "type": "object",
  "properties": {
    "query": {"type": "string"},           // Required
    "context": {"type": "string"}          // Optional
  },
  "required": ["query"]
}
In code:
class Input(RenderableModel):
    query: str                    # Required
    context: str | None = None    # Optional

Default Values

Properties can have default values:
{
  "type": "string",
  "default": "You are a helpful assistant."
}
If not provided at runtime, the default is used.

Best Practices

customer_query is better than q or input1.
Descriptions help teammates understand what each variable is for.
Use specific types (integer, date) rather than just string when possible.
Each prompt should only have the variables it actually uses.

Next Steps