Variables are dynamically-named, mutable string values than can be used to store and reuse non-sensitive bits of data.
Variables enable you to store and reuse non-sensitive bits of data, such as configuration information. They are:
Variables are not Encrypted
We do not recommend using variables to store sensitive information. Instead, use Secret blocks to store and access sensitive information.
Create, read, edit, and delete variables through the Prefect UI, API, and CLI. Names must adhere to these traditional variable naming conventions:
Values must have less than or equal to 5000 characters.
Optionally, you can add tags to a variable.
View all the variables in your self-hosted Prefect server instance or Prefect Cloud account workspace in the Variables page of the Prefect UI. Both the name and value of all variables are visible to anyone with access to the server or workspace.
To create a new variable:
You can manage variables with the Prefect API.
You can manage variables with the Prefect CLI.
prefect variable set
creates or updates a variable.prefect variable get
retrieves a variable’s value.prefect variable unset
deletes a variable.prefect variable ls
lists all variables.prefect variable inspect
shows a variable’s details.You can manage variables with the Terraform provider for Prefect.