diff --git a/docs/docs/API-Reference/api-build.mdx b/docs/docs/API-Reference/api-build.mdx index 5f445e70e..80b7b5ae1 100644 --- a/docs/docs/API-Reference/api-build.mdx +++ b/docs/docs/API-Reference/api-build.mdx @@ -72,8 +72,8 @@ This endpoint builds and executes a flow, returning a job ID that can be used to -The `/build/$FLOW_ID/events` endpoint accepts an optional `stream` query parameter that defaults to `true`. -To disable streaming and get all events at once, set `stream` to `false`. +The `/build/$FLOW_ID/events` endpoint has a `stream` query parameter that defaults to true. +To disable streaming and get all events at once, set `?stream=false`. ```shell curl -X GET \ @@ -99,12 +99,12 @@ curl -X GET \ | files | array[string] | Optional. List of file paths to use. | | start_component_id | string | Optional. ID of the component where the execution should start. Component `id` values can be found in [Langflow JSON files](/concepts-flows-import#langflow-json-file-contents) | | stop_component_id | string | Optional. ID of the component where the execution should stop. Component `id` values can be found in [Langflow JSON files](/concepts-flows-import#langflow-json-file-contents).| -| log_builds | boolean | Optional. Control build logging. Default: `true`. | +| log_builds | Boolean | Whether to record build logs. Default: Enabled (true). | ### Set start and stop points The `/build` endpoint accepts optional values for `start_component_id` and `stop_component_id` to control where the flow run starts and stops. -Setting `stop_component_id` for a component triggers the same behavior as clicking the **Play** button on that component, where all dependent components leading up to that component are also run. +Setting `stop_component_id` for a component triggers the same behavior as clicking **Run component** on that component in the visual editor: The specified component and all dependent components leading up to that component will run. The following example stops flow execution at an **OpenAI** component: diff --git a/docs/docs/API-Reference/api-flows-run.mdx b/docs/docs/API-Reference/api-flows-run.mdx index 7043b2834..a8e13a3dd 100644 --- a/docs/docs/API-Reference/api-flows-run.mdx +++ b/docs/docs/API-Reference/api-flows-run.mdx @@ -143,7 +143,7 @@ The following example is truncated to illustrate a series of `token` events as w | Parameter | Type | Info | |-----------|------|------| | flow_id | UUID/string | Required. Part of URL: `/run/$FLOW_ID` | -| stream | boolean | Optional. Query parameter: `/run/$FLOW_ID?stream=true` | +| stream | Boolean | Optional. Query parameter: `/run/$FLOW_ID?stream=true` | | input_value | string | Optional. JSON body field. Main input text/prompt. Default: `null` | | input_type | string | Optional. JSON body field. Input type ("chat" or "text"). Default: `"chat"` | | output_type | string | Optional. JSON body field. Output type ("chat", "any", "debug"). Default: `"chat"` | diff --git a/docs/docs/API-Reference/api-logs.mdx b/docs/docs/API-Reference/api-logs.mdx index caa4fff55..f1dcdc92d 100644 --- a/docs/docs/API-Reference/api-logs.mdx +++ b/docs/docs/API-Reference/api-logs.mdx @@ -15,7 +15,7 @@ The `/logs` endpoint requires log retrieval to be enabled in your Langflow insta 1. To enable log retrieval, include these values in your `.env` file: ```text - LANGFLOW_ENABLE_LOG_RETRIEVAL=true + LANGFLOW_ENABLE_LOG_RETRIEVAL=True LANGFLOW_LOG_RETRIEVER_BUFFER_SIZE=10000 LANGFLOW_LOG_LEVEL=DEBUG ``` diff --git a/docs/docs/API-Reference/api-users.mdx b/docs/docs/API-Reference/api-users.mdx index 4aa65eee6..9deb82788 100644 --- a/docs/docs/API-Reference/api-users.mdx +++ b/docs/docs/API-Reference/api-users.mdx @@ -8,14 +8,11 @@ import TabItem from '@theme/TabItem'; Use the `/users` endpoint to manage user accounts in Langflow. -The `user_id` value is specifically for Langflow's user system, which is stored in the Langflow database and managed at the `/users` API endpoint. -The `user_id` primary key in the Langflow database is mapped to the `id` value in the API. - ## Add user -Create a new user account with a username and password. +Create a new user account with a given username and password. -This creates a new UUID for the user's `id`, which is mapped to `user_id` in the Langflow database. +Requires authentication as a superuser if the Langflow server has authentication enabled. ```bash curl -X POST \ @@ -28,6 +25,10 @@ curl -X POST \ }' ``` +The request returns an object describing the new user. +The user's UUID is stored in `user_id` in the Langflow database, and returned as `id` in the `/users` API response. +This `user_id` key is specifically for Langflow user management. +
Result @@ -54,7 +55,7 @@ curl -X POST \ ## Get current user -Retrieve information about the currently authenticated user. +Retrieve information about the authenticated user. ```bash curl -X GET \ @@ -85,7 +86,8 @@ curl -X GET \ ## List all users Get a paginated list of all users in the system. -Only superusers can use this endpoint (`is_superuser: true`). + +Requires authentication as a superuser if the Langflow server has authentication enabled. ```bash curl -X GET \ @@ -160,7 +162,9 @@ curl -X GET \ Modify an existing user's information with a PATCH request. -This example makes the user `10c1c6a2-ab8a-4748-8700-0e4832fd5ce8` an active superuser. +Requires authentication as a superuser if the Langflow server has authentication enabled. + +This example activates the specified user's account and makes them a superuser: ```bash curl -X PATCH \ @@ -199,9 +203,9 @@ curl -X PATCH \ ## Reset password -Change a user's password to a new secure value. +Change the specified user's password to a new secure value. -You can't change another user's password. +Requires authentication as the target user. ```bash curl -X PATCH \ @@ -241,7 +245,7 @@ curl -X PATCH \ Remove a user account from the system. -Only superusers can use this endpoint (`is_superuser: true`). +Requires authentication as a superuser if the Langflow server has authentication enabled. ```bash curl -X DELETE \ diff --git a/docs/docs/Agents/agents.mdx b/docs/docs/Agents/agents.mdx index 338fd9073..8fd29ef8a 100644 --- a/docs/docs/Agents/agents.mdx +++ b/docs/docs/Agents/agents.mdx @@ -159,9 +159,9 @@ For example, some models support additional modes, arguments, or features like c Some additional input parameters include the following: -* **Current Date** (`add_current_date_tool`): When enabled (`true`), this setting adds a tool to the agent that can retrieve the current date. -* **Handle Parse Errors** (`handle_parsing_errors`): When enabled (`true`), this setting allows the agent to fix errors, like typos, when analyzing user input. -* **Verbose** (`verbose`): When enabled (`true`), this setting records detailed logging output for debugging and analysis. +* **Current Date** (`add_current_date_tool`): When enabled (true), this setting adds a tool to the agent that can retrieve the current date. +* **Handle Parse Errors** (`handle_parsing_errors`): When enabled (true), this setting allows the agent to fix errors, like typos, when analyzing user input. +* **Verbose** (`verbose`): When enabled (true), this setting records detailed logging output for debugging and analysis. To view and configure all parameters, click
+### LANGFLOW_ENABLE_SUPERUSER_CLI {#langflow-enable-superuser-cli} + +Controls the availability of the `langflow superuser` command in the Langflow CLI. +The default is true, but false is recommended to prevent unrestricted superuser creation. +For more information, see [`langflow superuser`](/configuration-cli#langflow-superuser). + ### LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD {#langflow-superuser} These variables specify the username and password for the Langflow server's superuser. @@ -176,12 +182,11 @@ LANGFLOW_SUPERUSER=administrator LANGFLOW_SUPERUSER_PASSWORD=securepassword ``` -They are required if `LANGFLOW_AUTO_LOGIN=false`. +They are required if `LANGFLOW_AUTO_LOGIN=False`. Otherwise, they aren't relevant. -If required and not set, the default values are `langflow` and `langflow`. - -For more information, see [Start a Langflow server with authentication enabled](#start-a-langflow-server-with-authentication-enabled) and the CLI command [`langflow superuser`](/configuration-cli#langflow-superuser). +If required and not set in when you [start a Langflow server with authentication enabled](#start-a-langflow-server-with-authentication-enabled), then the default values are `langflow` and `langflow` for system auto-login behavior. +These defaults don't apply when using the Langflow CLI command [`langflow superuser`](/configuration-cli#langflow-superuser). ### LANGFLOW_SECRET_KEY {#langflow-secret-key} @@ -258,12 +263,6 @@ LANGFLOW_NEW_USER_IS_ACTIVE=False Only superusers can manage user accounts for a Langflow server, but user management only matters if your server has authentication enabled. For more information, see [Start a Langflow server with authentication enabled](#start-a-langflow-server-with-authentication-enabled). -### LANGFLOW_ENABLE_SUPERUSER_CLI {#langflow-enable-superuser-cli} - -Controls the availability of the `langflow superuser` command in the Langflow CLI. -The default is `True`, but `False` is recommended to prevent unrestricted superuser creation. -For more information, see [`langflow superuser`](/configuration-cli#langflow-superuser). - ## Start a Langflow server with authentication enabled This section shows you how to use the [authentication environment variables](/api-keys-and-authentication#authentication-environment-variables) to deploy a Langflow server with authentication enabled. @@ -293,7 +292,7 @@ Additionally, you must sign in as a superuser to manage users and [create a Lang 2. Set `LANGFLOW_SUPERUSER` and `LANGFLOW_SUPERUSER_PASSWORD` to your desired superuser credentials. For a one-time test, you can use basic credentials like `administrator` and `password`. - Strong, securely-stored credentials are recommended for true development and production environments. + Strong, securely-stored credentials are recommended in genuine development and production environments. 3. Recommended: Generate and set a `LANGFLOW_SECRET_KEY` for encrypting sensitive data. @@ -319,7 +318,7 @@ Additionally, you must sign in as a superuser to manage users and [create a Lang ``` Starting Langflow with an `.env` file automatically authenticates you as the superuser set in `LANGFLOW_SUPERUSER` and `LANGFLOW_SUPERUSER_PASSWORD`. - If you don't explicitly set these variables, the default values are `langflow` and `langflow`. + If you don't explicitly set these variables, the default values are `langflow` and `langflow` for system auto-login. 6. Verify the server is running. The default location is `http://localhost:7860`. diff --git a/docs/docs/Configuration/configuration-cli.mdx b/docs/docs/Configuration/configuration-cli.mdx index 55dd595a3..a751e2f4b 100644 --- a/docs/docs/Configuration/configuration-cli.mdx +++ b/docs/docs/Configuration/configuration-cli.mdx @@ -3,9 +3,32 @@ title: Langflow CLI slug: /configuration-cli --- -import Link from '@docusaurus/Link'; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import Icon from "@site/src/components/icon"; -The Langflow command line interface (Langflow CLI) is the main interface for managing and running the Langflow server. +The Langflow command line interface is the main interface for managing and running the Langflow server. + +The Langflow CLI is automatically installed when you [install the Langflow package](/get-started-installation). +It isn't available for Langflow Desktop. + +## How to use the CLI + +The Langflow CLI can be invoked in several ways, depending on your installation method and environment. + +The recommended approach is to run the CLI with `uv run` from within a virtual environment where Langflow is installed. + +For example, to start Langflow on the default port, run the following command: + + ```bash + uv run langflow run + ``` + +If Langflow is installed globally or added to your PATH, you can execute the CLI directly with `langflow`. + + ```bash + langflow run + ``` ## Precedence @@ -14,14 +37,12 @@ Langflow CLI options override the values of [environment variables](/environment For example, if you have `LANGFLOW_PORT=7860` defined as an environment variable, and you run the CLI with `--port 7880`, then Langflow sets the port to `7880` because the CLI option overrides the environment variable. This also applies to Boolean environment variables. -For example, if your set `LANGFLOW_REMOVE_API_KEYS=True` in your `.env` file, then you can change this to `False` by running the CLI with `--no-remove-api-keys`. +For example, if you set `LANGFLOW_REMOVE_API_KEYS=True` in your `.env` file, then you can change it to `False` by running the CLI with `--no-remove-api-keys`. -## Options +## Langflow CLI options All Langflow CLI commands support options that modify the command's behavior or set environment variables. -### Option syntax - To set values for options, you can use either of the following syntax styles: * `--option value` @@ -32,152 +53,318 @@ Values with spaces must be surrounded by quotation marks: * `--option 'Value with Spaces'` * `--option="Value with Spaces"` -### Boolean forms +### Boolean options Boolean options enable and disable settings. -They accept no value. -Instead, each Boolean option has a true (enabled) and false (disabled) form: +They have a true (enabled) and false (disabled) form: * Enabled (true): `--option` * Disabled (false): `--no-option` -For example, `--remove-api-keys` is equivalent to `LANGFLOW_REMOVE_API_KEYS=True`: +The following examples compare Boolean option forms for `REMOVE_API_KEYS`. + + + + +`--remove-api-keys` is equivalent to setting `LANGFLOW_REMOVE_API_KEYS=True` in `.env`: ```bash -langflow run --remove-api-keys +uv run langflow run --remove-api-keys ``` -In contrast, `--no-remove-api-keys` is equivalent to `LANGFLOW_REMOVE_API_KEYS=False`: + + + +`--no-remove-api-keys` is equivalent to `LANGFLOW_REMOVE_API_KEYS=False` in `.env`: ```bash -langflow run --no-remove-api-keys +uv run langflow run --no-remove-api-keys ``` -### Default options + + + +In the following command references, default values for Booleans include both the CLI flag and the equivalent Boolean evaluation, such as "`--option` (true)" and "`--no-option` (false)". + +### Universal options The following options are available for all Langflow CLI commands: +* `--version`, `-v`: Show the version and exit. * `--install-completion`: Install auto-completion for the current shell. * `--show-completion`: Show the location of the auto-completion config file, if installed. * `--help`: Print information about command usage, options, and arguments. -These are modifiers that change the output or execution of a command. -They aren't Booleans, and they accept no values. - ## CLI commands -The following sections describe the available CLI commands and any non-default options available for each command. +The following sections describe the available CLI commands and any additional options (beyond the [universal options](#universal-options)) available for each command. ### langflow -Running the CLI without any arguments prints a list of available options and commands: +Running the CLI without any arguments prints a list of available options and commands. + + + + +```bash +uv run langflow +``` + + + ```bash langflow -# or -python -m langflow ``` + + + ### langflow api-key {#langflow-api-key} -Create a Langflow API key with superuser privileges. +Creates a Langflow API key. + +You must be a superuser to create API keys with the CLI. For more information, see [Langflow API keys](/api-keys-and-authentication#langflow-api-keys). + + + ```bash -langflow api-key -# or uv run langflow api-key ``` + + + +```bash +langflow api-key +``` + + + + +#### Options + +| Option | Default | Type | Description | +|--------|---------|--------|-------------| +| `--log-level` | `error` | String | The logging level. One of `debug`, `info`, `warning`, `error`, or `critical`. | + ### langflow copy-db -Copy the Langflow database files from the cache directory to the current directory containing `__main__.py`. -You can find this directory by running `which langflow`. +Copies the Langflow database files from the cache directory to the current Langflow installation directory, which is the directory containing `__main__.py`. +You can find the copy target directory by running `which langflow`. + +The following files are copied if they exist in the cache directory: + +* `langflow.db`: The main Langflow database, stored in the user cache directory +* `langflow-pre.db`: The pre-release database, if it exists + + + + +```bash +uv run langflow copy-db +``` + + + ```bash langflow copy-db -# or -python -m langflow copy-db ``` -The database files are `langflow.db` and `langflow-pre.db`. -If these files don't exist in the cache directory, then nothing is copied. + + ### langflow migration -Run or test database migrations: +Manages Langflow database schema changes using [Alembic](https://alembic.sqlalchemy.org/en/latest/), a database migration tool for SQLAlchemy. -```bash -langflow migration [OPTIONS] -# or -python -m langflow migration [OPTIONS] -``` +The `migration` command has two modes: -#### Options +* **Test mode (default)**: Checks if migrations can be applied safely without actually running the migrations. +Use this mode to previews the changes that would be made to the database schema before proceeding with the migrations. -| Option | Default | Type | Description | -|--------|---------|--------|-------------| -| `--test` | `true` | Boolean | Run migrations in test mode. Use `--no-test` to disable test mode. | -| `--fix` | `false` (`--no-fix`) | Boolean | Fix migrations. This is a destructive operation, and all affected data will be deleted. Only use this option if you know what you are doing. | +* **Fix mode**: Applies the migrations to update the database schema. + + :::warning + `langflow migration --fix` is a destructive operation that can delete data. + Always run `langflow migration` first to preview the changes. + ::: + + + + +1. Run test mode: + + ```bash + uv run langflow migration + ``` + +2. Preview the changes returned by the test to determine if it's safe to proceed with the migration. + +3. Run fix mode to apply the changes: + + ```bash + uv run langflow migration --fix + ``` + + + + +1. Run test mode: + + ```bash + langflow migration + ``` + +2. Preview the changes returned by the test to determine if it's safe to proceed with the migration. + +3. Run fix mode to apply the changes: + + ```bash + langflow migration --fix + ``` + + + ### langflow run -Start the Langflow server. +Starts the Langflow server. + + + + +```bash +uv run langflow run [OPTIONS] +``` + + + ```bash langflow run [OPTIONS] -# or -python -m langflow run [OPTIONS] ``` + + + #### Options +This command supports some common and non-sensitive configuration options for your Langflow server. +Other options must be set in the `.env` or your terminal. +For more information Langflow configuration options, see [Langflow environment variables](/environment-variables). + | Option | Default | Type | Description | |--------|---------|--------|-------------| -| `--host` | `localhost` | String | The host on which the Langflow server will run. | -| `--workers` | `1` | Integer | Number of worker processes. | -| `--worker-timeout` | `300` | Integer | Worker timeout in seconds. | -| `--port` | `7860` | Integer | The port on which the Langflow server will run. The server automatically selects a free port if the specified port is in use. | -| `--components-path` | `/components` | String | Path to the directory containing custom components. | -| `--env-file` | Not set | String | Path to the `.env` file containing environment variables. | -| `--log-level` | `critical` | Enum | Set the logging level as one of `debug`, `info`, `warning`, `error`, or `critical`. | -| `--log-file` | `logs/langflow.log` | String | Set the path to the log file for Langflow. | -| `--cache` | `async` | Enum | Type of cache to use as one of `async`, `redis`, `memory`, or `disk`. | -| `--frontend-path` | `./frontend` | String | Path to the frontend directory containing build files. This is for development purposes only. | -| `--open-browser` | `true` | Boolean | Open the system web browser on startup. Use `--no-open-browser` to disable opening the system web browser on startup. | -| `--remove-api-keys` | `false` (`--no-remove-api-keys`) | Boolean | Remove API keys from the projects saved in the database. | -| `--backend-only` | `false` (`--no-backend-only`) | Boolean | Only run Langflow's backend server (no frontend). | -| `--store` | `true` | Boolean | Enable the Langflow Store features. Use `--no-store` to disable the Langflow Store features. | -| `--auto-saving` | `true` | Boolean | Enable flow auto-saving. Use `--no-auto-saving` to disable flow auto-saving. | -| `--auto-saving-interval` | `1000` | Integer | Set the interval for flow auto-saving in milliseconds. | -| `--health-check-max-retries` | `5` | Integer | Set the maximum number of retries for the health check. Use `--no-health-check-max-retries` to disable the maximum number of retries for the health check. | -| `--max-file-size-upload` | `100` | Integer | Set the maximum file size for the upload in megabytes. | -| `--ssl-cert-file-path` | Not set | String | Path to the SSL certificate file on the local system. | -| `--ssl-key-file-path` | Not set | String | Path to the SSL key file on the local system. | +| `--auto-saving` | `--auto-saving` (true) | Boolean | Whether to enable flow auto-saving. Use `--no-auto-saving` to disable flow auto-saving. | +| `--auto-saving-interval` | `1000` | Integer | The interval for flow auto-saving in milliseconds. | +| `--backend-only` | `--no-backend-only` (false) | Boolean | Whether to run Langflow's backend service only (no frontend). Omit or use `--no-backend-only` to start both the frontend and backend. See [Start Langflow in headless mode](#start-langflow-in-headless-mode). | +| `--cache` | `async` | String | The type of cache to use. One of `async`, `redis`, `memory`, or `disk`. | +| `--components-path` | Not set | String | The path to the directory containing custom components. | +| `--dev` | `--no-dev` (false) | Boolean | Whether to run in development mode (may contain bugs). | +| `--env-file` | Not set | String | The path to the `.env` file containing Langflow environment variables. See [Start Langflow with a specific .env file](#start-langflow-with-a-specific-env-file). | +| `--frontend-path` | Not set | String | The path to the frontend directory containing build files. This is only used when [contributing to the Langflow codebase](/contributing-how-to-contribute) or developing a custom Langflow image that includes customized frontend code. | +| `--health-check-max-retries` | `5` | Integer | The maximum number of retries for the health check. | +| `--host` | `localhost` | String | The host on which the Langflow server will run. | +| `--log-file` | `logs/langflow.log` | String | The path to the log file for Langflow. | +| `--log-level` | `critical` | String | The logging level as one of `debug`, `info`, `warning`, `error`, or `critical`. | +| `--log-rotation` | Not set | String | The log rotation (Time/Size). | +| `--max-file-size-upload` | `100` | Integer | The maximum size in megabytes for file uploads. | +| `--open-browser` | `--no-open-browser` (false) | Boolean | Whether to open the system web browser on startup. Use `--open-browser` to open the system's default web browser when Langflow starts. | +| `--port` | `7860` | Integer | The port on which the Langflow server will run. The server automatically selects a free port if the specified port is in use. | +| `--remove-api-keys` | `--no-remove-api-keys` (false) | Boolean | Whether to remove API keys from projects saved in the Langflow database. | +| `--ssl-cert-file-path` | Not set | String | The path to the SSL certificate file on the local system. | +| `--ssl-key-file-path` | Not set | String | The path to the SSL key file on the local system. | +| `--store` | `--store` (true) | Boolean | Whether to enable the Langflow Store features. Use `--no-store` to disable the Langflow Store features. | +| `--worker-timeout` | `300` | Integer | The worker timeout in seconds. | +| `--workers` | `1` | Integer | The number of worker processes. | -For information about the environment variables that correspond to these options, see [Supported environment variables](/environment-variables#supported-variables). +#### Start Langflow with a specific .env file {#start-langflow-with-a-specific-env-file} + +The `--env-file` option starts Langflow using the configuration defined in the given `.env` file. +Additional options appended to this command override the values in the `.env` file if there are duplicates. + +If `--env-file` is omitted or doesn't include all required variables, Langflow uses the default values for those variables. + + + + +```bash +uv run langflow run --env-file PATH/TO/LANGFLOW/.env +``` + + + + +```bash +langflow run --env-file PATH/TO/LANGFLOW/.env +``` + + + + +#### Start Langflow in headless mode {#start-langflow-in-headless-mode} + +The `--backend-only` option starts Langflow's backend service only. +This headless mode has no frontend (visual editor), and you can only access the server programmatically with the Langflow API and CLI. + + + + +```bash +uv run langflow run --backend-only +``` + + + + +```bash +langflow run --backend-only +``` + + + ### langflow superuser {#langflow-superuser} -Create a superuser account. +Creates a superuser account with the given username and password. -Controlled by the [`LANGFLOW_ENABLE_SUPERUSER_CLI`](/api-keys-and-authentication#langflow-enable-superuser-cli) environment variable: - -* **`LANGFLOW_ENABLE_SUPERUSER_CLI=True` (Default)**: The `langflow superuser` command is available, and superuser creation is unrestricted. -* **`LANGFLOW_ENABLE_SUPERUSER_CLI=False` (Recommended)**: Disables the `langflow superuser` command. -For security reasons, this is recommended to prevent unauthorized superuser creation, especially in production environments. + + ```bash -langflow superuser [OPTIONS] -# or -python -m langflow superuser [OPTIONS] +uv run langflow superuser --username [NAME] --password [PASSWORD] [OPTIONS] ``` + + + +```bash +langflow superuser --username [NAME] --password [PASSWORD] [OPTIONS] +``` + + + + #### Options | Option | Default | Type | Description | |--------|---------|--------|-------------| -| `--username` | `langflow` | String | Specify the name for the superuser. | -| `--password` | `langflow` | String | Specify the password for the superuser. | +| `--log-level` | `error` | String | The logging level. One of `debug`, `info`, `warning`, `error`, or `critical`. | -For more information, see [`LANGFLOW_SUPERUSER` and `LANGFLOW_SUPERUSER_PASSWORD`](/api-keys-and-authentication#langflow-superuser). \ No newline at end of file +For this command, `--username` and `--password` aren't optional, and they have no default value. +The command fails if you don't provide these arguments. +For more information, see [`LANGFLOW_SUPERUSER` and `LANGFLOW_SUPERUSER_PASSWORD`](/api-keys-and-authentication#langflow-superuser). + +#### Disable CLI superuser creation + +The `langflow superuser` command is controlled by the [`LANGFLOW_ENABLE_SUPERUSER_CLI`](/api-keys-and-authentication#langflow-enable-superuser-cli) environment variable: + +* **`LANGFLOW_ENABLE_SUPERUSER_CLI=True` (default)**: The `langflow superuser` command is available, and superuser creation is unrestricted. +* **`LANGFLOW_ENABLE_SUPERUSER_CLI=False` (recommended)**: Disables the `langflow superuser` command. +For security reasons, this is recommended to prevent unauthorized superuser creation, especially in production environments. + +To disable the `langflow superuser` command, you must set `LANGFLOW_ENABLE_SUPERUSER_CLI=False` in your Langflow `.env` file, and then [start Langflow with your `.env` file](#start-langflow-with-a-specific-env-file). \ No newline at end of file diff --git a/docs/docs/Configuration/configuration-global-variables.mdx b/docs/docs/Configuration/configuration-global-variables.mdx index b77ee85b9..2b8977a8f 100644 --- a/docs/docs/Configuration/configuration-global-variables.mdx +++ b/docs/docs/Configuration/configuration-global-variables.mdx @@ -156,17 +156,9 @@ When adding global variables from the environment, the following limitations app - Global variables that you add from the environment always have the **Credential** type. ::: -If you want to explicitly prevent Langflow from sourcing global variables from the environment, set `LANGFLOW_STORE_ENVIRONMENT_VARIABLES` to `false` in your `.env` file: +If you want to explicitly prevent Langflow from sourcing global variables from the environment, set `LANGFLOW_STORE_ENVIRONMENT_VARIABLES=False` in your `.env` file. -```text -LANGFLOW_STORE_ENVIRONMENT_VARIABLES=false -``` - -If you want to automatically set fallback values for your global variables from environment variables, set the `LANGFLOW_FALLBACK_FROM_ENV_VAR` environment variable to `true` in your `.env` file. When this feature is enabled, if a global variable isn't found, Langflow attempts to use an environment variable with the same name as a backup. - -```text -LANGFLOW_FALLBACK_FROM_ENV_VAR=true -``` +If you want to automatically set fallback values for your global variables from environment variables, set `LANGFLOW_FALLBACK_FROM_ENV_VAR=True` in your `.env` file. When this setting is enabled, if a global variable isn't found, Langflow attempts to use an environment variable with the same name as a backup. ## Default environment variables diff --git a/docs/docs/Configuration/environment-variables.mdx b/docs/docs/Configuration/environment-variables.mdx index 865efe83a..d4bf13414 100644 --- a/docs/docs/Configuration/environment-variables.mdx +++ b/docs/docs/Configuration/environment-variables.mdx @@ -77,18 +77,18 @@ If it detects a supported environment variable, then it automatically adopts the 3. Define [Langflow environment variables](#supported-variables) in the `.env` file. For example: ```text - DO_NOT_TRACK=true - LANGFLOW_AUTO_LOGIN=false - LANGFLOW_AUTO_SAVING=true + DO_NOT_TRACK=True + LANGFLOW_AUTO_LOGIN=False + LANGFLOW_AUTO_SAVING=True LANGFLOW_AUTO_SAVING_INTERVAL=1000 - LANGFLOW_BACKEND_ONLY=false + LANGFLOW_BACKEND_ONLY=False LANGFLOW_BUNDLE_URLS=["https://github.com/user/repo/commit/hash"] LANGFLOW_CACHE_TYPE=async LANGFLOW_COMPONENTS_PATH=/path/to/components/ LANGFLOW_CONFIG_DIR=/path/to/config/ LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow - LANGFLOW_DEV=false - LANGFLOW_FALLBACK_TO_ENV_VAR=false + LANGFLOW_DEV=False + LANGFLOW_FALLBACK_TO_ENV_VAR=False LANGFLOW_HEALTH_CHECK_MAX_RETRIES=5 LANGFLOW_HOST=localhost LANGFLOW_LANGCHAIN_CACHE=InMemoryCache @@ -96,13 +96,13 @@ If it detects a supported environment variable, then it automatically adopts the LANGFLOW_MAX_ITEMS_LENGTH=100 LANGFLOW_MAX_TEXT_LENGTH=1000 LANGFLOW_LOG_LEVEL=error - LANGFLOW_OPEN_BROWSER=false + LANGFLOW_OPEN_BROWSER=False LANGFLOW_PORT=7860 - LANGFLOW_REMOVE_API_KEYS=false - LANGFLOW_SAVE_DB_IN_CONFIG_DIR=true + LANGFLOW_REMOVE_API_KEYS=False + LANGFLOW_SAVE_DB_IN_CONFIG_DIR=True LANGFLOW_SECRET_KEY=somesecretkey - LANGFLOW_STORE=true - LANGFLOW_STORE_ENVIRONMENT_VARIABLES=true + LANGFLOW_STORE=True + LANGFLOW_STORE_ENVIRONMENT_VARIABLES=True LANGFLOW_SUPERUSER=adminuser LANGFLOW_SUPERUSER_PASSWORD=adminpass LANGFLOW_WORKER_TIMEOUT=60000 @@ -145,26 +145,24 @@ The following table lists the environment variables supported by Langflow. | Variable | Format | Default | Description | |----------|--------|---------|-------------| -| `DO_NOT_TRACK` | Boolean | `false` | If `true`, Langflow telemetry is disabled. | -| `LANGFLOW_AUTO_LOGIN` | Boolean | `true` | See [`LANGFLOW_AUTO_LOGIN`](/api-keys-and-authentication#langflow-auto-login). | -| `LANGFLOW_AUTO_SAVING` | Boolean | `true` | Enable flow auto-saving. See [`--auto-saving`](./configuration-cli.mdx#run-auto-saving). | -| `LANGFLOW_AUTO_SAVING_INTERVAL` | Integer | `1000` | Set the interval for flow auto-saving in milliseconds. See [`--auto-saving-interval`](./configuration-cli.mdx#run-auto-saving-interval). | -| `LANGFLOW_BACKEND_ONLY` | Boolean | `false` | Only run Langflow's backend server (no frontend). See [`--backend-only`](./configuration-cli.mdx#run-backend-only). | -| `LANGFLOW_BUNDLE_URLS` | List [String] | `[]` | A list of URLs from which to load component bundles and flows. Supports GitHub URLs. If LANGFLOW_AUTO_LOGIN is enabled, flows from these bundles are loaded into the database. | -| `LANGFLOW_CACHE_TYPE` | String | `async` | Set the cache type for Langflow. Possible values: `async`, `redis`, `memory`, `disk`. If you set the type to `redis`, then you must also set the following environment variables: LANGFLOW_REDIS_HOST, LANGFLOW_REDIS_PORT, LANGFLOW_REDIS_DB, and LANGFLOW_REDIS_CACHE_EXPIRE. | -| `LANGFLOW_COMPONENTS_PATH` | String | `/components` | Path to the directory containing custom components. See [`--components-path`](./configuration-cli.mdx#run-components-path). | -| `LANGFLOW_CONFIG_DIR` | String | Varies | Set the Langflow configuration directory where files, logs, and the Langflow database are stored. Default path depends on your installation. See [Flow storage and logs](/concepts-flows#flow-storage-and-logs) | +| `DO_NOT_TRACK` | Boolean | False | Whether to report [Langflow telemetry data](/contributing-telemetry). If true, Langflow telemetry is disabled. | +| `LANGFLOW_AUTO_LOGIN` | Boolean | True | See [`LANGFLOW_AUTO_LOGIN`](/api-keys-and-authentication#langflow-auto-login). | +| `LANGFLOW_AUTO_SAVING` | Boolean | True | Enable flow auto-saving. | +| `LANGFLOW_AUTO_SAVING_INTERVAL` | Integer | `1000` | Set the interval for flow auto-saving in milliseconds. | +| `LANGFLOW_BACKEND_ONLY` | Boolean | False | Run only the Langflow backend service (no frontend). | +| `LANGFLOW_BUNDLE_URLS` | List[String] | `[]` | A list of URLs from which to load component bundles and flows. Supports GitHub URLs. If LANGFLOW_AUTO_LOGIN is enabled, flows from these bundles are loaded into the database. | +| `LANGFLOW_CACHE_TYPE` | String | `async` | Set the cache type for Langflow. Possible values: `async`, `redis`, `memory`, `disk`. If you set the type to `redis`, then you must also set the following environment variables: `LANGFLOW_REDIS_HOST`, `LANGFLOW_REDIS_PORT`, `LANGFLOW_REDIS_DB`, and `LANGFLOW_REDIS_CACHE_EXPIRE`. | +| `LANGFLOW_COMPONENTS_PATH` | String | Not set | Path to the directory containing custom components. | +| `LANGFLOW_CONFIG_DIR` | String | Varies | Set the Langflow configuration directory where files, logs, and the Langflow database are stored. Default path depends on your installation. See [Flow storage and logs](/concepts-flows#flow-storage-and-logs). | | `LANGFLOW_DATABASE_URL` | String | Not set | Set the database URL for Langflow. If not provided, Langflow uses a SQLite database. | -| `LANGFLOW_USE_NOOP_DATABASE` | Boolean | `false` | Use a no-op database, which avoids database connections and operations. Useful for running flows without a database. | -| `LANGFLOW_DATABASE_CONNECTION_RETRY` | Boolean | `false` | If True, Langflow tries to connect to the database again if it fails. | -| `LANGFLOW_DB_POOL_SIZE` | Integer | `10` | **DEPRECATED:** Use `LANGFLOW_DB_CONNECTION_SETTINGS` instead. The number of connections to keep open in the connection pool. | -| `LANGFLOW_DB_MAX_OVERFLOW` | Integer | `20` | **DEPRECATED:** Use `LANGFLOW_DB_CONNECTION_SETTINGS` instead. The number of connections to allow that can be opened beyond the pool size. | -| `LANGFLOW_DB_CONNECT_TIMEOUT` | Integer | `20` | The number of seconds to wait before giving up on a lock to be released or establishing a connection to the database. | -| `LANGFLOW_DB_CONNECTION_SETTINGS` | JSON | Not set | A JSON dictionary to centralize database connection parameters. Example: `{"pool_size": 10, "max_overflow": 20}` | -| `LANGFLOW_DISABLE_TRACK_APIKEY_USAGE` | Boolean | `false` | If set to `true`, disables tracking of API key usage (`total_uses` and `last_used_at`) to avoid database contention under high concurrency. | -| `LANGFLOW_ENABLE_LOG_RETRIEVAL` | Boolean | `false` | Enable log retrieval functionality. | -| `LANGFLOW_ENABLE_SUPERUSER_CLI` | Boolean | `true` | Allow creation of superusers with the Langflow CLI command [`langflow superuser`](./configuration-cli.mdx#langflow-superuser). Recommended to be `false` in production for security reasons. | -| `LANGFLOW_FALLBACK_TO_ENV_VAR` | Boolean | `true` | If enabled, [global variables](/configuration-global-variables) set in your Langflow **Settings** can use an environment variable with the same name if Langflow can't retrieve the variable value from the global variables. | +| `LANGFLOW_DATABASE_CONNECTION_RETRY` | Boolean | False | Whether to retry lost connections to the Langflow database. If true, Langflow tries to connect to the database again if the connection fails. | +| `LANGFLOW_DB_POOL_SIZE` | Integer | `20` | **DEPRECATED:** Use `LANGFLOW_DB_CONNECTION_SETTINGS` instead. The number of connections to keep open in the connection pool. | +| `LANGFLOW_DB_MAX_OVERFLOW` | Integer | `30` | **DEPRECATED:** Use `LANGFLOW_DB_CONNECTION_SETTINGS` instead. The number of connections to allow that can be opened beyond the pool size. | +| `LANGFLOW_DB_CONNECT_TIMEOUT` | Integer | `30` | The number of seconds to wait before giving up on a lock to be released or establishing a connection to the database. | +| `LANGFLOW_DB_CONNECTION_SETTINGS` | JSON | Not set | A JSON dictionary to centralize database connection parameters. Example: `{"pool_size": 20, "max_overflow": 30}` | +| `LANGFLOW_DISABLE_TRACK_APIKEY_USAGE` | Boolean | False | Whether to track API key usage. If true, disables tracking of API key usage (`total_uses` and `last_used_at`) to avoid database contention under high concurrency. | +| `LANGFLOW_ENABLE_SUPERUSER_CLI` | Boolean | True | Allow creation of superusers with the Langflow CLI command [`langflow superuser`](./configuration-cli.mdx#langflow-superuser). Recommended to be disabled (false) in production for security reasons. | +| `LANGFLOW_FALLBACK_TO_ENV_VAR` | Boolean | True | If enabled, [global variables](/configuration-global-variables) set in your Langflow **Settings** can use an environment variable with the same name if Langflow can't retrieve the variable value from the global variables. | | `LANGFLOW_FRONTEND_PATH` | String | `./frontend` | Path to the frontend directory containing build files. This is for development purposes only. See [`--frontend-path`](./configuration-cli.mdx#run-frontend-path). | | `LANGFLOW_HEALTH_CHECK_MAX_RETRIES` | Integer | `5` | Set the maximum number of retries for the health check. See [`--health-check-max-retries`](./configuration-cli.mdx#run-health-check-max-retries). | | `LANGFLOW_HOST` | String | `localhost` | The host on which the Langflow server will run. See [`--host`](./configuration-cli.mdx#run-host). | @@ -175,34 +173,34 @@ The following table lists the environment variables supported by Langflow. | `LANGFLOW_MAX_FILE_SIZE_UPLOAD` | Integer | `100` | Set the maximum file size for the upload in megabytes. See [`--max-file-size-upload`](./configuration-cli.mdx#run-max-file-size-upload). | | `LANGFLOW_MAX_ITEMS_LENGTH` | Integer | `100` | Maximum number of items to store and display in the visual editor. Lists longer than this will be truncated when displayed in the visual editor. Doesn't affect data passed between components nor outputs. | | `LANGFLOW_MAX_TEXT_LENGTH` | Integer | `1000` | Maximum number of characters to store and display in the visual editor. Responses longer than this will be truncated when displayed in the visual editor. Doesn't truncate responses between components nor outputs. | -| `LANGFLOW_MCP_SERVER_ENABLED` | Boolean | `true` | If this option is set to False, Langflow doesn't enable the MCP server. | -| `LANGFLOW_MCP_SERVER_ENABLE_PROGRESS_NOTIFICATIONS` | Boolean | `false` | If this option is set to True, Langflow sends progress notifications in the MCP server. | -| `LANGFLOW_NEW_USER_IS_ACTIVE` | Boolean | `false` | See [`LANGFLOW_NEW_USER_IS_ACTIVE`](/api-keys-and-authentication#langflow-new-user-is-active). | -| `LANGFLOW_OPEN_BROWSER` | Boolean | `false` | Open the system web browser on startup. See [`--open-browser`](./configuration-cli.mdx#run-open-browser). | -| `LANGFLOW_PORT` | Integer | `7860` | The port on which the Langflow server runs. The server automatically selects a free port if the specified port is in use. See [`--port`](./configuration-cli.mdx#run-port). | -| `LANGFLOW_PROMETHEUS_ENABLED` | Boolean | `false` | Expose Prometheus metrics. | +| `LANGFLOW_MCP_SERVER_ENABLED` | Boolean | True | If this option is set to False, Langflow doesn't enable the MCP server. | +| `LANGFLOW_MCP_SERVER_ENABLE_PROGRESS_NOTIFICATIONS` | Boolean | False | If this option is set to True, Langflow sends progress notifications in the MCP server. | +| `LANGFLOW_NEW_USER_IS_ACTIVE` | Boolean | False | See [`LANGFLOW_NEW_USER_IS_ACTIVE`](/api-keys-and-authentication#langflow-new-user-is-active). | +| `LANGFLOW_OPEN_BROWSER` | Boolean | False | Open the system web browser on startup. | +| `LANGFLOW_PORT` | Integer | `7860` | The port on which the Langflow server runs. The server automatically selects a free port if the specified port is in use. | +| `LANGFLOW_PROMETHEUS_ENABLED` | Boolean | False | Expose Prometheus metrics. | | `LANGFLOW_PROMETHEUS_PORT` | Integer | `9090` | Set the port on which Langflow exposes Prometheus metrics. | | `LANGFLOW_REDIS_CACHE_EXPIRE` | Integer | `3600` | See `LANGFLOW_CACHE_TYPE`. | | `LANGFLOW_REDIS_DB` | Integer | `0` | See `LANGFLOW_CACHE_TYPE`. | | `LANGFLOW_REDIS_HOST` | String | `localhost` | See `LANGFLOW_CACHE_TYPE`. | | `LANGFLOW_REDIS_PORT` | String | `6379` | See `LANGFLOW_CACHE_TYPE`. | | `LANGFLOW_REDIS_PASSWORD` | String | Not set | Password for Redis authentication when using Redis cache type. | -| `LANGFLOW_REMOVE_API_KEYS` | Boolean | `false` | Remove API keys from the projects saved in the database. See [`--remove-api-keys`](./configuration-cli.mdx#run-remove-api-keys). | -| `LANGFLOW_SAVE_DB_IN_CONFIG_DIR` | Boolean | `false` | Save the Langflow database in `LANGFLOW_CONFIG_DIR` instead of in the Langflow package directory. Note, when this variable is set to default (`false`), the database isn't shared between different virtual environments and the database is deleted when you uninstall Langflow. | +| `LANGFLOW_REMOVE_API_KEYS` | Boolean | False | Remove API keys from the projects saved in the database. | +| `LANGFLOW_SAVE_DB_IN_CONFIG_DIR` | Boolean | False | If false (default), the Langflow database is saved in the `langflow` root directory. This means the database isn't shared between different virtual environments, and the database is deleted when you uninstall Langflow. If true, the database is saved in the `LANGFLOW_CONFIG_DIR`. | | `LANGFLOW_SECRET_KEY` | String | Automated | See [`LANGFLOW_SECRET_KEY`](/api-keys-and-authentication#langflow-secret-key). | -| `LANGFLOW_STORE` | Boolean | `true` | Enable the Langflow Store. See [`--store`](/configuration-cli#run-store). | -| `LANGFLOW_STORE_ENVIRONMENT_VARIABLES` | Boolean | `true` | Store environment variables as [global variables](/configuration-global-variables) in the database. | -| `LANGFLOW_CREATE_STARTER_PROJECTS` | Boolean | `true` | If this option is enabled, Langflow creates starter projects during initialization. Set to `false` to skip all starter project creation and updates. | -| `LANGFLOW_UPDATE_STARTER_PROJECTS` | Boolean | `true` | If this option is enabled, Langflow updates starter projects with the latest component versions when initializing. | +| `LANGFLOW_STORE` | Boolean | True | Whether to enable the Langflow Store features. | +| `LANGFLOW_STORE_ENVIRONMENT_VARIABLES` | Boolean | True | Whether to store environment variables as [global variables](/configuration-global-variables) in the database. | +| `LANGFLOW_CREATE_STARTER_PROJECTS` | Boolean | True | Whether to create templates during initialization. If false, Langflow doesn't create templates, and `LANGFLOW_UPDATE_STARTER_PROJECTS` is treated as false. | +| `LANGFLOW_UPDATE_STARTER_PROJECTS` | Boolean | True | Whether to update templates with the latest component versions when initializing after an upgrade. | | `LANGFLOW_SUPERUSER` | String | `langflow` | See [`LANGFLOW_SUPERUSER` and `LANGFLOW_SUPERUSER_PASSWORD`](/api-keys-and-authentication#langflow-superuser). | | `LANGFLOW_SUPERUSER_PASSWORD` | String | `langflow` | See [`LANGFLOW_SUPERUSER` and `LANGFLOW_SUPERUSER_PASSWORD`](/api-keys-and-authentication#langflow-superuser). | -| `LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` | String | Not set | Comma-separated list of environment variables to get from the environment and store as [global variables](/configuration-global-variables). | +| `LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` | String | Not set | Comma-separated list of environment variables to get from the environment and store as [global variables](/configuration-global-variables). | | `LANGFLOW_LOAD_FLOWS_PATH` | String | Not set | Path to a directory containing flow JSON files to be loaded on startup. Note that this feature only works if `LANGFLOW_AUTO_LOGIN` is enabled. | -| `LANGFLOW_WORKER_TIMEOUT` | Integer | `300` | Worker timeout in seconds. See [`--worker-timeout`](./configuration-cli.mdx#run-worker-timeout). | -| `LANGFLOW_WORKERS` | Integer | `1` | Number of worker processes. See [`--workers`](./configuration-cli.mdx#run-workers). | +| `LANGFLOW_WORKER_TIMEOUT` | Integer | `300` | Worker timeout in seconds. | +| `LANGFLOW_WORKERS` | Integer | `1` | Number of worker processes. | | `LANGFLOW_SSL_CERT_FILE` | String | Not set | Path to the SSL certificate file on the local system. | | `LANGFLOW_SSL_KEY_FILE` | String | Not set | Path to the SSL key file on the local system. | -| `LANGFLOW_SKIP_AUTH_AUTO_LOGIN` | Boolean | `true` | See [`LANGFLOW_AUTO_LOGIN`](/api-keys-and-authentication#langflow-auto-login). | +| `LANGFLOW_SKIP_AUTH_AUTO_LOGIN` | Boolean | True | See [`LANGFLOW_AUTO_LOGIN`](/api-keys-and-authentication#langflow-auto-login). | ## Configure .env, override.conf, and tasks.json files @@ -216,18 +214,18 @@ The `.env` file is a text file that contains key-value pairs of environment vari Create or edit a `.env` file in the root directory of your application or Langflow environment, and then add your configuration variables to the file: ```text title=".env" -DO_NOT_TRACK=true -LANGFLOW_AUTO_LOGIN=false -LANGFLOW_AUTO_SAVING=true +DO_NOT_TRACK=True +LANGFLOW_AUTO_LOGIN=False +LANGFLOW_AUTO_SAVING=True LANGFLOW_AUTO_SAVING_INTERVAL=1000 -LANGFLOW_BACKEND_ONLY=false +LANGFLOW_BACKEND_ONLY=False LANGFLOW_BUNDLE_URLS=["https://github.com/user/repo/commit/hash"] LANGFLOW_CACHE_TYPE=async LANGFLOW_COMPONENTS_PATH=/path/to/components/ LANGFLOW_CONFIG_DIR=/path/to/config/ LANGFLOW_DATABASE_URL=postgresql://user:password@localhost:5432/langflow -LANGFLOW_DEV=false -LANGFLOW_FALLBACK_TO_ENV_VAR=false +LANGFLOW_DEV=False +LANGFLOW_FALLBACK_TO_ENV_VAR=False LANGFLOW_HEALTH_CHECK_MAX_RETRIES=5 LANGFLOW_HOST=localhost LANGFLOW_LANGCHAIN_CACHE=InMemoryCache @@ -235,13 +233,13 @@ LANGFLOW_MAX_FILE_SIZE_UPLOAD=10000 LANGFLOW_MAX_ITEMS_LENGTH=100 LANGFLOW_MAX_TEXT_LENGTH=1000 LANGFLOW_LOG_LEVEL=error -LANGFLOW_OPEN_BROWSER=false +LANGFLOW_OPEN_BROWSER=False LANGFLOW_PORT=7860 -LANGFLOW_REMOVE_API_KEYS=false -LANGFLOW_SAVE_DB_IN_CONFIG_DIR=true +LANGFLOW_REMOVE_API_KEYS=False +LANGFLOW_SAVE_DB_IN_CONFIG_DIR=True LANGFLOW_SECRET_KEY=somesecretkey -LANGFLOW_STORE=true -LANGFLOW_STORE_ENVIRONMENT_VARIABLES=true +LANGFLOW_STORE=True +LANGFLOW_STORE_ENVIRONMENT_VARIABLES=True LANGFLOW_SUPERUSER=adminuser LANGFLOW_SUPERUSER_PASSWORD=adminpass LANGFLOW_WORKER_TIMEOUT=60000 diff --git a/docs/docs/Contributing/contributing-telemetry.mdx b/docs/docs/Contributing/contributing-telemetry.mdx index 9fa1eda6d..0046fb8e8 100644 --- a/docs/docs/Contributing/contributing-telemetry.mdx +++ b/docs/docs/Contributing/contributing-telemetry.mdx @@ -16,7 +16,7 @@ All telemetry data is anonymized and used solely for improving Langflow. ## Opt out of telemetry -To opt out of telemetry, set the `LANGFLOW_DO_NOT_TRACK` or `DO_NOT_TRACK` environment variable to `true` before running Langflow. This disables telemetry data collection. +To opt out of telemetry, set `DO_NOT_TRACK=True` in your [Langflow environment variables](/environment-variables) before starting Langflow. This disables telemetry data collection. ## Data that Langflow collects diff --git a/docs/docs/Deployment/deployment-kubernetes-prod.mdx b/docs/docs/Deployment/deployment-kubernetes-prod.mdx index c9e374019..87af2524b 100644 --- a/docs/docs/Deployment/deployment-kubernetes-prod.mdx +++ b/docs/docs/Deployment/deployment-kubernetes-prod.mdx @@ -11,7 +11,7 @@ The [Langflow runtime Helm chart](https://github.com/langflow-ai/langflow-helm-c :::important For security reasons, the default Langflow runtime Helm chart sets [`readOnlyRootFilesystem: true`](https://github.com/langflow-ai/langflow-helm-charts/blob/main/charts/langflow-runtime/values.yaml#L46). This setting prevents modifications to the container's root filesystem at runtime, which is a recommended security measure in production environments. -If `readOnlyRootFilesystem` is disabled (`false`), it degrades your deployment's security posture. Only disable this setting if you understand the security implications and you have implemented other security measures. +If `readOnlyRootFilesystem` is disabled (false), it degrades your deployment's security posture. Only disable this setting if you understand the security implications and you have implemented other security measures. For more information, see the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/). ::: diff --git a/docs/docs/Develop/Clients/typescript-client.mdx b/docs/docs/Develop/Clients/typescript-client.mdx index 6f6936a55..a95ccaf55 100644 --- a/docs/docs/Develop/Clients/typescript-client.mdx +++ b/docs/docs/Develop/Clients/typescript-client.mdx @@ -268,7 +268,7 @@ Replace `baseUrl` and `flowId` with values from your deployment. To retrieve [Langflow logs](/logging), you must enable log retrieval on your Langflow server by including the following values in your server's `.env` file: ```text -LANGFLOW_ENABLE_LOG_RETRIEVAL=true +LANGFLOW_ENABLE_LOG_RETRIEVAL=True LANGFLOW_LOG_RETRIEVER_BUFFER_SIZE=10000 LANGFLOW_LOG_LEVEL=DEBUG ``` diff --git a/docs/docs/Develop/develop-application.mdx b/docs/docs/Develop/develop-application.mdx index ee28cb8ee..6a82450eb 100644 --- a/docs/docs/Develop/develop-application.mdx +++ b/docs/docs/Develop/develop-application.mdx @@ -58,8 +58,8 @@ It contains environment variables that control Langflow's behavior, such as auth For example: ```text -LANGFLOW_AUTO_LOGIN=true -LANGFLOW_SAVE_DB_IN_CONFIG_DIR=true +LANGFLOW_AUTO_LOGIN=True +LANGFLOW_SAVE_DB_IN_CONFIG_DIR=True LANGFLOW_BASE_URL=http://0.0.0.0:7860 OPENAI_API_KEY=sk-... ``` diff --git a/docs/docs/Develop/enterprise-database-guide.mdx b/docs/docs/Develop/enterprise-database-guide.mdx index 8c6a38564..d9f22a8ec 100644 --- a/docs/docs/Develop/enterprise-database-guide.mdx +++ b/docs/docs/Develop/enterprise-database-guide.mdx @@ -103,18 +103,20 @@ For more information, see [Configure an external PostgreSQL database](/configura 5. Optional: Run migrations. - Langflow, through SQLAlchemy and Alembic, uses migrations to manage its database schema. - Avoid manual schema changes to prevent conflicts with Langflow's built-in schema management. - + Langflow uses migrations to manage its database schema. When you first connect to PostgreSQL, Langflow automatically runs migrations to create the necessary tables. - To manually run migrations, run `langflow migration` to preview the changes, and then run `langflow migration --fix` to apply the changes. + Direct schema modification can cause conflicts with Langflow's built-in schema management. + If you need to update the schema, you can manually run migrations with the Langflow CLI: - :::danger - Migrations are a destructive operation that can delete data. - Always run `langflow migration` first to preview changes before applying them with `--fix`. - For more information, see [Langflow CLI](/configuration-cli). - ::: + 1. Run `langflow migration` to preview the changes. + + 2. Review the changes to ensure that it's safe to proceed with the migration. + + 3. Run `langflow migration --fix` to run the migration and permanently apply the changes. + + This is a destructive operation that can delete data. + For more information, see [`langflow migration`](/configuration-cli#langflow-migration). 6. To verify the configuration, create any flow using the Langflow visual editor or API, and then query your database to confirm the tables and activity are recorded there. The content of the flow doesn't matter; you only need to confirm that the flow is stored in your PostgreSQL database. You can query the database in two ways: @@ -241,7 +243,7 @@ spec: After implementing HA or Active-Active HA, monitor failover events and ensure replicas are in sync. -Langflow, through [SQLAlchemy](https://docs.sqlalchemy.org/en/20/), supports reconnection attempts, ensures recovery after failover, and reduces disruption once the database is back online. +Langflow, through [SQLAlchemy](https://docs.sqlalchemy.org/en/20/), supports reconnection attempts if `LANGFLOW_DATABASE_CONNECTION_RETRY=True`, ensures recovery after failover, and reduces disruption once the database is back online. Although PostgreSQL handles concurrent connections well, you must still monitor for contention, deadlocks, or other performance degradation during high load. diff --git a/docs/docs/Integrations/Nvidia/integrations-nvidia-ingest.mdx b/docs/docs/Integrations/Nvidia/integrations-nvidia-ingest.mdx index 3ee170b47..98d025a2e 100644 --- a/docs/docs/Integrations/Nvidia/integrations-nvidia-ingest.mdx +++ b/docs/docs/Integrations/Nvidia/integrations-nvidia-ingest.mdx @@ -71,22 +71,22 @@ For more information, see the [NV-Ingest documentation](https://nvidia.github.io |------|--------------|------| | base_url | NVIDIA Ingestion URL | The URL of the NVIDIA Ingestion API. | | path | Path | File path to process. | -| extract_text | Extract Text | Extract text from documents. Default: `True`. | -| extract_charts | Extract Charts | Extract text from charts. Default: `False`. | -| extract_tables | Extract Tables | Extract text from tables. Default: `True`. | -| extract_images | Extract Images | Extract images from document. Default: `True`. | -| extract_infographics | Extract Infographics | Extract infographics from document. Default: `False`. | +| extract_text | Extract Text | Extract text from documents. Default: true. | +| extract_charts | Extract Charts | Extract text from charts. Default: false. | +| extract_tables | Extract Tables | Extract text from tables. Default: true. | +| extract_images | Extract Images | Extract images from document. Default: true. | +| extract_infographics | Extract Infographics | Extract infographics from document. Default: false. | | text_depth | Text Depth | The level at which text is extracted. Options: 'document', 'page', 'block', 'line', 'span'. Default: `page`. | -| split_text | Split Text | Split text into smaller chunks. Default: `True`. | +| split_text | Split Text | Split text into smaller chunks. Default: true. | | chunk_size | Chunk Size | The number of tokens per chunk. Default: `500`. | | chunk_overlap | Chunk Overlap | Number of tokens to overlap from previous chunk. Default: `150`. | -| filter_images | Filter Images | Filter images (see advanced options for filtering criteria). Default: `False`. | +| filter_images | Filter Images | Filter images (see advanced options for filtering criteria). Default: false. | | min_image_size | Minimum Image Size Filter | Minimum image width/length in pixels. Default: `128`. | | min_aspect_ratio | Minimum Aspect Ratio Filter | Minimum allowed aspect ratio (width / height). Default: `0.2`. | | max_aspect_ratio | Maximum Aspect Ratio Filter | Maximum allowed aspect ratio (width / height). Default: `5.0`. | -| dedup_images | Deduplicate Images | Filter duplicated images. Default: `True`. | -| caption_images | Caption Images | Generate captions for images using the NVIDIA captioning model. Default: `True`. | -| high_resolution | High Resolution (PDF only) | Process PDF in high-resolution mode for better quality extraction from scanned PDF. Default: `False`. | +| dedup_images | Deduplicate Images | Filter duplicated images. Default: true. | +| caption_images | Caption Images | Generate captions for images using the NVIDIA captioning model. Default: true. | +| high_resolution | High Resolution (PDF only) | Process PDF in high-resolution mode for better quality extraction from scanned PDF. Default: false. | ### Outputs diff --git a/docs/docs/Integrations/integrations-langsmith.mdx b/docs/docs/Integrations/integrations-langsmith.mdx index de2968d35..2f2eb1952 100644 --- a/docs/docs/Integrations/integrations-langsmith.mdx +++ b/docs/docs/Integrations/integrations-langsmith.mdx @@ -6,22 +6,33 @@ slug: /integrations-langsmith LangSmith is a full-lifecycle DevOps service from LangChain that provides monitoring and observability. To integrate with Langflow, add your LangChain API key and configuration as Langflow environment variables, and then start Langflow. 1. Obtain your LangChain API key from [https://smith.langchain.com](https://smith.langchain.com/) -2. Add the following keys to the Langflow .env file. -Replace `LANGCHAIN_API_KEY` and `LANGSMITH_PROJECT_NAME` with your LangChain API key. +2. Set the following environment variables in your Langflow `.env` file, replacing `LANGCHAIN_API_KEY` and `LANGSMITH_PROJECT_NAME` with your own values: -```text -LANGSMITH_TRACING=true -LANGSMITH_ENDPOINT=https://api.smith.langchain.com/ -LANGSMITH_API_KEY=LANGCHAIN_API_KEY -LANGSMITH_PROJECT=LANGSMITH_PROJECT_NAME -``` + ```text + LANGSMITH_TRACING=True + LANGSMITH_ENDPOINT=https://api.smith.langchain.com/ + LANGSMITH_API_KEY=LANGCHAIN_API_KEY + LANGSMITH_PROJECT=LANGSMITH_PROJECT_NAME + ``` -Alternatively, export the environment variables in your terminal: + Alternatively, you can export the environment variables in your terminal instead of adding them to the `.env` file: -`export LANGSMITH_TRACING=true && export LANGSMITH_ENDPOINT="https://api.smith.langchain.com/" && export LANGSMITH_API_KEY="LANGCHAIN_API_KEY" && export LANGSMITH_PROJECT="LANGSMITH_PROJECT_NAME"` + ```bash + export LANGSMITH_TRACING=True && export LANGSMITH_ENDPOINT="https://api.smith.langchain.com/" && export LANGSMITH_API_KEY="LANGCHAIN_API_KEY" && export LANGSMITH_PROJECT="LANGSMITH_PROJECT_NAME" + ``` + +3. Restart Langflow with your modified `.env` file or from the terminal where you set your environment variables: + + ```bash + langflow run --env-file .env + ``` + + If you set the environment variables in your terminal, you can omit `--env-file`. + However, Langflow can source environment variables from `.env` _and_ your terminal. + For more information, see [Langflow environment variables](/environment-variables). + +4. Run a flow in Langflow to generate some activity. -3. Restart Langflow using `langflow run --env-file .env` -4. Run a flow in Langflow. 5. View the LangSmith dashboard for monitoring and observability. -![LangSmith dashboard](/img/langsmith-dashboard.png) \ No newline at end of file + ![LangSmith dashboard](/img/langsmith-dashboard.png) \ No newline at end of file diff --git a/docs/docs/Support/troubleshooting.mdx b/docs/docs/Support/troubleshooting.mdx index 685e5e096..cfadf7cf6 100644 --- a/docs/docs/Support/troubleshooting.mdx +++ b/docs/docs/Support/troubleshooting.mdx @@ -144,19 +144,15 @@ The following error can occur during Langflow upgrades when the new version can' > Something went wrong running migrations. Please, run 'langflow migration --fix' ``` -To resolve this error, clear the cache by deleting the contents of the Langflow cache folder. +To resolve this error, clear the cache by deleting the contents of your Langflow cache folder. +The filepath depends on your operating system, installation type, and configuration options. +For more information and default filepaths, see [Memory management options](/memory#flow-storage-and-logs). :::important Clearing the cache erases your settings. If you want to retain your settings files, create a backup of those files before clearing the cache folder. ::: -The cache folder location depends on your OS: - -- **Linux**: `home//.cache/langflow/` -- **WSL2 on Windows**: `home//.cache/langflow/` -- **macOS**: `/Users//Library/Caches/langflow/` - ## Langflow uninstall issues The following issues can occur when uninstalling Langflow.