Managing Variables for the Workspace and Chains

To set values for inputs that appear repeatedly in multiple chains or commands within a single chain, you can use variables. Rather than input the same value in multiple chains or commands, you can define it as a variable, and manage its value in one location.

  • Workspace variables define values that appear across multiple chains.
  • Chain variables define values that appear in multiple commands of a chain and may change frequently.
  • Dynamic variables define values to set when a chain runs or during the execution of a chain, such as based on an earlier command's output.

Managing Your Workspace's Variables

From your workspace, you can define the variables used by multiple chains.

1
From Wdata Chains, click Home and Edit.
2
Under Variables, click Add Variable. Updating Workspace Variables
3
To help identify the variable, enter its name and, if necessary, default value.
4
To enable only admins to view the variable's value, select Encrypt.
5
Click Save.

After you add a variable to your workspace, you can edit its name, value, or encryption as necessary. To remove a variable from the workspace, click its Delete.

Managing a Chain's Variables

For values that appear in multiple commands within a chain and change frequently, add them as variables for the chain:

1
In the chain, click Edit. Edit Chain Variables
2
Under Variables, click Add (+).
3
In Key, enter a unique name to help identify the variable and its intent.
4
Enter the default value for the variable.
5
To enable only admins to view the variable's value, select Encrypt.
6
Click Save.

To update a variable, click Edit for the chain, and adjust the value under Variables.

To remove a variable you no longer need, click its X.

Managing a Chain's Dynamic Variables

To set values when the chain runs, or to base values on another command's output, add them as dynamic variables for the chain:

1
In the chain, click Edit. Edit Chain Dynamic Variables
2
Under Dynamic Variables, click Add (+).
3
In Key, enter a unique name to help identify the variable and its intent
4
Enter the initial value for the variable, and click Save.

To remove a variable you no longer need, click its X.

Using Variables as Command Inputs

To use variables as text-based inputs for a command:

1
From the chain, select the command to use the variables.
2
In the text-based input to use a variable, click Variable (< >), and select the variable.
3
Click Save.

Default Variables

Several variables for data related to chains, commands, and the system's date and time are available out-of-the-box.

Variable Description
Chain ID The numeric ID of a chain in the non-running state
Chain Executor ID The numeric ID of the currently running chain
Chain Environment The environment of the currently running chain
Chain Name The name of the currently running chain
Chain URL The unique URL of the currently running chain
Chain Execution Date & Time The date and time of when the chain starts
Chain Previous Execution Date & Time The date and time of when the chain last ran
Command ID The numeric ID of a command in the non-running state
Command Executor ID The numeric ID of the currently running command
Command Name The name of the currently running command
Command URL The unique URL of the currently running command
System Date The current system date
System Date and Time The current system date and time