GitBook Assistant Ask chevron-down Enterprise Guides Variables and Dynamic Content Use variables in PromptOwl for dynamic prompts - system variables, custom inputs, artifact data, and block output chaining.
This guide explains how to use variables in PromptOwlarrow-up-right to create dynamic, reusable prompts that adapt to different contexts and inputs.
Table of Contents
Understanding Variables
Variables allow you to insert dynamic content into your prompts at runtime.
Why Use Variables?
Same prompt, different company names
Include user-specific context
Pass output between blocks
Variable Types Overview
{company_name}, {product}
{context} → artifact content
Variable Syntax
Variables use curly braces: {variable_name}
Examples:
Where Variables Work
Location
Variables Supported
System Variables
PromptOwl provides three built-in system variables automatically available at runtime.
Contains user memories if memory is enabled.
What It Contains:
All user memories as formatted text
Categorized by type (Preferences, Personal, etc.)
Injected automatically when memory is enabled
Example Usage:
Contains the most recent message in the conversation.
What It Contains:
Content of the last user or assistant message
Useful for follow-up processing
Example Usage:
Contains the full conversation history.
What It Contains:
All messages formatted with roles
User and assistant messages included
Example Usage:
System Variable Availability
Variable
Simple Prompt
Sequential
Supervisor
Custom Variables
Define your own variables for dynamic content.
Creating Custom Variables
Find the Variables section
Enter variable name and value
Use {variable_name} in your prompt
Screenshot: Variable Manager Variable Manager Interface
The key used in {name} syntax
Import from artifacts/folders
Example: Company Context
Variables:
Prompt:
Resolved:
Static vs Dynamic Variables
Type
When Resolved
Use Case
Artifact and Folder Variables
Import content from your Data Room into prompts.
Importing an Artifact
In Variables section, click Import
Choose the artifact to import
Artifact content becomes the variable value
Screenshot: Import Artifact Importing a Folder
For RAG (retrieval) rather than direct injection:
In Variables section, click Import
Folder becomes available for AI retrieval
How Artifact Variables Work
Storage Format:
At Runtime:
System detects artifact- prefix
Fetches artifact content from database
Replaces variable with actual content
Content escaped to prevent injection
Artifact vs Folder Import
Import Type
Behavior
Best For
Small, specific documents
AI searches and retrieves
Content Escaping
Artifact content is automatically escaped:
This prevents accidental variable injection from artifact content.
Block Output Variables
Pass outputs between blocks in sequential prompts.
In a sequential prompt:
Output stored as {output_block1id}
Block 2 can reference this output
Chain continues for all blocks
Automatic Block Output Names
The block ID becomes part of the variable name.
Using Block Outputs
In Human Message field:
In Block Instructions:
Default Behavior
If you don't specify a human message for a block:
System automatically uses previous block's output
Format: {output_previousBlockId}
Example: Multi-Stage Analysis
Block 1 (Research):
Output stored as: {output_research}
Block 2 (Analysis):
Output stored as: {output_analysis}
Block 3 (Recommendations):
Question-Based Variables
Collect user input through questions to populate variables.
How Questions Work
Define questions in prompt settings
Questions shown to user at chat start
Answers stored as variables
Creating Questions
Set visibility and requirements
Screenshot: Question Configuration Question Properties
The question shown to user
Variable name for the answer
Whether to show the question
Must be answered to proceed
Run Frequency Options
Ask first time, cache answer
Ask at each conversation start
Example: Personalized Assistant
Questions:
"What is your name?" → {user_name}
"What is your role?" → {user_role}
"What are you working on?" → {current_project}
Prompt:
Memory Variables
Long-term context that persists across conversations.
How Memory Works
User creates memories (persistent context)
Memories categorized by type
When memory enabled on prompt, {memory} variable populated
AI uses memory context in responses
Memory Categories
"I prefer concise answers"
Context for specific prompt
Enabling Memory
{memory} now available in prompt
Using Memory in Prompts
Implicit Use: When memory is enabled, it's automatically included in context.
Explicit Reference:
Memory vs Question Variables
Variable Resolution
Understanding how variables are processed at runtime.
Resolution Order
Custom variables defined on prompt
Artifact/folder content fetched and inserted
Question answers from user input
System variables (memory, last_message, chat_history)
Block outputs from previous blocks
Resolution Process
Handling Missing Variables
Replaced with empty string
Empty string, error logged
Empty string, warning logged
Type Conversion
Variable Naming
Do:
Use descriptive names: {company_overview}
Use underscores for readability: {user_profile_summary}
Be consistent across prompts
Don't:
Use reserved names: {system}, {prompt}
Variable Organization
Group Related Variables:
Artifact Variables
Do:
Use for stable reference content
Keep artifact content focused
Update artifacts when info changes
Don't:
Import very large artifacts inline
Use for frequently changing data
Sequential Workflow Variables
Do:
Name blocks descriptively (helps identify outputs)
Document expected outputs
Handle missing outputs gracefully
Don't:
Create circular references
Skip documenting block purposes
Assume outputs will always exist
Security Considerations
Do:
Sanitize user input in questions
Be careful with artifact content
Test variable injection scenarios
Don't:
Put sensitive data in variables
Trust unvalidated user input
Expose internal variable names
Troubleshooting
Variable Not Resolving
Symptoms: {variable_name} appears in output
Solutions:
Check variable name spelling (case sensitive)
Verify variable is defined
Check variable has a value
Confirm using correct syntax {name} not {{name}}
Artifact Content Empty
Symptoms: Variable resolves to nothing
Solutions:
Check artifact exists in Data Room
Verify artifact has content
Confirm artifact ID is correct
Block Output Missing
Symptoms: Sequential block gets empty input
Solutions:
Verify previous block executed
Check block ID in variable name
Review previous block for errors
Check human message references correct block
Memory Not Appearing
Symptoms: {memory} is empty
Solutions:
Verify memory is enabled on prompt
Check user has created memories
Confirm memories aren't empty
Test with explicit memory content
Question Answers Not Saved
Symptoms: Must re-answer questions
Solutions:
Check run frequency setting
Verify answer was submitted
Check for validation errors
Try clearing and re-answering
Unexpected Characters in Output
Symptoms: Extra {{ or }} in text
Solutions:
This is intentional escaping
Artifact content with braces gets escaped
Review source content if problematic
Consider alternative formatting
Variable Shows "undefined"
Symptoms: Literal "undefined" in output
Solutions:
Variable value is JavaScript undefined
Set explicit empty string instead
Check variable initialization
Quick Reference
Variable Types Summary
System Variables
Common Patterns
Personalization:
Context Injection:
Sequential Chaining:
Variable Checklist