Custom Variables
Configure environment variables at execution, project, and organization levels. Includes secret management and variable groups.
Environment variables are key-value pairs that your executions can read and write. Valohai gives you flexible options for defining them at different scopes.
You can set environment variables in four ways:
Inline commands — Quick
export MY_VAR=valuein your step commandsStep definitions — Explicit variables in
valohai.yamlProject level — Shared across all project executions
Organization level — Grouped variables across multiple projects
Execution Environment Variables
Inline Commands
Set variables directly in your step commands:
- step:
name: train-model
image: python:3.11
command:
- export MODE="1"
- export POST="clip"
- python train.pyThis approach works but won't be tracked in Valohai's interface.
Step Definitions
Define expected variables explicitly in your valohai.yaml:
- step:
name: train-model
image: python:3.11
command: python train.py
environment-variables:
- name: MODE
default: "1"
- name: POST
default: "clip"Variable properties:
name— Variable name passed to the executiondescription— (optional) Human-readable explanationdefault— (optional) Default value if not specifiedoptional— (optional) Set tofalseto make required
💡 Step-defined variables appear in the UI when creating executions and can be modified via CLI or API.
Project Environment Variables
Project variables work well for API keys, database connections, or shared configuration across executions.
To create project variables:
Navigate to Project Settings
Open "Environment Variables" tab
Enter variable name and value
Check "Secret" to hide the value in the UI
Click "Add" then "Save"
To use project variables:
Check Inherit project's environment variables and secrets when creating executions.
💡 Secret variables are hidden in the UI but can still be printed in execution logs by users with project access.
Organization Environment Variables
Organization admins can create variable groups shared across multiple projects. This centralizes management and simplifies tasks like key rotation.
Creating Variable Groups
Click your username in the top-right corner
Select "Manage <organization>"
Open "Environment Variables" tab
Click "Create new environment variable group"
Name your group and select target projects
Add variables with names and values
Mark sensitive values as "Secret"
Click "Save"
Example Setup
The screenshot below shows two environment variable groups:
Production — Used by "fun-tensorflow" and "productionproject" projects
Staging — Used exclusively by "staging" project
Both groups contain public and secret variables for their respective environments.

Using Variable Groups
Organization variable groups appear under each project's "Env Variables" tab. Non-admin users can view group names and public values but cannot modify them.

Last updated
Was this helpful?
