Environment Variables
Robility flow uses environment variables to configure certain settings. You can also import environment variables for use in your deployment, such as environment variables used by certain components in your flows.
You can set Robility flow environment variables in your terminal, in .env, and with the Robility flow CLI.
Precedence
If an environment variable is set in multiple places, the following hierarchy applies:
1. Robility flow CLI options override .env and terminal variables.
2. .env overrides terminal variables.
3. Terminal variables are used only if the variable isn’t set in .env or Robility flow CLI options.
For example, if you set ROBILITY FLOW_PORT in .env and your terminal, then Robility flow uses the value from .env. Similarly, if you run a Robility flow CLI command with –port, Robility flow uses that port number instead of the ROBILITY FLOW_PORT in .env.
Configure environment variables
Robility flow recognizes supported environment variables from the following sources:
a. Environment variables that you’ve set in your terminal.
b. Environment variables that you’ve imported from a .env file when starting Robility flow or using the –env-file option in the Robility flow CLI.
You can choose to use one or both sources. However, environment variables imported from a .env file take precedence over those set in your terminal.
Set environment variables in your terminal
Run the following commands to set environment variables for your current terminal session:
a. Linux or macOS
b. Windows
c. Docker
export VARIABLE_NAME=’VALUE’
When you start Robility flow, it looks for environment variables that you’ve set in your terminal. If it detects a supported environment variable, then it automatically adopts the specified value, subject to precedence rules.
Import environment variables from a .env file
1. If Robility flow is running, quit Robility flow.
2. Create a .env file and then open it in your preferred editor.
3. Define Robility flow environment variables in the .env file. For example:
DO_NOT_TRACK=True ROBILITY_FLOW_AUTO_LOGIN=False ROBILITY_FLOW_AUTO_SAVING=True ROBILITY_FLOW_AUTO_SAVING_INTERVAL=1000 ROBILITY_FLOW_BACKEND_ONLY=False ROBILITY_FLOW_BUNDLE_URLS=["https://github.com/user/repo/commit/hash"] ROBILITY_FLOW_CACHE_TYPE=async ROBILITY_FLOW_COMPONENTS_PATH=/path/to/components/ ROBILITY_FLOW_CONFIG_DIR=/path/to/config/ ROBILITY_FLOW_DATABASE_URL=postgresql://<username>:<password>@<host>:5432/<database_name> ROBILITY_FLOW_DEV=False ROBILITY_FLOW_FALLBACK_TO_ENV_VAR=False ROBILITY_FLOW_HEALTH_CHECK_MAX_RETRIES=5 ROBILITY_FLOW_HOST=localhost ROBILITY_FLOW_MAX_FILE_SIZE_UPLOAD=10000 ROBILITY_FLOW_MAX_ITEMS_LENGTH=100 ROBILITY_FLOW_MAX_TEXT_LENGTH=1000 ROBILITY_FLOW_LOG_LEVEL=error ROBILITY_FLOW_OPEN_BROWSER=False ROBILITY_FLOW_PORT=7860 ROBILITY_FLOW_REMOVE_API_KEYS=False ROBILITY_FLOW_SAVE_DB_IN_CONFIG_DIR=True ROBILITY_FLOW_SECRET_KEY=somesecretkey ROBILITY_FLOW_STORE=True ROBILITY_FLOW_STORE_ENVIRONMENT_VARIABLES=True ROBILITY_FLOW_SUPERUSER=adminuser ROBILITY_FLOW_SUPERUSER_PASSWORD=adminpass ROBILITY_FLOW_WORKER_TIMEOUT=60000 ROBILITY_FLOW_WORKERS=3
For additional examples, see the .env.example file in the Robility flow repository.
4. Save and close .env.
5. Start Robility flow with your .env file:
a. Local
b. Docker
python -m robility flow run –env-file .env
If your .env file isn’t in the same directory, provide the path to your .env file.
On startup, Robility flow imports the environment variables from your .env file, as well as any others that you set in your terminal, and then adopts their specified values.
Supported environment variables
The following table lists the environment variables supported by Robility flow.
| Variable | Format | Default | Description |
|---|---|---|---|
| DO_NOT_TRACK | Boolean | False | Whether to report Robility flow telemetry data. If true, Robility flow telemetry is disabled. |
| ROBILITY FLOW_AUTO_LOGIN | Boolean | True | See ROBILITY FLOW_AUTO_LOGIN. |
| ROBILITY FLOW_AUTO_SAVING | Boolean | True | Enable flow auto-saving. |
| ROBILITY FLOW_AUTO_SAVING_INTERVAL | Integer | 1000 | Set the interval for flow auto-saving in milliseconds. |
| ROBILITY FLOW_BACKEND_ONLY | Boolean | False | Run only the Robility flow backend service (no frontend). |
| ROBILITY FLOW_BUNDLE_URLS | List[String] | [] | A list of URLs from which to load component bundles and flows. Supports GitHub URLs. If ROBILITY FLOW_AUTO_LOGIN is enabled, flows from these bundles are loaded into the database. |
| ROBILITY FLOW_CACHE_TYPE | String | async | Set the cache type for Robility flow. Possible values: async, redis, memory, disk. If redis, you must also set ROBILITY FLOW_REDIS_HOST, ROBILITY FLOW_REDIS_PORT, ROBILITY FLOW_REDIS_DB, and ROBILITY FLOW_REDIS_CACHE_EXPIRE. |
| ROBILITY FLOW_COMPONENTS_PATH | String | Not set | Path to the directory containing custom components. |
| ROBILITY FLOW_CONFIG_DIR | String | Varies | Set the Robility flow configuration directory where files, logs, and the Robility flow database are stored. Default path depends on your installation. See Flow storage and logs. |
| ROBILITY FLOW_DATABASE_URL | String | Not set | Database URL for Robility flow. Defaults to SQLite if not provided. |
| ROBILITY FLOW_DATABASE_CONNECTION_RETRY | Boolean | False | Whether to retry lost database connections. |
| ROBILITY FLOW_DB_POOL_SIZE | Integer | 20 | DEPRECATED. Use ROBILITY FLOW_DB_CONNECTION_SETTINGS instead. |
| ROBILITY FLOW_DB_MAX_OVERFLOW | Integer | 30 | DEPRECATED. Use ROBILITY FLOW_DB_CONNECTION_SETTINGS instead. |
| ROBILITY FLOW_DB_CONNECT_TIMEOUT | Integer | 30 | Timeout in seconds for DB connections. |
| ROBILITY FLOW_DB_CONNECTION_SETTINGS | JSON | Not set | Centralized DB connection parameters. Example: {"pool_size": 20, "max_overflow": 30} |
| ROBILITY FLOW_DISABLE_TRACK_APIKEY_USAGE | Boolean | False | Disable API key usage tracking to reduce DB contention under high concurrency. |
| ROBILITY FLOW_ENABLE_SUPERUSER_CLI | Boolean | True | Allow creation of superusers with CLI. Recommended to disable in production. |
| ROBILITY FLOW_FALLBACK_TO_ENV_VAR | Boolean | True | If enabled, global variables can fallback to environmen variables. |
| ROBILITY FLOW_FRONTEND_PATH | String | ./frontend | Path to the frontend build directory (dev only). |
| ROBILITY FLOW_HEALTH_CHECK_MAX_RETRIES | Integer | 5 | Maximum number of retries for the health check. |
| ROBILITY FLOW_HOST | String | localhost | The host on which the server will run. |
| ROBILITY FLOW_LOG_LEVEL | String | INFO | Logging level. Options: DEBUG, INFO, WARNING, ERROR, CRITICAL. |
| ROBILITY FLOW_LOG_FILE | String | Not set | Path to the log file. Defaults to stdout if not set. |
| ROBILITY FLOW_LOG_RETRIEVER_BUFFER_SIZE | Integer | 10000 | Buffer size for log retrieval. Used only if log retrieval is enabled. |
| ROBILITY FLOW_MAX_FILE_SIZE_UPLOAD | Integer | 100 | Maximum upload file size in MB. |
| ROBILITY FLOW_MAX_ITEMS_LENGTH | Integer | 100 | Maximum number of items in the visual editor. |
| ROBILITY FLOW_MAX_TEXT_LENGTH | Integer | 1000 | Maximum number of characters in the visual editor. |
| ROBILITY FLOW_MCP_SERVER_ENABLED | Boolean | True | If false, MCP server is not enabled. |
| ROBILITY FLOW_MCP_SERVER_ENABLE_PROGRESS_NOTIFICATIONS | Boolean | False | If true, progress notifications are sent in MCP server. |
| ROBILITY FLOW_NEW_USER_IS_ACTIVE | Boolean | False | See ROBILITY FLOW_NEW_USER_IS_ACTIVE. |
| ROBILITY FLOW_OPEN_BROWSER | Boolean | False | Open the system web browser on startup. |
| ROBILITY FLOW_PORT | Integer | 7860 | Port on which the server runs. Auto-selects if port is in use. |
| ROBILITY FLOW_PROMETHEUS_ENABLED | Boolean | False | Expose Prometheus metrics. |
| ROBILITY FLOW_PROMETHEUS_PORT | Integer | 9090 | Port for Prometheus metrics. |
| ROBILITY FLOW_REDIS_CACHE_EXPIRE | Integer | 3600 | See ROBILITY FLOW_CACHE_TYPE. |
| ROBILITY FLOW_REDIS_DB | Integer | 0 | See ROBILITY FLOW_CACHE_TYPE. |
| ROBILITY FLOW_REDIS_HOST | String | localhost | See ROBILITY FLOW_CACHE_TYPE. |
| ROBILITY FLOW_REDIS_PORT | String | 6379 | See ROBILITY FLOW_CACHE_TYPE. |
| ROBILITY FLOW_REDIS_PASSWORD | String | Not set | Password for Redis authentication. |
| ROBILITY FLOW_REMOVE_API_KEYS | Boolean | False | Remove API keys from saved projects. |
| ROBILITY FLOW_SAVE_DB_IN_CONFIG_DIR | Boolean | False | If false, DB is saved in root dir. If true, saved in CONFIG_DIR. |
| ROBILITY FLOW_SECRET_KEY | String | Automated | See ROBILITY FLOW_SECRET_KEY. |
| ROBILITY FLOW_STORE | Boolean | True | Enable Robility flow Store features. |
| ROBILITY FLOW_STORE_ENVIRONMENT_VARIABLES | Boolean | True | Whether to store environment variables as global variables in the database. |
| ROBILITY FLOW_CREATE_STARTER_PROJECTS | Boolean | True | Create templates during initialization. |
| ROBILITY FLOW_UPDATE_STARTER_PROJECTS | Boolean | True | Update templates with latest versions after upgrade. |
| ROBILITY FLOW_SUPERUSER | String | robility flow | See ROBILITY FLOW_SUPERUSER and ROBILITY FLOW_SUPERUSER_PASSWORD. |
| ROBILITY FLOW_SUPERUSER_PASSWORD | String | robility flow | See ROBILITY FLOW_SUPERUSER and ROBILITY FLOW_SUPERUSER_PASSWORD. |
| ROBILITY FLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT | String | Not set | Comma-separated list of environment variables to get from the environment and store as global variables. |
| ROBILITY FLOW_LOAD_FLOWS_PATH | String | Not set | Path to directory containing flow JSON files loaded on startup. |
| ROBILITY FLOW_WORKER_TIMEOUT | Integer | 300 | Worker timeout in seconds. |
| ROBILITY FLOW_WORKERS | Integer | 1 | Number of worker processes. |
| ROBILITY FLOW_SSL_CERT_FILE | String | Not set | Path to SSL certificate file. |
| ROBILITY FLOW_SSL_KEY_FILE | String | Not set | Path to SSL key file. |
| ROBILITY FLOW_SKIP_AUTH_AUTO_LOGIN | Boolean | True | See ROBILITY FLOW_AUTO_LOGIN. |
Configure .env, override.conf, and tasks.json files
The following examples show how to configure Robility flow using environment variables in different scenarios.
.env file
The .env file is a text file that contains key-value pairs of environment variables.
Create or edit a .env file in the root directory of your application or Robility flow environment, and then add your configuration variables to the file:
Environment Variables
The following environment variables can be configured to customize the behavior of Robility Flow.
DO_NOT_TRACK=True ROBILITY_FLOW_AUTO_LOGIN=False ROBILITY_FLOW_AUTO_SAVING=True ROBILITY_FLOW_AUTO_SAVING_INTERVAL=1000 ROBILITY_FLOW_BACKEND_ONLY=False ROBILITY_FLOW_BUNDLE_URLS=["https://github.com/user/repo/commit/hash"] ROBILITY_FLOW_CACHE_TYPE=async ROBILITY_FLOW_COMPONENTS_PATH=/path/to/components/ ROBILITY_FLOW_CONFIG_DIR=/path/to/config/ ROBILITY_FLOW_DATABASE_URL=postgresql://<username>:<password>@<host>:5432/<database_name> ROBILITY_FLOW_DEV=False ROBILITY_FLOW_FALLBACK_TO_ENV_VAR=False ROBILITY_FLOW_HEALTH_CHECK_MAX_RETRIES=5 ROBILITY_FLOW_HOST=localhost ROBILITY_FLOW_MAX_FILE_SIZE_UPLOAD=10000 ROBILITY_FLOW_MAX_ITEMS_LENGTH=100 ROBILITY_FLOW_MAX_TEXT_LENGTH=1000 ROBILITY_FLOW_LOG_LEVEL=error ROBILITY_FLOW_OPEN_BROWSER=False ROBILITY_FLOW_PORT=7860 ROBILITY_FLOW_REMOVE_API_KEYS=False ROBILITY_FLOW_SAVE_DB_IN_CONFIG_DIR=True ROBILITY_FLOW_SECRET_KEY=somesecretkey ROBILITY_FLOW_STORE=True ROBILITY_FLOW_STORE_ENVIRONMENT_VARIABLES=True ROBILITY_FLOW_SUPERUSER=adminuser ROBILITY_FLOW_SUPERUSER_PASSWORD=adminpass ROBILITY_FLOW_WORKER_TIMEOUT=60000 ROBILITY_FLOW_WORKERS=3
Systemd Service
A systemd service configuration file configures Linux system services.
To add environment variables, create or edit a service configuration file and add an override.conf file. This file allows you to override the default environment variables for the service.
[Service] Environment="DO_NOT_TRACK=true" Environment="ROBILITY_FLOW_AUTO_LOGIN=false" Environment="ROBILITY_FLOW_AUTO_SAVING=true" Environment="ROBILITY_FLOW_AUTO_SAVING_INTERVAL=1000" Environment="ROBILITY_FLOW_BACKEND_ONLY=false" Environment="ROBILITY_FLOW_BUNDLE_URLS=[\"https://github.com/user/repo/commit/hash\"]" Environment="ROBILITY_FLOW_CACHE_TYPE=async" Environment="ROBILITY_FLOW_COMPONENTS_PATH=/path/to/components/" Environment="ROBILITY_FLOW_CONFIG_DIR=/path/to/config/" Environment="ROBILITY_FLOW_DATABASE_URL=postgresql://<username>:<password>@<host>:5432/<database_name>" Environment="ROBILITY_FLOW_DEV=false" Environment="ROBILITY_FLOW_FALLBACK_TO_ENV_VAR=false" Environment="ROBILITY_FLOW_HEALTH_CHECK_MAX_RETRIES=5" Environment="ROBILITY_FLOW_HOST=localhost" Environment="ROBILITY_FLOW_MAX_FILE_SIZE_UPLOAD=10000" Environment="ROBILITY_FLOW_MAX_ITEMS_LENGTH=100" Environment="ROBILITY_FLOW_MAX_TEXT_LENGTH=1000" Environment="ROBILITY_FLOW_LOG_ENV=container_json" Environment="ROBILITY_FLOW_LOG_FILE=logs/Robility flow.log" Environment="ROBILITY_FLOW_LOG_LEVEL=error" Environment="ROBILITY_FLOW_OPEN_BROWSER=false" Environment="ROBILITY_FLOW_PORT=7860" Environment="ROBILITY_FLOW_REMOVE_API_KEYS=false" Environment="ROBILITY_FLOW_SAVE_DB_IN_CONFIG_DIR=true" Environment="ROBILITY_FLOW_SECRET_KEY=somesecretkey" Environment="ROBILITY_FLOW_STORE=true" Environment="ROBILITY_FLOW_STORE_ENVIRONMENT_VARIABLES=true" Environment="ROBILITY_FLOW_SUPERUSER=adminuser" Environment="ROBILITY_FLOW_SUPERUSER_PASSWORD=adminpass" Environment="ROBILITY_FLOW_WORKER_TIMEOUT=60000" Environment="ROBILITY_FLOW_WORKERS=3"
For more information on systemd, see the Red Hat documentation.
VSCode tasks.json
The tasks.json file located in .vscode/tasks.json is a configuration file for development environments using Visual Studio Code.
Create or edit the .vscode/tasks.json file in your project root:
{
"version": "2.0.0",
"options": {
"env": {
"DO_NOT_TRACK": "true",
"ROBILITY_FLOW_AUTO_LOGIN": "false",
"ROBILITY_FLOW_AUTO_SAVING": "true",
"ROBILITY_FLOW_AUTO_SAVING_INTERVAL": "1000",
"ROBILITY_FLOW_BACKEND_ONLY": "false",
"ROBILITY_FLOW_BUNDLE_URLS": "[\"https://github.com/user/repo/commit/hash\"]",
"ROBILITY_FLOW_CACHE_TYPE": "async",
"ROBILITY_FLOW_COMPONENTS_PATH": "D:/path/to/components/",
"ROBILITY_FLOW_CONFIG_DIR": "D:/path/to/config/",
"ROBILITY_FLOW_DATABASE_URL": "postgresql://<username>:<password>@<host>:5432/<database_name>",
"ROBILITY_FLOW_DEV": "false",
"ROBILITY_FLOW_FALLBACK_TO_ENV_VAR": "false",
"ROBILITY_FLOW_HEALTH_CHECK_MAX_RETRIES": "5",
"ROBILITY_FLOW_HOST": "localhost",
"ROBILITY_FLOW_MAX_FILE_SIZE_UPLOAD": "10000",
"ROBILITY_FLOW_MAX_ITEMS_LENGTH": "100",
"ROBILITY_FLOW_MAX_TEXT_LENGTH": "1000",
"ROBILITY_FLOW_LOG_ENV": "container_csv",
"ROBILITY_FLOW_LOG_FILE": "Robility flow.log",
"ROBILITY_FLOW_LOG_LEVEL": "error",
"ROBILITY_FLOW_OPEN_BROWSER": "false",
"ROBILITY_FLOW_PORT": "7860",
"ROBILITY_FLOW_REMOVE_API_KEYS": "true",
"ROBILITY_FLOW_SAVE_DB_IN_CONFIG_DIR": "false",
"ROBILITY_FLOW_SECRET_KEY": "somesecretkey",
"ROBILITY_FLOW_STORE": "true",
"ROBILITY_FLOW_STORE_ENVIRONMENT_VARIABLES": "true",
"ROBILITY_FLOW_SUPERUSER": "adminuser",
"ROBILITY_FLOW_SUPERUSER_PASSWORD": "adminpass",
"ROBILITY_FLOW_WORKER_TIMEOUT": "60000",
"ROBILITY_FLOW_WORKERS": "3"
}
},
"tasks": [
{
"label": "Robility Flow backend",
"type": "shell",
"command": ". ./RobilityFlowNightly/Scripts/activate && Robility Flow run",
"isBackground": true,
"problemMatcher": []
}
]
}
To run Robility Flow using the above tasks.json file, open the Visual Studio Code Command Palette and select Tasks > Run Task > Robility Flow backend.
Set environment variables for Robilityflow Desktop
Environment variables set in your terminal aren’t automatically available to GUI-based applications like Robilityflow Desktop when you launch them from the Windows or macOS GUI.
For Windows, this means any GUI-based app launched from the Start menu, desktop shortcuts, or Windows Explorer.
For macOS, this means any GUI-based app launched from Finder, Spotlight, Launchpad, or the Dock.
To set environment variables for Robilityflow Desktop, you need to use specific commands or files, depending on your OS.
1. macOS
2. Window System Properties
3. Powershell
macOS
Robilityflow Desktop for macOS cannot automatically use variables set in your terminal, such as those in.zshrc or .bash_profile, when launched from the macOS GUI.
To make environment variables available to GUI apps on macOS, you need to use launchctl with a plist file:
1. Create the LaunchAgents directory if it doesn’t exist:
mkdir -p ~/Library/LaunchAgents
LaunchAgents directory, create a .plist file called dev.Robilityflow.env.3. Add the following content to dev.Robilityflow.env.plist, and then add, change, or remove Robilityflow environment variables as needed for your configuration.
This example sets multiple environmental variables for all GUI apps launched from the macOS GUI.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>dev.Robilityflow.env</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>-c</string>
<string>
launchctl setenv ROBILITYFLOW_CONFIG_DIR /Users/your_user/custom/config ;
launchctl setenv ROBILITYFLOW_PORT 7860 ;
launchctl setenv ROBILITYFLOW_HOST localhost ;
launchctl setenv ARIZE_API_KEY ak-...
</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
4. Load the file with launchctl:
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/dev.Robilityflow.env.plistWindow System Properties
Robilityflow Desktop for Windows cannot automatically use variables set in your terminal, such as those defined with set in cmd or $env:VAR=... in PowerShell, when launched from the Windows GUI.
To make environment variables available to the Robilityflow Desktop app, you must set them at the user or system level using the System Properties interface or the Terminal.
To set environment variables using the System Properties interface, do the following:
1. Press Win + R, enter SystemPropertiesAdvanced, and then press Enter.
2. Click Environment Variables.
3. Under User variables, click New.
Note: To apply the setting to all users, select System variables.
4. Enter the name of the Robilityflow variable you want to set, such as ROBILITYFLOW_CONFIG_DIR, and the desired value, such as C:\Users\your_user\.Robilityflow_config.
5. Click OK to save the variable.
6. Repeat until you have set all necessary Robilityflow environment variables.
7. Launch or restart Robilityflow Desktop to apply the environment variables.
Powershell
To define environment variables for Windows using PowerShell, do the following:
Enter the name of the Robilityflow variable you want to set, such as ROBILITYFLOW_CONFIG_DIR, and the desired value, such as C:\Users\your_user\.robilityflow_config.
To set an environment variable for the current user:
[System.Environment]::SetEnvironmentVariable("ROBILITYFLOW_CONFIG_DIR", "C:\Users\your_user\.robilityflow_config", "User")To set an environment variable for all users (you must have Administrator priveleges):
[System.Environment]::SetEnvironmentVariable("ROBILITYFLOW_CONFIG_DIR", "C:\Robilityflow\Config", "Machine")
Launch or restart Robilityflow Desktop to apply the environment variables.