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:- Selection: Choose another prompt from your project as the variable source
- Execution: The system executes the selected prompt with the current context
- 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 columnsuserId 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 Type | Cause | Result |
|---|---|---|
| Circular Dependency | Prompt A calls B, B calls A | Execution stops immediately |
| Missing Column | Variable references a non-existent dataset column | Execution fails before the run starts |
| Prompt Failure | Referenced prompt fails or times out | Parent 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