User Role: Administrator, Workspace Manager, Editor, Operator
In general computing, a runtime variable is a value set and used while a program runs, rather than being fixed in the code ahead of time. This allows software to adapt its behavior based on changing conditions, configuration, or user input.
In Liquibase, runtime variables follow the same principle. They let you substitute values at run time instead of hardcoding them. This flexibility makes creating and testing changelogs in a staging environment easier, catching and fixing issues locally, and avoiding unintended changes to your main branch.
Liquibase runtime variables fall into two categories:
Workflow variables
Workflow variables are placeholders for values in Liquibase commands that can be swapped out when a job runs. They’re defined at the workflow level. When editing a Workflow, you can configure any Liquibase command as an action, and those actions can be turned into workflow variables.
Job variables
Job variables are the specific values used when a Workflow runs. They can include the database connection, changelog resource, rollback action, and any tags you assign. When you’ve enabled workflow variables while editing a Workflow, those variables become job variables that you set at run time when executing the Workflow.
Configure the self-hosted runner
2. Once inside the project, click the Click the three dot button and select Edit.
3. From the Edit Workflow page, edit the name of the Workflow if desired.
4. (Optional) If you're working with a vault and need to change the secrets vault, check the Enable a secrets vault for this Workflow box and select the vault from which you want to pull the secrets.
You can create a new secrets vault by selecting the + New secrets vault button.
Once enabled, Liquibase.io retrieves the secrets from the appropriate form fields by replacing the field value with the syntax specific to your vault brand. Learn more here about Liquibase Secrets Management
5. If you need to edit the database for this project, select a different database from the drop down menu. Once you select a database, its URL, Type, Name, Hostname, Port, Username, and Password display below.
You can create a new database by selecting the + New database button.
6. (Optional) Edit the associated global properties with your Workflow if any exist.
Note: You can add as many global workflow properties as you want to your workflow, but you can only select a global property once per workflow. For example, if Rollback on Error is set, you cannot select it again for the same workflow.
7. From the drop down Property menu, select the property category you want to select your runtime variable from.
The Connection, Workflow, command, check command, or Resource attributes categories can be selected.
Note: It is best practice to assign runtime variables to existing workflows and not new workflows.
8. Once you select a property, enter the desired default value and check the Required Value box if it is required.
Then save the workflow.
The Runtime variables will be available to edit when you run your workflow.
Note: If you select a database connection as a runtime variable, you cannot change the type of database because it is tied to the previously selected database in the Workflow.
The "You successfully updated an environment for a workflow" message appears.