Skip to content

Latest commit

 

History

History
144 lines (96 loc) · 12 KB

environment-variables.md

File metadata and controls

144 lines (96 loc) · 12 KB
description
Learn how to configure environment variables for Flowise

Environment Variables

Flowise support different environment variables to configure your instance. You can specify the following variables in the .env file inside packages/server folder. Refer to .env.example file.

Variable Description Type Default
PORT The HTTP port Flowise runs on Number 3000
FLOWISE_USERNAME Username to login String
FLOWISE_PASSWORD Password to login String
FLOWISE_FILE_SIZE_LIMIT Maximum file size when uploading String 50mb
APIKEY_PATH Location where API keys are saved String Flowise/packages/server
NUMBER_OF_PROXIES Rate Limit Proxy Number
CORS_ORIGINS The allowed origins for all cross-origin HTTP calls String
IFRAME_ORIGINS The allowed origins for iframe src embedding String
DISABLE_CHATFLOW_REUSE Disable caching the flow, allowing every interaction of the chatflow will be executed from scratch Boolean: true or false
SHOW_COMMUNITY_NODES Display nodes that are created by community Boolean: true or false

For Database

Variable Description Type Default
DATABASE_TYPE Type of database to store the flowise data Enum String: sqlite, mysql, postgres sqlite
DATABASE_PATH Location where database is saved (When DATABASE_TYPE is sqlite) String your-home-dir/.flowise
DATABASE_HOST Host URL or IP address (When DATABASE_TYPE is not sqlite) String
DATABASE_PORT Database port (When DATABASE_TYPE is not sqlite) String
DATABASE_USER Database username (When DATABASE_TYPE is not sqlite) String
DATABASE_PASSWORD Database password (When DATABASE_TYPE is not sqlite) String
DATABASE_NAME Database name (When DATABASE_TYPE is not sqlite) String
DATABASE_SSL Database SSL is required (When DATABASE_TYPE is not sqlite) Boolean: true or false false

For LangSmith Tracing

Flowise supports LangSmith tracing with the following env variables:

VariableDescriptionType
LANGCHAIN_TRACING_V2Turn LangSmith tracing ON or OFFEnum String: true, false
LANGCHAIN_ENDPOINTLangSmith endpointString
LANGCHAIN_API_KEYLangSmith API KeyString
LANGCHAIN_PROJECTProject to trace on LangSmithString

Watch how connect Flowise and LangSmith

{% embed url="https://youtu.be/BGGhRxS3AVQ" %}

For Built-In and External Dependencies

For security reasons, by default Tool Function only allow certain dependencies. It's possible to lift that restriction for built-in and external modules by setting the following environment variables:

Variable Description
TOOL_FUNCTION_BUILTIN_DEP NodeJS built-in modules to be used for Tool Function String
TOOL_FUNCTION_EXTERNAL_DEP External modules to be used for Tool Function String

{% code title=".env" %}

# Allows usage of all builtin modules
TOOL_FUNCTION_BUILTIN_DEP=*

# Allows usage of only fs
TOOL_FUNCTION_BUILTIN_DEP=fs

# Allows usage of only crypto and fs
TOOL_FUNCTION_BUILTIN_DEP=crypto,fs

# Allow usage of external npm modules.
TOOL_FUNCTION_EXTERNAL_DEP=axios,moment

{% endcode %}

For Debugging and Logs

Variable Description Type
DEBUG Print logs from components Boolean
LOG_PATH Location where log files are stored String Flowise/packages/server/logs
LOG_LEVEL Different levels of logs Enum String: error, info, verbose, debug info

DEBUG: if set to true, will print logs to terminal/console:

LOG_LEVEL: Different log levels for loggers to be saved. Can be error, info, verbose, or debug. By default it is set to info, only logger.info will be saved to the log files. If you want to have complete details, set to debug.

server-requests.log.jsonl - logs every request sent to Flowise

server.log - logs general actions on Flowise

server-error.log - logs error with stack trace

For Credentials

Flowise store your third party API keys as encrypted credentials using an encryption key.

By default, a random encryption key will be generated when starting up the application and stored under a file path. This encryption key is then retrieved everytime to decrypt the credentials used within a chatflow. For example, your OpenAI API key, Pinecone API key, etc.

Variable Description Type
SECRETKEY_PATH Location where encryption key (used to encrypt/decrypt credentials) is saved String Flowise/packages/server
FLOWISE_SECRETKEY_OVERWRITE Encryption key to be used instead of the key stored in SECRETKEY_PATH String

For some reasons, sometimes encryption key might be re-generated or the stored path was changed, this will cause errors like - Credentials could not be decrypted.

To avoid this, you can set your own encryption key as FLOWISE_SECRETKEY_OVERWRITE, so that the same encryption key will be used everytime. There is no restriction on the format, you can set it as any text that you want, or the same as your FLOWISE_PASSWORD.

{% hint style="info" %} Credential API Key returned from the UI is not the same length as your original Api Key that you have set. This is a fake prefix string that prevents network spoofing, that's why we are not returning the Api Key back to UI. However, the correct Api Key will be retrieved and used during your interaction with the chatflow. {% endhint %}

For Models

In some cases, you might want to use custom model on the existing Chat Model and LLM nodes, or restrict access to only certain models.

By default, Flowise pulls the model list from here. However user can create their own models.json file and specify the file path:

VariableDescriptionTypeDefault
MODEL_LIST_CONFIG_JSONLink to load list of models from your models.json config fileStringhttps://raw.githubusercontent.com/FlowiseAI/Flowise/main/packages/components/models.json

For Storage

Flowise store the following files under a local path folder by default.

User can specify STORAGE_TYPE to use AWS S3 or local path

VariableDescriptionTypeDefault
STORAGE_TYPEType of storage for uploaded files. default is localEnum String: s3, locallocal
BLOB_STORAGE_PATHLocal folder path where uploaded files are stored when STORAGE_TYPE is localStringyour-home-dir/.flowise/storage
S3_STORAGE_BUCKET_NAMEBucket name to hold the uploaded files when STORAGE_TYPE is s3String
S3_STORAGE_ACCESS_KEY_IDAWS Access KeyString
S3_STORAGE_SECRET_ACCESS_KEYAWS Secret KeyString
S3_STORAGE_REGIONRegion for S3 bucketString

Examples of how to set environment variables:

NPM

You can set all these variables when running Flowise using npx. For example:

npx flowise start --PORT=3000 --DEBUG=true

Docker

You can set all these variables in the .env file inside docker folder. Refer to .env.example file.