Overview

The Global Variable Node allows you to define, store, and retrieve global variables within your Pathlit workflows. This node provides an easy and efficient way to manage variables that need to be accessible across different parts of your workflow, enabling more dynamic and flexible automation scenarios.

Configuration Parameters

The Global Variable Node requires minimal setup. You can configure the following parameters directly within the node:

  • Variable Name:

    The name of the global variable you wish to store or retrieve. This name is used as a key to identify the variable across the workflow.

  • Default Value:

    The default value assigned to the global variable. This value is used if no other value has been set during workflow execution.

Expected Inputs and Outputs

  • Inputs:

    • When retrieving a variable, this node does not require any inputs.
    • When storing a variable, the input should be the value you want to save globally.
  • Outputs:

    • The node outputs the current value of the global variable.

Use Case Examples

  1. Workflow Settings and Configurations

    Store workflow-wide settings such as API keys, configuration flags, or environment-specific variables. This allows easy access and modification without needing to update each node individually.

  2. Session Management

    Maintain stateful variables across multiple workflow executions, such as user sessions or counters, enabling more complex logic and state management.

  3. Conditional Logic

    Use global variables to control conditional branching in your workflow, allowing dynamic execution paths based on stored values.

Error Handling and Troubleshooting

  • Variable Not Found:

    If the node attempts to retrieve a variable that hasn’t been set, it will return the default value configured. Ensure that a sensible default is provided to prevent unexpected behavior.

  • Variable Overwrite

    If multiple nodes attempt to set the same global variable simultaneously, the last executed node’s value will overwrite previous values. Plan your workflow accordingly to avoid unintended overwrites.

If you encounter issues not addressed here, please contact our support team.

Relevant Nodes