For the complete documentation index, see llms.txt. This page is also available as Markdown.

Set Global Variables

Overview

The Global Variables Definition Component (internally identified in the system as set_global_vars) is a utility node focused on data persistence and state management (state management). Its main function is to create or reassign custom memory keys that become available for reading at any later stage of the automation flow, regardless of the channel or branching depth. It acts as the centralized repository of dynamic contact data during chatbot execution.

Configuration Parameters

The node parameterization operates through a dynamic list of key-value entries under the section Variables *:

  • Key (Variable Name): Text input field (left side) where the administrator defines the identifying name of the variable (e.g.: id_person, name, phone). Must not contain spaces or special characters.

  • Value: Text input field (right side) that defines the content stored in the respective key. Accepts the insertion of raw static texts (e.g.: 61999999999) or interpolated dynamic references from previous payloads.

  • + Add item button: Control that inserts a new blank pair of fields (Key and Value) to expand the mapping list.

  • Trash Icon: Quick delete button fixed on the right side of each row to remove obsolete node variables.

Visual Builder

The builder interface was designed to facilitate the vertical organization of records and data inheritance:

  • Inline Key Manager: The linear layout visually groups each variable with its respective destination data, allowing multiple structured saves to be configured within a single action node.

  • Mutability and Reassignment: The editor allows the same key name to be used in different global variable nodes across the canvas. When the contact passes through a new node containing an already existing key, the system performs the value reassignment, overwriting the old data with the new content in real time.

Special Operators

The logical properties of this component manage the data reading syntax and runtime error prevention:

  • Global Reading Notation ({{$data?.nome_variavel}}): After the contact passes through this component, any subsequent block in the flow tree can read and display the saved values using strictly the double-curly-brace syntax combined with the safe navigation operator, for example: {{$data?.name}} or {{$data?.phone}}.

  • Safe Navigation Operator (?.): The use of a question mark followed by a dot in read expressions ensures that the platform ignores and does not crash the flow execution if the queried variable is temporarily null or empty.

  • Synchronous Expression Resolution: As soon as the contact passes through the block, the engine processes and calculates the dynamic expressions (such as {{$data?.manualStart_4iochbjyt...}}), stores the final result in global memory, and instantly dispatches the user to the node's linear output.

Practical Examples

The table below shows classic scenarios for configuring and reading global variables to enrich automation logic:

Variable Name (Key)

Configured Value in the Node

Reading Syntax in Subsequent Nodes

Practical Use Case

name

{{$data?.manualStart_4iochbjyt}}

{{$data?.name}}

Capture the name entered in a manual input form and store it globally to greet the user in future messages.

phone

61999999999

{{$data?.phone}}

Set a static contingency phone number at the start of the flow to route notifications in case of failure.

status_pagamento

Approved (Reassignment)

{{$data?.status_pagamento}}

A node at the beginning sets the variable to "Pending". After receiving the confirmation webhook, this component is triggered and reassigns the value to "Approved", changing the bot's behavior.

Last updated

Was this helpful?