Skip to main content
Prompt variables enable Prompt Chaining, where the output of one AI instruction serves as the input for another. This transforms static prompts into modular, agent-like workflows.

Key Capabilities

Prompt variables provide powerful orchestration capabilities:
  • Recursive Resolution: The system resolves nested variables automatically, allowing complex prompt hierarchies
  • Parallel Execution: Independent prompts are executed simultaneously to reduce latency
  • Dependency Management: The system automatically detects and blocks circular dependencies (e.g., Prompt A → Prompt B → Prompt A)

How It Works

When you use a prompt variable:
  1. Selection: Choose another prompt from your project as the variable source
  2. Execution: The system executes the selected prompt with the current context
  3. Integration: The output of the referenced prompt becomes the value of your variable

Data Flow

  • Column Access: Child prompts can reference any column available in the parent dataset
  • Context Preservation: The full context of the parent prompt’s dataset row is available to child prompts

Example

If your parent prompt has a dataset with columns userId and query, and you create a prompt variable that references another prompt, that child prompt can access both {{userId}} and {{query}} from the parent dataset.

Dataset Integration

When prompt variables are linked to datasets, they function as Dynamic Columns:
  • Row-Level Execution: Each row in your dataset triggers its own unique prompt execution
  • Sequential vs. Parallel: Dependent variables (where one relies on the result of another) run sequentially, while independent variables run in parallel
  • Persistence: Results are stored within the dataset cells and can be used for subsequent evaluations

Execution Behavior

  • Timeout: Each prompt execution has a 120-second timeout
  • Nested Resolution: The system automatically resolves nested variables across multiple levels
  • Performance: While recursive resolution is supported, performance may degrade with deep nesting (recommended: 2-3 levels)

Limitations

To ensure system stability, the following limits apply:
  • Circular Dependencies: Automatically detected and blocked - execution stops immediately if detected
  • Resolution: If a variable is not found in the dataset, the placeholder (e.g., {{variable_name}}) remains as raw text
  • Variable Resolution: The system automatically resolves nested variables across multiple levels from parent prompt linked dataset only. Child prompts linked dataset are ignored, variables referenced in child prompt must be present in the parent prompts linked dataset.

Error Handling

Error TypeCauseResult
Circular DependencyPrompt A calls B, B calls AExecution stops immediately
Missing ColumnVariable references a non-existent dataset columnExecution fails before the run starts
Prompt FailureReferenced prompt fails or times outParent prompt fails; error propagates

Best Practices

  • Architecture: Limit nesting to 2–3 levels to maintain speed and debuggability
  • Naming: Use descriptive names (e.g., {{user_purchase_history}} instead of {{var1}})
  • Testing: Test child prompts independently before integrating them into a complex chain
Variable names must follow specific naming rules. See Variable Name Constraints for detailed information about allowed characters and naming conventions.

Use Cases

Prompt variables are ideal for:
  • Multi-Step Reasoning: Break complex tasks into smaller, focused prompts
  • Agent Workflows: Build agent-like systems where one prompt’s output informs the next
  • Modular Design: Create reusable prompt components that can be combined in different ways