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:
  1. Declaration – Variables are created when first referenced in a step
  2. Assignment – Values are stored when steps complete execution
  3. Access – Variables can be read by any subsequent step
  4. Scope – Variables remain available throughout the entire workflow execution
  5. 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.
@user_name - "Sarah"
@user_role - "Marketing Manager"
@company_name - "TechStart Inc"
@industry - "Software Development"
@team_size - "15 people"

Contextual information variables

@user_challenge - "We struggle with lead qualification"
@success_picture - "20% increase in qualified leads"
@current_tools - "HubSpot, Mailchimp, LinkedIn Sales Navigator"
@timeline - "Need solution implemented within 3 months"
@budget_range - "$5,000-$15,000 annually"

Generated content variables

@smart_goal - Generated SMART goal based on user inputs
@action_plan - Customized recommendations and next steps
@case_study - Relevant case study retrieved from knowledge base
@analysis_summary - LLM analysis of user situation
@recommendation_list - Prioritized list of solutions

Process state variables

@qualification_score - Numeric score based on responses
@complexity_level - "Basic", "Intermediate", or "Advanced"
@escalation_needed - "Yes" or "No"
@approval_status - "Pending", "Approved", or "Rejected"
@next_action - Determined next step based on workflow logic

Practical workflow examples

Personalised onboarding workflow

  1. Fulfill goal → "What's your name?" (@user_name)
  2. Fulfill goal → "What's your role at the company?" (@user_role)
  3. Fulfill goal → "What industry are you in?" (@industry)
  4. RAG search → Find onboarding materials for @industry (@onboarding_resources)
  5. Call LLM → Create personalized welcome message using @user_name, @user_role, @industry
  6. Print step → "Welcome @user_name! As a @user_role in @industry, here's your customized onboarding plan..."

Customer support workflow

  1. Fulfill goal → "Describe your issue" (@issue_description)
  2. Fulfill goal → "What product are you using?" (@product_name)
  3. RAG search → Find solutions for @product_name issues related to @issue_description (@potential_solutions)
  4. Call LLM → Analyze @issue_description against @potential_solutions (@solution_match)
  5. Print step → "Based on your @product_name issue, here are the recommended steps..."

Sales qualification workflow

  1. Fulfill goal → "What's your company size?" (@company_size)
  2. Fulfill goal → "What's your main challenge?" (@main_challenge)
  3. Call LLM → Score qualification based on @company_size and @main_challenge (@qualification_score)
  4. RAG search → Find case studies for companies with @company_size facing @main_challenge (@relevant_cases)
  5. 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
Reserved variable names (cannot be used):
@step_number
@workflow_id
@timestamp
@system_status
Naming recommendations:
  • 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:
  1. Steps 1-3: Collect @name, @role, @company, @industry
  2. Steps 4-6: Gather @challenges, @goals, @timeline
  3. Steps 7-9: Generate @analysis, @recommendations, @action_plan
  4. 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
Not planning variable flow
  • Problem: Missing required info in later steps
  • Solution: Map out variables before building
Inconsistent variable references
  • Problem: Using @user_name in some steps and @name in others
  • Solution: Establish and follow conventions
Forgetting to handle empty variables
  • 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