Overview
Variables are what transform simple step sequences into powerful, personalised workflow experiences. They allow you to capture information from any step and make it available throughout the entire workflow, enabling your agents to build context progressively and create coherent, tailored interactions. Without variables, each step would be isolated. You’d ask for a user’s name, but couldn’t remember it in the next step. Variables solve this fundamental problem by creating memory that persists across your entire workflow.Why variables matter
Without variables, agents ask the same questions repeatedly, and users have to provide their information multiple times. Each step exists in isolation, creating frustrating, disconnected experiences. Variables solve this by enabling workflows to remember and build context progressively. When a user shares their company name or role, that information becomes available to every subsequent step, creating natural, personalized conversations that build upon previous responses.How variables work
Basic syntax
Variables use the@variable_name
format to capture and store information.Example:
- Store a user’s company name →
@company_name
- Reference it later → use
@company_name
in any subsequent step.
Variable lifecycle
Variables follow a clear lifecycle within your workflow:- Declaration – Variables are created when first referenced in a step
- Assignment – Values are stored when steps complete execution
- Access – Variables can be read by any subsequent step
- Scope – Variables remain available throughout the entire workflow execution
- Cleanup – Variables are cleared when the workflow completes
Capturing information
Any step type can output information to a variable:- Fulfill goal steps – Store user responses in variables
- RAG search steps – Save retrieved information for later use
- Call LLM steps – Store generated content, analysis, or recommendations
- Print steps – While primarily for output, can store confirmation messages
Using stored information
Once captured, variables can be referenced in any downstream step:- Personalize print step messages with user information
- Use gathered context to inform RAG searches
- Provide relevant user details to LLM analysis steps
- Build dynamic, context-aware responses
Examples
Your first variable workflow
Step 1: Fulfill goal → Prompt:"What's your name?"
→ Store as: @user_name
Step 2: Print step →
"Hello @user_name, nice to meet you!"
This basic example shows how information flows from one step to the next using variables.
Building on the basics
- Step 1: Fulfill goal →
"What's your name?"
(@user_name
) - Step 2: Fulfill goal →
"What do you do for work?"
(@job_title
) - Step 3: Print step →
"Hi @user_name! As a @job_title, you might be interested in..."
Variable types and examples
User information variables
Store personal and professional details to personalize the entire experience.Contextual information variables
Generated content variables
Process state variables
Practical workflow examples
Personalised onboarding workflow
- Fulfill goal →
"What's your name?"
(@user_name
) - Fulfill goal →
"What's your role at the company?"
(@user_role
) - Fulfill goal →
"What industry are you in?"
(@industry
) - RAG search → Find onboarding materials for
@industry
(@onboarding_resources
) - Call LLM → Create personalized welcome message using
@user_name
,@user_role
,@industry
- Print step →
"Welcome @user_name! As a @user_role in @industry, here's your customized onboarding plan..."
Customer support workflow
- Fulfill goal →
"Describe your issue"
(@issue_description
) - Fulfill goal →
"What product are you using?"
(@product_name
) - RAG search → Find solutions for
@product_name
issues related to@issue_description
(@potential_solutions
) - Call LLM → Analyze
@issue_description
against@potential_solutions
(@solution_match
) - Print step →
"Based on your @product_name issue, here are the recommended steps..."
Sales qualification workflow
- Fulfill goal →
"What's your company size?"
(@company_size
) - Fulfill goal →
"What's your main challenge?"
(@main_challenge
) - Call LLM → Score qualification based on
@company_size
and@main_challenge
(@qualification_score
) - RAG search → Find case studies for companies with
@company_size
facing@main_challenge
(@relevant_cases
) - Print step →
"Companies like yours with @company_size employees have successfully solved @main_challenge..."
Best practices for variables
Variable naming rules
- Must start with a letter →
@user_name
✓ - Can contain letters, numbers, underscores →
@user_name_2
✓ - Case sensitive →
@User_Name
and@user_name
are different variables - No spaces allowed →
@user name
✗
- Use descriptive names →
@customer_industry
not@var1
- Follow consistent patterns →
@user_name
,@user_role
,@user_company
- Keep names concise but clear →
@qual_score
not@qualification_scoring_result
Variable scope planning
- Plan which information you’ll need throughout the workflow before building
- Capture broad context early (name, role, industry) for use in multiple steps
- Store specific details (challenges, goals) for later targeted use
- Consider what information might be useful for follow-up workflows
Context-building strategy
- Start with basic information and build complexity progressively
- Use early variables to inform better questions in later steps
- Reference previous responses to show the agent “remembers” and understands
- Create natural conversation flow by connecting responses across steps
Advanced variable techniques
Conditional variable usage
Use variables to create dynamic workflows that adapt based on stored information.Example:
- Step 4: Call LLM → If
@company_size
is"Enterprise"
, recommend enterprise solutions - Step 5: Print step → Tailor message complexity based on
@user_role
Variable chaining
Build new variables from existing ones to create an increasingly sophisticated context.Example:
- Step 3: Call LLM → Combine
@user_role
and@industry
to create@user_persona
- Step 5: RAG search → Find content specific to
@user_persona
- Step 7: Call LLM → Generate recommendations for
@user_persona
facing@main_challenge
Multi-step variable building
Gradually build comprehensive variable sets that inform final outputs.Example:
- Steps 1-3: Collect
@name
,@role
,@company
,@industry
- Steps 4-6: Gather
@challenges
,@goals
,@timeline
- Steps 7-9: Generate
@analysis
,@recommendations
,@action_plan
- Step 10: Print step → Deliver comprehensive response using all gathered context
Common pitfalls and solutions
Over-complicating variable names- Problem:
@user_provided_industry_sector_information
- Solution: Use simple names like
@industry
- Problem: Missing required info in later steps
- Solution: Map out variables before building
- Problem: Using
@user_name
in some steps and@name
in others - Solution: Establish and follow conventions
- Problem:
"Hello @user_name"
displays with missing value - Solution: Add fallbacks and validations
Variable limitations and considerations
Current constraints
- Variables persist only within individual workflow executions
- Cannot share variables between different workflows
- Variable values reset when workflows restart
- Limited to text-based storage
Performance considerations
- Store only necessary information
- Use descriptive names for self-documenting workflows
- Avoid too many similar variables
- Plan usage to reduce redundant collection
Resources for learning more
- Workflow builder includes variable validation and suggestions
- Preview functionality shows variable flow in real-time
- Template library with variable usage examples
- Community forum for sharing techniques and solutions