Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.tryhamsa.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Set Local Variables nodes assign values to variables without any conversation. They execute instantly and automatically advance to the next connected node. Use them to initialize data, transform values, or prepare variables before they’re needed downstream. Key characteristic: No conversation, no user interaction. The node sets variables and immediately moves on.

When to Use

Use Set Local Variables nodes to:
  • Initialize variables before a conversation or tool node needs them
  • Transform data — reformat, combine, or compute values from existing variables
  • Set defaults — provide fallback values for variables that may not be extracted yet
  • Prepare API parameters — assemble values before a tool node call
  • Store computed results — save derived data for later use in the flow

Core Configuration

{
  type: "set_local_variables",
  label?: string,
  description?: string,

  // Variables to set
  staticVariables?: Array<{
    id: string,
    name: string,            // snake_case, 1-50 chars
    description?: string,
    dataType: "string" | "number" | "boolean" | "array" | "object",
    value: string | number | boolean | any[] | object | null
  }>,

  // Transition (automatic — cannot be modified)
  transitions: Transition[]  // Single auto-transition to next node
}
Variables set in this node are available to all downstream nodes in the flow.

Variable Configuration

Each variable has four fields:
FieldRequiredDescription
NameYesVariable name in snake_case format
TypeYesData type: String, Number, Boolean, Array (JSON), Object (JSON)
ValueYesThe value to assign — static or {{variable}} reference
DescriptionNoOptional description for documentation

Value Input by Type

TypeInputExample
StringText input with variable support"hello" or {{user_name}}
NumberNumeric input with variable support42 or {{order_total}}
BooleanToggle switchtrue / false
ArrayJSON editor["item1", "item2"]
ObjectJSON editor{"key": "value"}
All value inputs support {{variable}} references, allowing you to set a variable based on another variable’s value.

Use Cases & Examples

Example 1: Initialize Variables Before a Loop

Set Local Variables: Init_Counter
  variables:
    - name: attempt_count
      type: number
      value: 0
    - name: max_attempts
      type: number
      value: 3

  → Attempt_Action

Example 2: Combine Variables

Set Local Variables: Build_Full_Name
  variables:
    - name: full_name
      type: string
      value: "{{first_name}} {{last_name}}"

  → Greet_Customer

Example 3: Set Defaults

Set Local Variables: Set_Defaults
  variables:
    - name: language
      type: string
      value: "en"
    - name: priority
      type: string
      value: "normal"

  → Collect_Info

Example 4: Prepare API Parameters

Set Local Variables: Prepare_Booking
  variables:
    - name: booking_payload
      type: object
      value: {"customer_id": "{{customer_id}}", "date": "{{selected_date}}", "time": "{{selected_time}}"}

  → Submit_Booking_Tool

Transitions

Set Local Variables nodes use an automatic transition — they execute and immediately advance to the next connected node. You cannot add, remove, or edit transitions on this node type. Connect the node’s output to the next node in your flow. The connection is always unconditional.

Flow Examples

Pattern: Initialize → Collect → Process

Pattern: Transform Between Nodes


Next Steps

Change Agent Settings

Override agent settings mid-flow

Variables

Learn about the variable system

Tool Node

Execute tools with variable parameters

Router Node

Route based on variable values