docs: auto saving (#3389)

* Added auto saving page

* Added more auto saving documentation

* Update docs/docs/Configuration/configuration-auto-saving.md

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>

* Update docs/docs/Configuration/configuration-auto-saving.md

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>

* Update docs/docs/Configuration/configuration-auto-saving.md

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>

* Update docs/docs/Configuration/configuration-auto-saving.md

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>

* Update docs/docs/Configuration/configuration-auto-saving.md

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>

* Update docs/docs/Configuration/configuration-auto-saving.md

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>

---------

Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
This commit is contained in:
Lucas Oliveira 2024-08-16 14:20:12 -03:00 • committed by GitHub
commit dc10cdd1d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 80 additions and 68 deletions

View file

@ -0,0 +1,51 @@
---
title: Auto-saving
sidebar_position: 6
slug: /configuration-auto-save
---
Langflow currently supports both manual and auto-saving functionality.
## Auto-saving {#auto-saving}
When Langflow is in Auto-saving mode, all changes are saved automatically. Auto-save progress is indicated in the left side of the top bar: when a flow is being saved, a Loading icon indicates that the flow is being saved in the database.
![](./saving-header.png)
If you try to exit the flow page before auto-save completes, a dialog will appear to confirm you want to exit before the flow has saved.
![](./flow-saving.png)
When the flow has successfully saved, you can click the 'Exit' button.
![](./flow-saved.png)
## Manual Saving {#manual-saving}
When auto-saving is disabled, you need to manually save your flow when making changes. You can still run the flow without saving, for testing purposes.
If you make any changes and Langflow detects that the saved flow is different from the current flow, a Save button will be enabled and the last time saved will appear at the left side of the topbar. To save the flow, click the Save button, or hit Ctrl+S or Command+S.
![](./manual-save-button.png)
If you try to exit after making changes and not saving, a confirmation dialog will appear. You can choose to exit anyway or save and exit.
![](./flow-unsaved.png)
## Disable Auto Saving {#environment}
In Langflow, all changes made in the flows are saved automatically. However, you may prefer to disable this functionality, if you want a quick way to prototype and test changes before they are actually saved to the database.
If you wish to disable this functionality, you can run Langflow with an environment variable to tell Langflow to use manual saving.
```shell
langflow --no-auto-saving
# or
python -m langflow --no-auto-saving
```
If you installed the local version of Langflow, you can set an environment variable and load it automatically by inserting this line into the `.env` file inside the directory.
```env
LANGFLOW_AUTO_SAVING=false
```

View file

@ -4,20 +4,14 @@ sidebar_position: 2
slug: /configuration-cli slug: /configuration-cli
--- ---
:::info :::info
This page may contain outdated information. It will be updated as soon as possible. This page may contain outdated information. It will be updated as soon as possible.
::: :::
Langflow's Command Line Interface (CLI) is a powerful tool that allows you to interact with the Langflow server from the command line. The CLI provides a wide range of commands to help you shape Langflow to your needs. Langflow's Command Line Interface (CLI) is a powerful tool that allows you to interact with the Langflow server from the command line. The CLI provides a wide range of commands to help you shape Langflow to your needs.
The available commands are below. Navigate to their individual sections of this page to see the parameters. The available commands are below. Navigate to their individual sections of this page to see the parameters.
- [langflow](/configuration-cli) - [langflow](/configuration-cli)
@ -29,10 +23,8 @@ The available commands are below. Navigate to their individual sections of this
## Overview {#c50e5530289349cf8ed7bee22ba2211a} ## Overview {#c50e5530289349cf8ed7bee22ba2211a}
Running the CLI without any arguments displays a list of available options and commands. Running the CLI without any arguments displays a list of available options and commands.
```shell ```shell
langflow langflow
# or # or
@ -42,7 +34,6 @@ python -m langflow
``` ```
| Command | Description | | Command | Description |
| ----------- | ---------------------------------------------------------------------- | | ----------- | ---------------------------------------------------------------------- |
| `api-key` | Creates an API key for the default superuser if AUTO_LOGIN is enabled. | | `api-key` | Creates an API key for the default superuser if AUTO_LOGIN is enabled. |
@ -51,23 +42,18 @@ python -m langflow
| `run` | Run the Langflow. | | `run` | Run the Langflow. |
| `superuser` | Create a superuser. | | `superuser` | Create a superuser. |
### Options {#8a3b5b7ed55b4774ad6d533bb337ef47} ### Options {#8a3b5b7ed55b4774ad6d533bb337ef47}
| Option | Description | | Option | Description |
| ---------------------- | -------------------------------------------------------------------------------- | | ---------------------- | -------------------------------------------------------------------------------- |
| `--install-completion` | Install completion for the current shell. | | `--install-completion` | Install completion for the current shell. |
| `--show-completion` | Show completion for the current shell, to copy it or customize the installation. | | `--show-completion` | Show completion for the current shell, to copy it or customize the installation. |
| `--help` | Show this message and exit. | | `--help` | Show this message and exit. |
## langflow api-key {#dbfc8c4c83474b83a38bdc7471bccf41} ## langflow api-key {#dbfc8c4c83474b83a38bdc7471bccf41}
Run the `api-key` command to create an API key for the default superuser if `LANGFLOW_AUTO_LOGIN` is set to `True`. Run the `api-key` command to create an API key for the default superuser if `LANGFLOW_AUTO_LOGIN` is set to `True`.
```shell ```shell
langflow api-key langflow api-key
# or # or
@ -85,37 +71,27 @@ python -m langflow api-key
``` ```
### Options {#ec2ef993dc984811b25838c8d8230b31} ### Options {#ec2ef993dc984811b25838c8d8230b31}
| Option | Type | Description | | Option | Type | Description |
| ----------- | ---- | ------------------------------------------------------------- | | ----------- | ---- | ------------------------------------------------------------- |
| --log-level | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] | | --log-level | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] |
| --help | | Show this message and exit. | | --help | | Show this message and exit. |
## langflow copy-db {#729a13f4847545e5973d8f9c20f8833d} ## langflow copy-db {#729a13f4847545e5973d8f9c20f8833d}
Run the `copy-db` command to copy the cached `langflow.db` and `langflow-pre.db` database files to the current directory. Run the `copy-db` command to copy the cached `langflow.db` and `langflow-pre.db` database files to the current directory.
If the files exist in the cache directory, they will be copied to the same directory as `__main__.py`, which can be found with `which langflow`. If the files exist in the cache directory, they will be copied to the same directory as `__main__.py`, which can be found with `which langflow`.
### Options {#7b7e6bd02b3243218e1d666711854673} ### Options {#7b7e6bd02b3243218e1d666711854673}
None. None.
## langflow migration {#7027c1925a444119a7a8ea2bff4bd16d} ## langflow migration {#7027c1925a444119a7a8ea2bff4bd16d}
Run or test migrations with the Alembic database tool. Run or test migrations with the Alembic database tool.
```shell ```shell
langflow migration langflow migration
# or # or
@ -123,23 +99,18 @@ python -m langflow migration
``` ```
### Options {#0b38fbe97bb34edeb7740a7db58433e9} ### Options {#0b38fbe97bb34edeb7740a7db58433e9}
| Option | Description | | Option | Description |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------- | | ------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `--test, --no-test` | Run migrations in test mode. [default: test] | | `--test, --no-test` | Run migrations in test mode. [default: test] |
| `--fix, --no-fix` | Fix migrations. This is a destructive operation, and should only be used if you know what you are doing. [default: no-fix] | | `--fix, --no-fix` | Fix migrations. This is a destructive operation, and should only be used if you know what you are doing. [default: no-fix] |
| `--help` | Show this message and exit. | | `--help` | Show this message and exit. |
## langflow run {#fe050aa659cb4d33a560b859d54c94ea} ## langflow run {#fe050aa659cb4d33a560b859d54c94ea}
Run Langflow. Run Langflow.
```shell ```shell
langflow run langflow run
# or # or
@ -147,12 +118,10 @@ python -m langflow run
``` ```
### Options {#4e811481ec9142f1b60309bb1ce5a2ce} ### Options {#4e811481ec9142f1b60309bb1ce5a2ce}
| Option | Description | | Option | Description |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--help` | Displays all available options. | | `--help` | Displays all available options. |
| `--host` | Defines the host to bind the server to. Can be set using the `LANGFLOW_HOST` environment variable. The default is `127.0.0.1`. | | `--host` | Defines the host to bind the server to. Can be set using the `LANGFLOW_HOST` environment variable. The default is `127.0.0.1`. |
| `--workers` | Sets the number of worker processes. Can be set using the `LANGFLOW_WORKERS` environment variable. The default is `1`. | | `--workers` | Sets the number of worker processes. Can be set using the `LANGFLOW_WORKERS` environment variable. The default is `1`. |
@ -171,37 +140,29 @@ python -m langflow run
| `--show-completion [bash\|zsh\|fish\|powershell\|pwsh]` | Shows completion for the specified shell, allowing you to copy it or customize the installation. | | `--show-completion [bash\|zsh\|fish\|powershell\|pwsh]` | Shows completion for the specified shell, allowing you to copy it or customize the installation. |
| `--backend-only` | This parameter, with a default value of `False`, allows running only the backend server without the frontend. It can also be set using the `LANGFLOW_BACKEND_ONLY` environment variable. | | `--backend-only` | This parameter, with a default value of `False`, allows running only the backend server without the frontend. It can also be set using the `LANGFLOW_BACKEND_ONLY` environment variable. |
| `--store` | This parameter, with a default value of `True`, enables the store features, use `--no-store` to deactivate it. It can be configured using the `LANGFLOW_STORE` environment variable. | | `--store` | This parameter, with a default value of `True`, enables the store features, use `--no-store` to deactivate it. It can be configured using the `LANGFLOW_STORE` environment variable. |
| `--auto-saving` | This parameter, with a default value of `True`, enables the auto-saving functionality, use `--no-auto-saving` to deactivate it. It can be configured using the `LANGFLOW_AUTO_SAVING` environment variable. |
### CLI environment variables {#5868aaccfcc74e26968538ef4d07e756} ### CLI environment variables {#5868aaccfcc74e26968538ef4d07e756}
You can configure many of the CLI options using environment variables. These can be exported in your operating system or added to a `.env` file and loaded using the `--env-file` option. You can configure many of the CLI options using environment variables. These can be exported in your operating system or added to a `.env` file and loaded using the `--env-file` option.
A sample `.env` file named `.env.example` is included with the project. Copy this file to a new file named `.env` and replace the example values with your actual settings. If you're setting values in both your OS and the `.env` file, the `.env` settings will take precedence. A sample `.env` file named `.env.example` is included with the project. Copy this file to a new file named `.env` and replace the example values with your actual settings. If you're setting values in both your OS and the `.env` file, the `.env` settings will take precedence.
## langflow superuser {#5944233ce0c942878e928e1f2945d717} ## langflow superuser {#5944233ce0c942878e928e1f2945d717}
Create a superuser for Langflow. Create a superuser for Langflow.
```shell ```shell
langflow superuser langflow superuser
# or # or
python -m langflow superuser python -m langflow superuser
``` ```
### Options {#f333c5635ead4c3d95985467bb08cc8f} ### Options {#f333c5635ead4c3d95985467bb08cc8f}
| Option | Type | Description | | Option | Type | Description |
| ------------- | ---- | ------------------------------------------------------------- | | ------------- | ---- | ------------------------------------------------------------- |
| `--username` | TEXT | Username for the superuser. [default: None] [required] | | `--username` | TEXT | Username for the superuser. [default: None] [required] |
| `--password` | TEXT | Password for the superuser. [default: None] [required] | | `--password` | TEXT | Password for the superuser. [default: None] [required] |
| `--log-level` | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] | | `--log-level` | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] |
| `--help` | | Show this message and exit. | | `--help` | | Show this message and exit. |

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View file

@ -1853,15 +1853,10 @@
html-react-parser "^4.2.0" html-react-parser "^4.2.0"
posthog-js "^1.45.1" posthog-js "^1.45.1"
"@node-rs/jieba-linux-x64-gnu@1.10.3": "@node-rs/jieba-darwin-arm64@1.10.3":
version "1.10.3" version "1.10.3"
resolved "https://registry.npmjs.org/@node-rs/jieba-linux-x64-gnu/-/jieba-linux-x64-gnu-1.10.3.tgz" resolved "https://registry.npmjs.org/@node-rs/jieba-darwin-arm64/-/jieba-darwin-arm64-1.10.3.tgz"
integrity sha512-GF5cfvu/0wXO2fVX/XV3WYH/xEGWzMBvfqLhGiA1OA1xHIufnA1T7uU3ZXkyoNi5Bzf6dmxnwtE4CJL0nvhwjQ== integrity sha512-dwPhkav1tEARskwPz91UUXL2NXy4h0lJYTuJzpGgwXxm552zBM2JJ41kjah1364j+EOq5At3NQvf5r5rH89phQ==
"@node-rs/jieba-linux-x64-musl@1.10.3":
version "1.10.3"
resolved "https://registry.npmjs.org/@node-rs/jieba-linux-x64-musl/-/jieba-linux-x64-musl-1.10.3.tgz"
integrity sha512-h45HMVU/hgzQ0saXNsK9fKlGdah1i1cXZULpB5vQRlRL2ZIaGp+ULtWTogS7vkoo2K8s2l4tqakWMg9eUjIJ2A==
"@node-rs/jieba@^1.6.0": "@node-rs/jieba@^1.6.0":
version "1.10.3" version "1.10.3"
@ -5602,6 +5597,11 @@ fs.realpath@^1.0.0:
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
fsevents@~2.3.2:
version "2.3.3"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
function-bind@^1.1.2: function-bind@^1.1.2:
version "1.1.2" version "1.1.2"
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz"