# Global Variables

Global Attributes in Nected allow you to define reusable key-value pairs that can be referenced across all rules and workflows within your workspace. They act as centralized configuration points—similar to environment variables—helping maintain consistency, reduce duplication, and simplify logic maintenance.

With the latest platform update, Global Attributes are now categorized into **Unencrypted** and **Encrypted** types, each tailored for different use cases:

* **Unencrypted Attributes** are suitable for general configuration values like flags, limits, and default parameters.
* **Encrypted Attributes** are designed for secure storage of sensitive information such as API keys, credentials, and tokens.

By defining attributes once at a global level, you gain:

* **Consistency**: Ensure all workflows reference the same value.
* **Maintainability**: Change once, reflect everywhere.
* **Security**: Protect sensitive data with encryption where needed.
* **Flexibility**: Choose between static and dynamic values based on how the attribute should behave at runtime.

In the sections that follow, you’ll learn how to create, manage, and apply these attributes effectively within your automation logic.

### How to Create a Global Variable?

Creating a Global Variable in Nected involves selecting the appropriate attribute type (Unencrypted or Encrypted), defining its key, value, and behavior. Follow the steps below to create a global attribute:

#### Step 1: Go to the Global Attributes Page

From the left-hand navigation panel, click on **Global Attributes**. This opens the attribute management interface, which is divided into two tabs:

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FkXgsQOY9T0vR0ONrNhaI%2FGlobalVariable%20Dynamic%20Data%20Revamp%20Image.jpeg?alt=media&#x26;token=6c208e94-e264-4d1c-8fee-7966e73812b0" alt=""><figcaption></figcaption></figure>

* **Unencrypted**: For general-purpose attributes.
* **Encrypted**: For securely storing sensitive information.

Select either the **Unencrypted** or **Encrypted** tab depending on your use case:

* Use **Unencrypted** for values like flags, thresholds, labels, and configuration data.
* Use **Encrypted** for credentials, secret keys, or tokens that must remain confidential.

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FFQcoDhfYgqPI0pdVk3wE%2FJune%203%20Screenshot%20from%20GlobalVariable%20Revamp.png?alt=media&#x26;token=a9a885b0-a18f-4ddd-97ee-3d9a276a7286" alt=""><figcaption></figcaption></figure>

#### Step 2: Add a New Attribute

Click the **+ Add Value** button. A new entry row will appear where you can define the global variable.

From the dropdown list, choose the appropriate data type based on whether you're creating an **Unencrypted** or **Encrypted** attribute.

| Attribute Category | Supported Data Type | Description                                                                     |
| ------------------ | ------------------- | ------------------------------------------------------------------------------- |
| **Unencrypted**    | **Boolean**         | Stores `true` or `false` values; useful for feature flags or toggle conditions. |
|                    | **String**          | Stores plain text values like names, labels, or messages.                       |
|                    | **Numeric**         | Stores integer or decimal values such as limits, counts, or thresholds.         |
|                    | **Date**            | Stores a date value (e.g., `2025-06-01`) without time.                          |
|                    | **DateTime**        | Stores a full timestamp (e.g., `2025-06-01T14:00:00Z`).                         |
|                    | **JSON**            | Stores structured JSON data using the integrated editor.                        |
|                    | **List**            | Stores an array of values (e.g., comma- or pipe-separated).                     |
| **Encrypted**      | **String**          | Secured storage for sensitive text like API keys or passwords.                  |
|                    | **Numeric**         | Secured numeric values, such as access codes or confidential numbers.           |
|                    | **JSON**            | Encrypted structured data, such as secured configuration objects.               |

{% hint style="success" %}
&#x20;You can use the encrypted values in workflow nodes, and in rule actions.
{% endhint %}

#### Step 3: Provide Key and Value

* **Key**: Enter a unique name that identifies the attribute.
* **Value**: Enter the default value for the attribute. This is required and cannot be left blank.

If you selected **JSON** or **List** as the data type, a dedicated editor will be available:

* Use **Raw mode** for low-code JSON input.
* Use **Pretty mode** for visual input without coding.

#### Step 4: Set the Attribute Mode (for Unencrypted Only)

If you’re creating an **Unencrypted** attribute, select its behavior from the mode dropdown:

* **Static**: A fixed value that remains constant across all uses.
* **Dynamic**: A mutable value that can be updated during workflow or rule execution.

{% hint style="warning" %}
Encrypted attributes do not support dynamic mode. All encrypted values are stored as static for security.
{% endhint %}

Once all fields are populated, click **Save**. The attribute will be added to the list and immediately available for use in rules and workflows.

#### **Adding JSON & LIST attributes:**

To add JSON or LIST attributes, simply click on the **"+Add Value"** and from the dropdown list select JSON/LIST as per your requirement. Then,

1.  For the JSON attribute, you'll get a JSON editor. Just click on the JSON Editor, and the editor will be open like this:\


    <figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FjmS4W9Cxq0I0oVIwpzqY%2FGlobalVariable%20Dynamic%20Data%20Revamp%20Image%20(1).jpeg?alt=media&#x26;token=7cd7be18-e2af-4a80-9f8c-216e31bf7370" alt=""><figcaption></figcaption></figure>
2. Then you can add custom data inside the JSON editor via Raw mode i.e. using low code or via Pretty mode i.e. via no code mode.
3. After adding your custom JSON data inside the editor, you need to test it and simply close it.

The same thing goes for the LIST attribute.

1.  After selecting the LIST attributes, you need to open the list editor.\


    <figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FDnMrMtbufS5JH5N2ebH3%2FGlobalVariable%20Dynamic%20Data%20revamp%20image%20(2).jpeg?alt=media&#x26;token=f705ec24-e648-4e85-989c-dcac4f0ed7b7" alt=""><figcaption></figcaption></figure>
2. Then open the list editor and add the values according to your need. And then test it and simply close it. The list data will be automatically saved.

### Using Global Attributes in Rule Conditions

To reference a Global Attribute within a rule condition:

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2Flc4Qb75zzZLbi8KTmULP%2FJune%204%20Screenshot%20from%20GlobalVariable%20Revamp.png?alt=media&#x26;token=c93e97fe-d652-402a-aacc-dbcabf791a31" alt=""><figcaption></figcaption></figure>

1. In the rule builder, add a new condition.
2. Click the **Property** dropdown.
3. From the dropdown, scroll to the **Global Attributes** section and select the attribute you want to use.

Similarly, for using the global attribute as condition values, in your rule condition:

1. Simply just tap on the “Enter value” field.
2. And then from the dropdown, scrool to the same section and select the attribute value.

**For Rule Result,** you can use the global variable values

Similarly, click on "+Add Result" and add a new result. And in the input field just select the Global attribute from the dropdown.

The selected attribute is inserted using the `globalVar` token format:

```
{globalVar.attribute_name}
```

For example, `{globalVar.annualIncome}` will inject the value of the `annualIncome` global variable into the condition.

### Using Global variable in Workflow Node

Global Variables can be directly referenced as values across multiple nodes within a workflow. These variables help you pass consistent configuration, contextual data, or secrets throughout your automation logic.

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FQgHkd8Ct7NA21alpnInC%2FGlobalVariable%20Dynamic%20Data%20Revamp.png?alt=media&#x26;token=88881194-7964-4760-be47-1b6d1e565858" alt=""><figcaption></figcaption></figure>

You can **use** Global Variables in the following workflow nodes:

* **Rule Node**
* **Workflow Node**
* **Set Variable Node**
* **Response Node**

To use this inside workflow, simply follow these steps:

1. Open the node where you want to assign a value (e.g., input parameter, output value, or transformation logic).
2. Click the **value** field where input is required.
3. From the attribute picker, scroll to the **Global Attributes** section.
4. Select the desired value (e.g., `annualIncome`, `creditScore`, or a nested JSON property).
5. The platform will automatically insert the value into the workflow node logic.

For example, when setting an input in a **Set Variable** node, you can use the value of `{globalVar.creditScore}`, but not its name or structure unless it’s a JSON path.

This ensures your workflows remain clean, secure, and consistent—especially when working with encrypted variables or dynamic values.

### How to Modify Global Variable Values

Global Variables in Nected can be updated in two ways, depending on whether the variable is configured as **Static** or **Dynamic**.

#### Static Variables

Static Global Variables are immutable during runtime. Their values can only be changed manually from the Global Attributes page. Use this mode for constants or configuration values that should not be altered by workflows.

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2FEiwVO4Cx9TVJ8yqcfipB%2FGlobalVariable%20Dynamic%20Data%20Revamp%20Image%20(3).jpeg?alt=media&#x26;token=bef9a3ce-088e-4499-9926-9b7e6ca4dfa4" alt=""><figcaption></figcaption></figure>

To update a static Global Variable:

1. Go to the **Global Attributes** page from the left navigation menu.
2. Locate the attribute you want to change.
3. Modify the **Value** field directly.
4. Click **Update** to save the changes.

> Changes to static variables will be reflected wherever the variable is referenced in rules and workflows.

#### Dynamic Variables

Dynamic Global Variables are mutable at runtime. This means you can update their values during workflow execution using the **Set Variable** node.

To update a dynamic Global Variable via workflow:

1. Open your workflow and add a **Set Variable** node.
2. In the variable assignment section, choose the global variable value you want to modify from the **Global Attributes** list.
3. Assign a new value to it.
4. When the workflow runs, the global variable will be updated, and the new value will be used in subsequent nodes and rules globally.

{% hint style="info" %}
You can still update dynamic variables manually from the Global Attributes page just like static ones, but workflow updates will override them at runtime.
{% endhint %}

**Important Notes:**

* Only **Unencrypted** Global Variables can be dynamic.
* **Encrypted** variables are always static and cannot be modified in workflows.

This dual-mode behavior offers the flexibility to manage both stable configurations and runtime-modifiable values within a single system.

### **Deleting Global Attributes**

The following procedure shows you how to delete an existing global attribute from the Nected platform:

<figure><img src="https://4290782554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLg716fCfV8IUwXQygkTG%2Fuploads%2Ft7WYkESDNMpCxWiOiBub%2FGlobalVariable%20Dynamic%20Data%20Revamp%20Image%20(4).jpeg?alt=media&#x26;token=b728a1dd-64d4-444d-9e1b-37b134c10484" alt=""><figcaption></figcaption></figure>

1. Open the **Global Variable** page by clicking the same button from the left navigation bar.
2. Click the delete icon against the attribute name. Then a **Delete Attribute** dialogue box will open.
3. Click **Delete** to confirm the delete operation.

After you delete the attribute, you must remove it from any rule or workflow that uses this global attribute, else you'll get error.
