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.
Additional training available
Unlock the power of chains with our self-paced course in the Workiva Learning Hub! This comprehensive course guides you through the process of creating a chain from start to finish, providing hands-on experience and a deep understanding of the Chain Builder platform.
Visit the Workiva Learning Hub
Manage your workspace's variables
From your workspace, you can define the variables used by multiple chains:
- In Chain Builder, select Settings at the top left.
- To the right of Variables, click Add
. - To help identify the variable, enter its name and, if necessary, its default value and description. These default values can be customized later for individual chains.
- For added security, select Encrypt -- this will conceal any sensitive values such as passwords.
- 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 Delete.
Manage a chain's variables
For values that appear in multiple commands within a chain and change frequently, add them as variables for the chain. A chain can have up to 100 variables.
- In the chain, click Chain Settings.
- Under Variables
, click Add . - Enter a unique name and description to help identify the variable and its intent.
- Enter the default value for the variable.
- To enable only admins to view the variable's value, such as for passwords, select Encrypt.
- 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 Delete
.Manage 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.
Note: To ease consecutive runs, dynamic variables retain the values set during the chain's previous run.
- In the chain, click Chain Settings.
- Under Dynamic Variables , click Add .
- Enter a unique name to help identify the variable and its intent.
Note: The Initial Value field is not applicable here and should be left blank.
- Click Save.
Note: To set the dynamic variables' values when a chain starts to run, start it with a Runtime Inputs trigger event. To pause a chain to define a dynamic variable's value before proceeding to the next step, add a Set Dynamic Chain Variables event.
To remove a variable you no longer need, click Delete
.Use variables as command inputs
To use variables as text-based inputs for a command:
- From the chain, select the command to use the variables.
- In the text-based input to use a variable, click Variable
Note: To concatenate multiple variables within an input, select the variables to use, and then enter any text to appear before or after each.
, and select the variable.
- Click Save.
Note: To modify or format a variable for use as a command input, apply a variable transformation.
Runtime variables
To include data related to when a chain runs, you can use several runtime variables.
Variable | Description |
---|---|
Chain.Environment | The environment of the currently running chain |
Chain.ExecutionDateTime | The date and time of when the chain starts |
Chain.ExecutorId | The numeric ID of the currently running chain |
Chain.Id | The numeric ID of a chain in the non-running state |
Chain.Name | The name of the currently running chain |
Chain.PreviousExecutionDateTime | The date and time of when the chain last ran |
Chain.URL | The unique URL of the currently running chain |
Chain.Workspace | The workspace of the currently running chain |
Command.ExecutorId | The numeric ID of the currently running command |
Command.Id | The numeric ID of a command in the non-running state |
Command.Name | The name of the currently running command |
Command.URL | The unique URL of the currently running command |
Runner.InstallationDirectory | The installation directory for the chain's GroundRunner; null if a CloudRunner is used |
System.Date | The current system date |
System.DateTime | The current system date and time |
User.Email | The email address of the collaborator who ran the chain |
User.Id | The ID of the collaborator who ran the chain |
User.Name | The name of the collaborator who ran the chain |