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://user:password@localhost:5432/robility flow
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:
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://user:password@localhost:5432/robility flow
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://user:password@localhost:5432/Robility flow”
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://postgres:password@localhost:5432/Robility flow”,
“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”: “. ./Robility flownightly/Scripts/activate && Robility flow run”,
“isBackground”: true,
“problemMatcher”: []
}
]
}
To run Robility flow using the above VSCode tasks.json file, in the VSCode command palette, select Tasks: Run Task > Robility flow backend.