Environment Variables

Estimated reading: 11 minutes 393 views

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_TRACKBooleanFalseWhether to report Robility flow telemetry data. If true, Robility flow telemetry is disabled.
ROBILITY FLOW_AUTO_LOGINBooleanTrueSee ROBILITY FLOW_AUTO_LOGIN.
ROBILITY FLOW_AUTO_SAVINGBooleanTrueEnable flow auto-saving.
ROBILITY FLOW_AUTO_SAVING_INTERVALInteger1000Set the interval for flow auto-saving in milliseconds.
ROBILITY FLOW_BACKEND_ONLYBooleanFalseRun only the Robility flow backend service (no frontend).
ROBILITY FLOW_BUNDLE_URLSList[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_TYPEStringasyncSet 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_PATHStringNot setPath to the directory containing custom components.
ROBILITY FLOW_CONFIG_DIRStringVariesSet 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_URLStringNot setDatabase URL for Robility flow. Defaults to SQLite if not provided.
ROBILITY FLOW_DATABASE_CONNECTION_RETRYBooleanFalseWhether to retry lost database connections.
ROBILITY FLOW_DB_POOL_SIZEInteger20DEPRECATED. Use ROBILITY FLOW_DB_CONNECTION_SETTINGS instead.
ROBILITY FLOW_DB_MAX_OVERFLOWInteger30DEPRECATED. Use ROBILITY FLOW_DB_CONNECTION_SETTINGS instead.
ROBILITY FLOW_DB_CONNECT_TIMEOUTInteger30Timeout in seconds for DB connections.
ROBILITY FLOW_DB_CONNECTION_SETTINGSJSONNot setCentralized DB connection parameters. Example: {"pool_size": 20, "max_overflow": 30}
ROBILITY FLOW_DISABLE_TRACK_APIKEY_USAGEBooleanFalseDisable API key usage tracking to reduce DB contention under high concurrency.
ROBILITY FLOW_ENABLE_SUPERUSER_CLIBooleanTrueAllow creation of superusers with CLI. Recommended to disable in production.
ROBILITY FLOW_FALLBACK_TO_ENV_VARBooleanTrueIf enabled, global variables can fallback to environmen variables.
ROBILITY FLOW_FRONTEND_PATHString./frontendPath to the frontend build directory (dev only).
ROBILITY FLOW_HEALTH_CHECK_MAX_RETRIESInteger5Maximum number of retries for the health check.
ROBILITY FLOW_HOSTStringlocalhostThe host on which the server will run.
ROBILITY FLOW_LOG_LEVELStringINFOLogging level. Options: DEBUG, INFO, WARNING, ERROR, CRITICAL.
ROBILITY FLOW_LOG_FILEStringNot setPath to the log file. Defaults to stdout if not set.
ROBILITY FLOW_LOG_RETRIEVER_BUFFER_SIZEInteger10000Buffer size for log retrieval. Used only if log retrieval is enabled.
ROBILITY FLOW_MAX_FILE_SIZE_UPLOADInteger100Maximum upload file size in MB.
ROBILITY FLOW_MAX_ITEMS_LENGTHInteger100Maximum number of items in the visual editor.
ROBILITY FLOW_MAX_TEXT_LENGTHInteger1000Maximum number of characters in the visual editor.
ROBILITY FLOW_MCP_SERVER_ENABLEDBooleanTrueIf false, MCP server is not enabled.
ROBILITY FLOW_MCP_SERVER_ENABLE_PROGRESS_NOTIFICATIONSBooleanFalseIf true, progress notifications are sent in MCP server.
ROBILITY FLOW_NEW_USER_IS_ACTIVEBooleanFalseSee ROBILITY FLOW_NEW_USER_IS_ACTIVE.
ROBILITY FLOW_OPEN_BROWSERBooleanFalseOpen the system web browser on startup.
ROBILITY FLOW_PORTInteger7860Port on which the server runs. Auto-selects if port is in use.
ROBILITY FLOW_PROMETHEUS_ENABLEDBooleanFalseExpose Prometheus metrics.
ROBILITY FLOW_PROMETHEUS_PORTInteger9090Port for Prometheus metrics.
ROBILITY FLOW_REDIS_CACHE_EXPIREInteger3600See ROBILITY FLOW_CACHE_TYPE.
ROBILITY FLOW_REDIS_DBInteger0See ROBILITY FLOW_CACHE_TYPE.
ROBILITY FLOW_REDIS_HOSTStringlocalhostSee ROBILITY FLOW_CACHE_TYPE.
ROBILITY FLOW_REDIS_PORTString6379See ROBILITY FLOW_CACHE_TYPE.
ROBILITY FLOW_REDIS_PASSWORDStringNot setPassword for Redis authentication.
ROBILITY FLOW_REMOVE_API_KEYSBooleanFalseRemove API keys from saved projects.
ROBILITY FLOW_SAVE_DB_IN_CONFIG_DIRBooleanFalseIf false, DB is saved in root dir. If true, saved in CONFIG_DIR.
ROBILITY FLOW_SECRET_KEYStringAutomatedSee ROBILITY FLOW_SECRET_KEY.
ROBILITY FLOW_STOREBooleanTrueEnable Robility flow Store features.
ROBILITY FLOW_STORE_ENVIRONMENT_VARIABLESBooleanTrueWhether to store environment variables as global variables in the database.
ROBILITY FLOW_CREATE_STARTER_PROJECTSBooleanTrueCreate templates during initialization.
ROBILITY FLOW_UPDATE_STARTER_PROJECTSBooleanTrueUpdate templates with latest versions after upgrade.
ROBILITY FLOW_SUPERUSERStringrobility flowSee ROBILITY FLOW_SUPERUSER and ROBILITY FLOW_SUPERUSER_PASSWORD.
ROBILITY FLOW_SUPERUSER_PASSWORDStringrobility flowSee ROBILITY FLOW_SUPERUSER and ROBILITY FLOW_SUPERUSER_PASSWORD.
ROBILITY FLOW_VARIABLES_TO_GET_FROM_ENVIRONMENTStringNot setComma-separated list of environment variables to get from the environment and store as global variables.
ROBILITY FLOW_LOAD_FLOWS_PATHStringNot setPath to directory containing flow JSON files loaded on startup.
ROBILITY FLOW_WORKER_TIMEOUTInteger300Worker timeout in seconds.
ROBILITY FLOW_WORKERSInteger1Number of worker processes.
ROBILITY FLOW_SSL_CERT_FILEStringNot setPath to SSL certificate file.
ROBILITY FLOW_SSL_KEY_FILEStringNot setPath to SSL key file.
ROBILITY FLOW_SKIP_AUTH_AUTO_LOGINBooleanTrueSee 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.

Share this Doc

Environment Variables

Or copy link

CONTENTS