Environment Variables
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:
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.

Transient Environment Variables
Transient environment variables allow you to inject short-lived values into executions without persisting them in your project configuration.
Unlike step-defined, project-level, or organization-level variables, transient variables are execution-scoped. They are injected at runtime and are not stored in:
valohai.yamlProject environment variables
Organization variable groups
This enables you to pass temporary or sensitive values without committing them to version control or storing them in shared settings.
Use Cases
Transient environment variables are useful when you need to:
Inject API keys or access tokens for external services that rotate frequently
Pass experiment-specific credentials that should not be shared across executions
Manage temporary authentication tokens for CI/CD pipelines triggering Valohai jobs
Provide user-specific or session-specific variables when creating executions programmatically
Handle sensitive configuration that should not be stored in project YAML or visible in the UI
Using Transient Variables via API
When creating an execution through the Valohai API, include transient environment variables in the execution creation payload.
These variables are injected into the runtime environment but are not stored in the project configuration.
Refer to the API documentation for the execution creation endpoint:
https://app.valohai.com/api/docs/#operation/ExecutionCreate
See the ExecutionCreate operation for the exact payload structure and details on how to provide environment variables in the request body.
Managing Transient Variables in the UI
You can define transient environment variables in both user and organization settings.
User-Level Transient Variables
To create user-scoped transient variables:
Click your username in the top-right corner
Select My Profile
Open the Environment Variables tab
Navigate to Transient Environment Variables
Add your variable name and value
These variables apply to executions triggered by you.

Organization-Level Transient Variables
Organization admins can define transient variables available across projects.
To create organization-scoped transient variables:
Click your username in the top-right corner
Select Manage <organization>
Open the Environment Variables tab
Navigate to Transient Environment Variables
Add variables and mark sensitive values as Secret if needed

Last updated
Was this helpful?
